I'm experiencing some issues with the auto Publish At / Unpublish At functionality in Umbraco version 7.2.6
The Publish At function fails to make the page available after the datetime has passed. The backoffice registers the page as published, but with the "Oops: this document is published but is not in the cache (internal error)" message. This is fixed when someone manually fires the 'Republish Entire Site' function which then makes the page accessible.
The Unpublish At function also registers the page as unpublished in the backoffice after the set datetime but the page is still accessible on the website until someone manually fires the 'Republish Entire Site' function, then the page is unpublished properly and inaccessible.
I've tried a number of workarounds to no avail, including adding ContentServicePublished / ContentServiceUnPublished events that try to 'Republish Entire Site' on auto pub/unpublish. I've listed the code below:
I realise 'umbraco.cms.businesslogic.web.Document.RePublishAll();' is obsolete but I had to try it seeing 'umbraco.library.RefreshContent();' wasn't working for me (in Azure).
I also noticed is that the .ReleaseDate property is always null, making it very difficult to determine whether an item was published manually or automatically published via the Publish At function. Is there another way to determine the auto published nature of the item in this context?
Steps to recreate all of the above issues:
In the backoffice, create a page node anywhere, populate it with any misc content, then hit Save and Publish. Visit the URL to see the page live.
Back in the backoffice, select an Unpublish At datetime for a few mins from now.
Wait it out and hit the expected URL for a while after the scheduled datetime, the page should still be incorrectly accessible as described above. Refresh the backoffice to see that Umbraco registers the page as unpublished, yet the page still renders.
Click 'Republish Entire Site' and try the page again, it should be properly unpublished.
Create a new node/page and just hit Save this time, not Save and Publish. Hopefully you can determine the expected URL, it'll help to test.
Set a Publish At datetime to a few mins from now. Hit the expected URL to see the page correctly not load or exist.
Wait it out and hit the expected URL for a while after the scheduled datetime and see if the page loads. Did the page load?
Check in the backoffice to see that the node is registered as published but doesn't resolve on the site. You may see the "Oops: this document is published but is not in the cache (internal error)" message displayed.
Republish the entire site again and access the page, it should load fine now.
I hope to find a solution to these issues as scheduled content are integral. I'd even accept a hack job / workaround at this point seeing I've already invested much into this project build.
I'm also thinking about disabling the XML cache altogether but I fear that it may slow the site down too much - but I have CDN options so I might be able to get away with it if it solves the issues.
Great post with details. The most obvious cause would be if you were using multiple instances in WebSites, which is not currently supported without very specific configuration.
If you could confirm you are running on a single instance and, if not, make sure that's how your WebSites scale is configured.
The good news is that with 7.3.0+ you will be able to run with multiple instances without much additional work. Have a look at Shannon's excellent Codegarden session to get an idea of what's coming:
We are running Umbraco on an Azure Web App with auto scale off so it is running as a single instance currently.
Azure web apps have an internal traffic manager by design which allows for immutable deployment slots and switching in new deployments through production. So currently our user would browse to the azurewebsites URL, which hits an internal traffic manager and goes to our production slot which is a single instance site at this moment.
I'll have time to watch that video a little later today, but version 7.3.0 sounds more tailored for Azure websites from the sound of it. I see the target release date is 12 June 2015, hopefully it will be released soon.
I just turned off Umbraco's XML cache and redeployed to the Azure website and the scheduled publish/unpublish functionality still didn't work without a human to manually click "Republish Entire Site".
Is there any sort of workaround to bypass this bug? I noticed this bug also occurs when testing locally so maybe it's not just limited to Azure Websites (will edit the initial thread post).
One thing that I found very curious is that even with XML cache turned off, the Umbraco backoffice still gives me the "Oops: this document is published but is not in the cache (internal error)" message after the unpublished page should have been auto published after the date.
Probably the memory version of the very same cache you would otherwise also store on disk. if i recall correctly, the disk version of the cache is only there to speed up recycle times (reading it, and then keeping it in memory)
Is there any way for the ContentServicePublished / ContentServiceUnPublished events to differentiate between the nodes that were scheduled and those that were manually un/published?
Is there a sure-fire method to republish the entire site from the backend code that replicates the onclick event of the manual 'Republish Entire Site' function?
More on point 2, is there a way to flush the in memory cache programmatically without touching the web.config?
U7: Publish At / Unpublish At [BUG]
Hi all,
I'm experiencing some issues with the auto Publish At / Unpublish At functionality in Umbraco version 7.2.6
The Publish At function fails to make the page available after the datetime has passed. The backoffice registers the page as published, but with the "Oops: this document is published but is not in the cache (internal error)" message. This is fixed when someone manually fires the 'Republish Entire Site' function which then makes the page accessible.
The Unpublish At function also registers the page as unpublished in the backoffice after the set datetime but the page is still accessible on the website until someone manually fires the 'Republish Entire Site' function, then the page is unpublished properly and inaccessible.
I've tried a number of workarounds to no avail, including adding ContentServicePublished / ContentServiceUnPublished events that try to 'Republish Entire Site' on auto pub/unpublish. I've listed the code below:
I realise 'umbraco.cms.businesslogic.web.Document.RePublishAll();' is obsolete but I had to try it seeing 'umbraco.library.RefreshContent();' wasn't working for me (in Azure).
I also noticed is that the .ReleaseDate property is always null, making it very difficult to determine whether an item was published manually or automatically published via the Publish At function. Is there another way to determine the auto published nature of the item in this context?
Steps to recreate all of the above issues:
I hope to find a solution to these issues as scheduled content are integral. I'd even accept a hack job / workaround at this point seeing I've already invested much into this project build.
Looking forward to hearing from anyone.
I'm also thinking about disabling the XML cache altogether but I fear that it may slow the site down too much - but I have CDN options so I might be able to get away with it if it solves the issues.
@Chris
Great post with details. The most obvious cause would be if you were using multiple instances in WebSites, which is not currently supported without very specific configuration.
If you could confirm you are running on a single instance and, if not, make sure that's how your WebSites scale is configured.
The good news is that with 7.3.0+ you will be able to run with multiple instances without much additional work. Have a look at Shannon's excellent Codegarden session to get an idea of what's coming:
http://stream.umbraco.org/video/11665943/umbraco-load-balancing
Thanks for the informative reply Paul.
We are running Umbraco on an Azure Web App with auto scale off so it is running as a single instance currently.
Azure web apps have an internal traffic manager by design which allows for immutable deployment slots and switching in new deployments through production. So currently our user would browse to the azurewebsites URL, which hits an internal traffic manager and goes to our production slot which is a single instance site at this moment.
I'll have time to watch that video a little later today, but version 7.3.0 sounds more tailored for Azure websites from the sound of it. I see the target release date is 12 June 2015, hopefully it will be released soon.
I just turned off Umbraco's XML cache and redeployed to the Azure website and the scheduled publish/unpublish functionality still didn't work without a human to manually click "Republish Entire Site".
Is there any sort of workaround to bypass this bug? I noticed this bug also occurs when testing locally so maybe it's not just limited to Azure Websites (will edit the initial thread post).
One thing that I found very curious is that even with XML cache turned off, the Umbraco backoffice still gives me the "Oops: this document is published but is not in the cache (internal error)" message after the unpublished page should have been auto published after the date.
Which cache is it actually talking about?
Probably the memory version of the very same cache you would otherwise also store on disk. if i recall correctly, the disk version of the cache is only there to speed up recycle times (reading it, and then keeping it in memory)
Thanks for the reply Rik.
I guess my questions may have to be:
is working on a reply...