Copied to clipboard

Flag this post as spam?

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


  • Stephen Roberts 47 posts 516 karma points c-trib
    Nov 24, 2017 @ 10:23
    Stephen Roberts
    0

    Scheduled publish behind LB only working on master

    Hey all,

    I've got a weird issue on a site which is LB'd

    • Flexible load balancing
    • Independant Folders (with media on azure but servers are non-azure)
    • One instance is used for the back office
    • I have a custom IServerRegistrar2 to ensure that server is the master
    • All servers have their umbracoApplicationUrl set to a domain which is in the hosts file to itself
    • 7.7.1

    Publishing in the back office works fine, you publish the the change appears on the other instances all is well in the world until you try to schedule a publish. When that occurs the content is only published on the master and not any other instances.

    Digging further there are no instructions added to the umbracoCacheInstruction for a scheduled publish so that explains why the master gets the update.

    Anyone have any suggestions?

    Thanks Stephen

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Nov 24, 2017 @ 11:03
    Jeavon Leopold
    0

    Sounds like an odd one that I haven't seen before :)

    Only thing I can think of is to check that umbracoApplicationUrl should be the same on all servers and pointing to the Umbraco (master scheduling) server and as you said all servers should be able to resolve that domain.

    FYI, there is a handy diagram about this here

    It is odd that no instructions were added to the umbracoCacheInstruction table, I would expect that there would be, otherwise indeed the slaves are not going to update.

    I will do a bit of code digging also.

  • Stephen Roberts 47 posts 516 karma points c-trib
    Nov 24, 2017 @ 13:43
    Stephen Roberts
    0

    Ta Jeavon,

    Looking at the docs on https://our.umbraco.org/documentation/Reference/Config/umbracoSettings/

    it states

    umbracoApplicationUrl: defines the Umbraco application url, ie how the server should reach itself. By default, Umbraco will guess that url from the first request made to the server. Use that setting if the guess is not correct (because you are behind a load-balancer, for example). Format is: "http://www.mysite.com/umbraco" ie it needs to contain the scheme (http/https), complete hostname, and umbraco path.

    I took this to mean that the url is used on all instances to point to itself and not the master (for ease of deployment it is set to a site.local domain and this is added in the hosts file to 127.0.0.1)

    Could that be the issue?

  • Stephen Roberts 47 posts 516 karma points c-trib
    Nov 24, 2017 @ 15:20
    Stephen Roberts
    0

    I have verified this issue locally on 771 and 776.

    For a scheduled publish it appears there is no cache instruction being added to the database when the publish happens. I've opened issue http://issues.umbraco.org/issue/U4-10715

    Thanks Stephen

  • Leo Pangan 5 posts 94 karma points
    Nov 27, 2017 @ 09:38
    Leo Pangan
    0

    I have the same setup and exactly the same thing was happening.

    When a scheduled publish happens, in BatchedDatabaseServerMessenger it appears the instructions are still getting collected in HttpContext.Items (from the UmbracoContext produced by EnsureContext I assume?), but they aren't getting saved to the DB because EndRequest is not raised. I think this was an effect of the change in scheduled publishing in 7.7.0.

    I have not tested it on a vanilla install so I'm not sure if the issue is caused by a custom implementation we've done before.

    As a workaround for now, I've created a custom BatchedDatabaseServerMessenger that manually calls FlushBatch() when it's a scheduled publish.

Please Sign in or register to post replies

Write your reply to:

Draft