Copied to clipboard

Flag this post as spam?

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


  • Jason Elkin 38 posts 351 karma points MVP 3x c-trib
    Apr 12, 2017 @ 10:17
    Jason Elkin
    1

    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:

    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.

    Has anyone got any Ideas? Many thanks,

    Jason

  • Manish 373 posts 932 karma points
    Apr 13, 2017 @ 12:15
  • Jason Elkin 38 posts 351 karma points MVP 3x c-trib
    Apr 13, 2017 @ 14:48
    Jason Elkin
    105

    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:

    INFO - ApplicationUrl: http://www.eaxmanle.com/umbraco (UmbracoModule request) 
    

    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:

    DEBUG - Scheduled publishing executing @ http://www.example.com/umbraco/RestServices/ScheduledPublish/Index  
    DEBUG - Begin request: https://www.example.com/umbraco/RestServices/ScheduledPublish/Index.
    

    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:

    DEBUG - Scheduled publishing executing @ https://www.example.com:443/umbraco/RestServices/ScheduledPublish/Index  
    DEBUG - Begin request: https://www.example.com/umbraco/RestServices/ScheduledPublish/Index.
    

    This behaviour seems like a bug, I'll raise a report.

  • Matty 34 posts 148 karma points
    Apr 04, 2018 @ 22:41
    Matty
    0

    This fixed it for me as well. Thanks :)

  • Rai 2 posts 72 karma points
    Aug 21, 2018 @ 00:31
    Rai
    0

    Thanks Jason, saved my day (:

  • Nik 1625 posts 7295 karma points MVP 7x c-trib
    Apr 13, 2017 @ 15:54
    Nik
    0

    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.

  • Jason Elkin 38 posts 351 karma points MVP 3x c-trib
    Apr 13, 2017 @ 16:02
    Jason Elkin
    0

    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:

    Begin request: https://www.example.com/umbraco/RestServices/ScheduledPublish/Index.
    
  • Nik 1625 posts 7295 karma points MVP 7x c-trib
    Apr 13, 2017 @ 16:16
    Nik
    0

    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.

  • Jason Elkin 38 posts 351 karma points MVP 3x c-trib
    Apr 13, 2017 @ 16:36
    Jason Elkin
    0

    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.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies