Copied to clipboard

Flag this post as spam?

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


  • Dawid 26 posts 136 karma points c-trib
    May 17, 2017 @ 13:52
    Dawid
    0

    Scheduled Publishing doesn't work

    Hi

    Scheduled publishing is not working. After setting up the Publish At date, nothing happens when this date is passed.

    Umbraco version:

    Umbraco version 7.6.1 assembly: 1.0.6337.40631

    Only entry I could find in Log files after changing log level to DEBUG was :

    DEBUG Umbraco.Web.Scheduling.ScheduledPublishing - Does not run on slave servers. DEBUG Umbraco.Web.Scheduling.ScheduledTasks - Does not run on slave servers.

    I've found some similar errors in those posts : https://our.umbraco.org/forum/core/general/63695-Scheduled-tasks-not-working-in-load-balanced-environment

    Also I've applied all instructions from this documentation page : https://our.umbraco.org/documentation/Getting-Started/Data/Scheduled-Publishing/

    Especially :

    umbracoSettings:settings/web.routing/@umbracoApplicationUrl if it exists (see these docs for details)

    The SSL is turned off for this website.

    1. Web site is setup locally on IIS with Azure SQL Server database.
    2. This database is also used for website that is set up on Azure.
    3. This is dev environment.

    Thanks in advance for any help

    Best regards,

    Dawid

  • Marc Goodson 2138 posts 14321 karma points MVP 8x c-trib
    May 17, 2017 @ 20:14
    Marc Goodson
    2

    Hi Dawid

    You can see the code in the core that determines whether or now a server is branded a 'slave' server or a master...

    https://github.com/umbraco/Umbraco-CMS/blob/5dc3e0a3fcbf2fd4d2cd62fbbd37743571d01057/src/Umbraco.Core/Sync/ConfigServerRegistrar.cs

    (and scheduled tasks won't run on a 'slave' server or in a load balanced scenario the tasks would be triggered to run multiple times on each server)

    Anyway depending on your settings in the /config/umbracosettings.config file for distributed calls this will affect whether a server is determined as being a slave or master. The other setting in this file that influences this is the UmbracoApplicationUrl property in the Web.Routing section of the config file (at the bottom)

    So if you post those settings here we can have a bit of a guess as to what is going awry.

    Essentially though if DistributedCalls is turned off, your setup is using Flexible load balancing, and the servers will pick a random server to be the master - but you can override this (and it's recommended to do this) to write some code to fix a certain server as being the master where scheduling runs:

    https://our.umbraco.org/documentation/getting-started/setup/server-setup/load-balancing/flexible-advanced#explicit-master-scheduling-server

    if Distributed Calls is turned on, your using Traditional load balancing, and the first server defined in the list if the servers is considered to be the master.

  • Dawid 26 posts 136 karma points c-trib
    May 18, 2017 @ 08:34
    Dawid
    0

    Screen shot from configuration:

    enter image description here

    I will try to implement you suggestion from this link: https://our.umbraco.org/documentation/getting-started/setup/server-setup/load-balancing/flexible-advanced#explicit-master-scheduling-server.

    Thanks for help :)

  • Dawid 26 posts 136 karma points c-trib
    May 18, 2017 @ 14:18
    Dawid
    0

    The website works locally with the custom IServerRegistrar2, but not on Azure.

    It seems that the Azure is not picking up the documents to be released...

  • Dawid 26 posts 136 karma points c-trib
    May 19, 2017 @ 11:37
    Dawid
    0

    So the Scheduled Publishing still doesn't work on Azure. Looking at logs it seems that the tasks is being created and executed without any error, but the item is still not published in the backoffice.

    enter image description here

    enter image description here

  • Dawid 26 posts 136 karma points c-trib
    May 19, 2017 @ 13:34
    Dawid
    0

    It seems that ScheduledPublishController cannot be called.

    I've added this piece of code to Umbraco:

    LogHelper.Debug<ScheduledPublishing>(() => "Send Async Request to the url" + url);
    var result = await wc.SendAsync(request, token);
    var content = await result.Content.ReadAsStringAsync();
    LogHelper.Debug<ScheduledPublishing>(() => "result " + content + "; " + result.StatusCode );
    

    Entry in Logs:

     2017-05-19 13:26:58,203 [P21880/D23/T141] DEBUG Umbraco.Web.Scheduling.ScheduledPublishing - result The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.; NotFound
    

    It seems that the ScheduledPublishController is not being hit. It works on local environment though. Maybe this is some restriction issue. We have a restriction in the web.config for a list of IP's.

      <security>
        <requestFiltering>
          <requestLimits maxAllowedContentLength="52428800" />
        </requestFiltering>
        <ipSecurity allowUnlisted="false" denyAction="NotFound">
          <!-- "clear" removes all upstream restrictions -->
          <clear />
          <!-- permit the loopback address  -->
          <add ipAddress="127.0.0.1" allowed="true" />
     ......
         <add allowed="true" ipAddress="XXX.XXX.XXX.XXX" subnetMask="255.255.255.224" />
    
        <add allowed="true" ipAddress="XXX.XXX.XXX.XXX" subnetMask="255.255.255.224" />
    

    I will check that lead later.

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    May 18, 2017 @ 07:00
    Dave Woestenborghs
    0

    Hi David,

    I would also not recommend to connect your local (development I suppose) environment to the same database that is used by another website. As I see that the database is used by a another website that is hosted in Azure. I presume this is your live website.

    Why not do this. First of all you already ran into the problem that Umbraco sees this as a load balanced website.

    Secondly, and even more important, changing anything in Umbraco configuration (doctypes, datatypes, dictionairy, etc...) are reflected immediatly on live. If your code their can't handle these changes you end up with a broken live website.

    Also changes in content (for testing purposes) will be visible on live immediatly.

    Dave

  • Dawid 26 posts 136 karma points c-trib
    May 18, 2017 @ 08:18
    Dawid
    0

    Thanks for you advice.

    Our agreement with client requires to keep the database on Azure server.

    My local environment is connected to DEV environment. It would be not very smart to connect it to production database :)

    Although same problem occures on Azure Website on staging and live environments.

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    May 18, 2017 @ 08:43
    Dave Woestenborghs
    0

    Okay,

    Do you have multiple instances running for your webapp ? That can also cause this.

    Dave

  • Dawid 26 posts 136 karma points c-trib
    May 21, 2017 @ 08:54
    Dawid
    0

    Ok, so the reason why this is happening is due to IP restriction list in web.config. After removing all restrictions, scheduled publishing works...

    But I cannot remove all restrictions, so I've tried to add the domainName to restriction list but it still doesn't work.

    My entry in web.config for ipSecurity

    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="52428800" />
      </requestFiltering>
      <ipSecurity allowUnlisted="false" denyAction="NotFound">
        <!-- "clear" removes all upstream restrictions -->
        <clear />
        <!-- permit the loopback address  -->
        <add ipAddress="127.0.0.1" allowed="true" />
    
        <!-- domain Name for Scheduled Publishing -->
        <add allowed="true" domainName="xxxx-xxx-umbraco.azurewebsites.net"/>
    
      </ipSecurity>
    </security>
    
  • Dawid 26 posts 136 karma points c-trib
    May 22, 2017 @ 10:42
    Dawid
    100

    SOLUTION

    Azure provides a list of Outbound IP addresses that can be added to whitelist. You can get them from the Azure Portal -> App Service -> Properties -> Outbound IP Addresses.

    enter image description here

    Then add them to the IP Security list:

    enter image description here

    NOTE

    The Outbound IP Address list might be extended by Azure. Some info about that: https://feedback.azure.com/forums/169385-web-apps/suggestions/6428310-static-ip-addresses-inbound-and-outbound-for-a

    http://stackoverflow.com/questions/21450619/how-to-determine-azure-website-outgoing-ip-address

    https://docs.microsoft.com/en-us/azure/app-service-web/app-service-app-service-environment-intro

Please Sign in or register to post replies

Write your reply to:

Draft