Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Johnathan Le 10 posts 40 karma points
    Jan 04, 2023 @ 08:56
    Johnathan Le
    0

    Use ContentService.SaveAndPublish in LB, one front-site works, another one is Page Not Found

    Hi all,

    I have an issue when trying to the copy and publish programmatically the content with LB deployment (2 front-site nodes + 1 backoffice node). However I got the issue then my content can be found one front-site node, another one is returned Page Not Found. I know I should wait for a while but it doesn't work at all.

    There are my sample code for copying and publishing

     var copiedContent = _contentService.Copy(sourceContent, targetParent.Id, true, false);
     var publishedResult = _contentService.SaveAndPublish(copiedContent);
    

    And in the appsettings.json, in front sites

    "Umbraco": {
      "CMS": {
        "Examine":{
          "LuceneDirectoryFactory": "TempFileSystemDirectoryFactory"
        },
        "Content": {
          "ContentVersionCleanupPolicy": {
            "EnableCleanup": true
          }
        },
        "WebRouting":{
          "UmbracoApplicationUrl": "https://{BackOffice-Domain}"
        }
      }
    },
    

    appsettings.json of BackOffice

    "Umbraco": {
      "CMS": {
        "Examine":{
          "LuceneDirectoryFactory": "SyncedTempFileSystemDirectoryFactory"
        },
        "Content": {
          "ContentVersionCleanupPolicy": {
            "EnableCleanup": true
          }
        },
        "WebRouting":{
          "UmbracoApplicationUrl": "https://{BackOffice-Domain}"
        }
      }
    },
    

    Each FrontSite and BackOffice is use explicit registrar as Umbraco Docs. I also use the SqlServer as DistributedCache, I don't share the Temp folder which contains the Lucene, each server use own disk to store.

    Hope to get your help.

    Regards

Please Sign in or register to post replies

Write your reply to:

Draft