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.
(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:
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.
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.
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.
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.
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.
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.
Thanks in advance for any help
Best regards,
Dawid
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.
Screen shot from configuration:
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 :)
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...
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.
It seems that ScheduledPublishController cannot be called.
I've added this piece of code to Umbraco:
Entry in Logs:
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.
I will check that lead later.
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
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.
Okay,
Do you have multiple instances running for your webapp ? That can also cause this.
Dave
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
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.
Then add them to the IP Security list:
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
is working on a reply...