Nodes are not publishing or unpublishing as expected.
The site is able to ping itself and run scheduled tasks and according to the logs the actual ScheduledPublishing task is running correctly:
INFO - [ScheduledPublishing] Waiting for tasks to complete
DEBUG - Begin request: https://<URL Omitted>/umbraco/RestServices/ScheduledPublish/Index.
DEBUG - [ScheduledPublishing] Task added Umbraco.Web.Scheduling.ScheduledPublishing
DEBUG - [ScheduledPublishing] Starting
DEBUG - [ScheduledTasks] Task added Umbraco.Web.Scheduling.ScheduledTasks
DEBUG - [ScheduledTasks] Starting
INFO - [ScheduledPublishing] Tasks completed, terminated
If we run the site on our test server, or locally, it works as expected. Our other sites (a direct fork of this site's codebase, running in an identical hosting environment) also automatically publish and un-publish content as expected.
Thanks Manish, those were some really helpful pointers!
I've now got it working, but it was a lot of trial and error.
It turns out that if the site is running on HTTPS and http://www.example.com is redirected to https://www.example.com and <add key="umbracoUseSSL" value="false" /> is set in the Web.Config then Umbraco fails to infer the correct ApplicationUrl:
What's most interesting about this is that we get no errors and the logs show that Umbraco thinks that the URL is resolving and ScheduledPublishing is running fine:
As soon as we set <add key="umbracoUseSSL" value="true" /> in the Web.Config file in production then everything works fine, but note the subtle change in the logs:
If you have a redirect rule directing traffic from HTTP to HTTPS, you would need to put an exception in it for the Umbraco back office if you aren't going to have the back office use SSL (which I advise against)
I don't see it as a bug per-say, I would say it is IIS interfering and changing requests when it performs its redirect/rewrite.
I've had issues with this when testing api controllers that work in the back-office.
Are you sure about that? The Begin Request might be it calling that url but I agree it's not indicating any failure or redirect happening which would be useful.
I can only see this because AI logs all HTTP requests and their status code. No exceptions were raised that made it to Umbraco the logs.
I can only guess that Umbraco was just happy that it got a response, and logged the scheduled task as having been completed, ignoring the fact the the URL ultimately returned a 500 status.
Now that I have set <add key="umbracoUseSSL" value="true" /> the HTTP requests no longer result in an HTTP error.
Scheduled publish (and unpublish) not working
Nodes are not publishing or unpublishing as expected.
The site is able to ping itself and run scheduled tasks and according to the logs the actual
ScheduledPublishing
task is running correctly:If we run the site on our test server, or locally, it works as expected. Our other sites (a direct fork of this site's codebase, running in an identical hosting environment) also automatically publish and un-publish content as expected.
Has anyone got any Ideas? Many thanks,
Jason
Hi
This seems bug to me, I have also asked many time but there is not satisfactory answer on this
here is posts which may help you (Please let us know if it works because none of them was working)
https://our.umbraco.org/forum/using-umbraco-and-getting-started/77387-published-at-is-not-working-for-scheduled-time
https://our.umbraco.org/forum/ourumb-dev-forum/bugs/57914-Unpublish-at-not-unpublishing
https://our.umbraco.org/forum/using-umbraco-and-getting-started/77023-scheduled-publishing-is-not-working
https://our.umbraco.org/forum/using-umbraco-and-getting-started/77215-scheduledpublishing-failed-keepalive-failed
Thanks Manish, those were some really helpful pointers!
I've now got it working, but it was a lot of trial and error.
It turns out that if the site is running on HTTPS and http://www.example.com is redirected to https://www.example.com and
<add key="umbracoUseSSL" value="false" />
is set in the Web.Config then Umbraco fails to infer the correct ApplicationUrl:What's most interesting about this is that we get no errors and the logs show that Umbraco thinks that the URL is resolving and ScheduledPublishing is running fine:
As soon as we set
<add key="umbracoUseSSL" value="true" />
in the Web.Config file in production then everything works fine, but note the subtle change in the logs:This behaviour seems like a bug, I'll raise a report.
This fixed it for me as well. Thanks :)
Thanks Jason, saved my day (:
If you have a redirect rule directing traffic from HTTP to HTTPS, you would need to put an exception in it for the Umbraco back office if you aren't going to have the back office use SSL (which I advise against)
I don't see it as a bug per-say, I would say it is IIS interfering and changing requests when it performs its redirect/rewrite.
I've had issues with this when testing api controllers that work in the back-office.
Yeah, of course umbracoUseSSL should be set to true and the initial configuration was wrong.
The behaviour makes perfect sense, but the logging and complete lack of any exception does not - that's the bug I'm talking about.
Scheduled publishing silently fails and the logs explicitly say that it was completed, even though it wasn't.
Also the logs suggest that whether umbracoUseSSL was true or false the actual resolved request URL was still the same:
Are you sure about that? The Begin Request might be it calling that url but I agree it's not indicating any failure or redirect happening which would be useful.
Well, the plot thickens...
I forgot that I had this site hooked up to Application Insights and I've just found out that all calls to the URL https://www.example.com/umbraco/RestServices/ScheduledPublish/Index were being carried out but were resulting in a 500 error.
I can only see this because AI logs all HTTP requests and their status code. No exceptions were raised that made it to Umbraco the logs.
I can only guess that Umbraco was just happy that it got a response, and logged the scheduled task as having been completed, ignoring the fact the the URL ultimately returned a 500 status.
Now that I have set
<add key="umbracoUseSSL" value="true" />
the HTTP requests no longer result in an HTTP error.is working on a reply...