Umbraco 17 No Published Content

Hello,

I have been fighting with Umbraco today and I cannot work out what is going wrong. I have upgraded an Umbraco 13 site to Umbraco 17. I used uSync migration and had great success with all the content not breaking anything and code upgrades have gone well.

But every time I re-start the website locally I get the following screen:

I can then republish the home node and the home works again.

I then created a fresh website, fresh umbraco 17 install, I used usync to copy the document types across and then only created the home node… and again this issue reared its head.

Has anyone else come across this? I have upgraded multiple other websites to U17 all 100% successfully… this one is going a bit pete-tong!

Help!

Hi @bythewiseman

Have you tried rebuilding the database cache in the backoffice Settings? Are the pages in the CMS unpublished, or published just not in the cache? Any errors in the Umbraco log?

Justin

Yup. I rebuilt the database cache and memory cache multiple times.

The pages are published.

They are showing as having a link.

but I am still getting the screen (although currently it is showing as the usync one as I have reinstalled that for a new test)

but when I publish the Home node, the page appears ago. And a restart breaks the routing again.

I’ve see this.. damn my bad memory but it was something like:

  • Models builder - check your config
  • Smidge included in the _viewimports
  • Razor views compilation setting in the csproj file.
    Check and remove these:
  • ```
    <RazorCompileOnBuild>false</RazorCompileOnBuild>
    <RazorCompileOnPublish>false</RazorCompileOnPublish>
  • 
    

I think it was the last one for me…

Thanks Steve, but sadly it’s not that the home is never appearing. The homepage loads correctly when I publish, but then after a restart of the project Umbraco believes the home page is unpublished. But in backoffice it shows the Url. Publish the Home node and the home node starts working…weird.

This seems like yet another thread related to ~“umbraco-17-pages-randomly-becoming-unpublished”.

Justin did note (in the mentioned thread) there is an open issue:

Hopefully this helps tie it all together to get closer to squashing the mystery weirdness afoot here.

Oooh it does. Thank you!

Now what I am seeing from my testing is this might be down to the Languages and routes. I am currently testing this theory by starting again and being tidy with Languages.

Hi @bythewiseman

If you manage to figure anything out, please update the existing issue that @pc-pdx linked so that HQ can look into this if indeed it is related and is the same issue.

Justin

Hi @bythewiseman

I asked AI for it’s thoughts and this is what it came back with… not sure if any of that helps?

The languages theory sounds plausible to me. From v15 onwards, URLs live in the umbracoDocumentUrl table, keyed by document key and language ID, and get reloaded at startup. Republishing writes fresh rows, which would explain why a publish fixes it but a restart breaks it again: the startup path is either failing to load those rows or not matching them.

Things I’d suggest he checks:

  1. Compare the URL table before and after a restart. Query umbracoDocumentUrl for the Home node’s key after publishing, then again after restarting. If the rows survive but the route still fails, it’s a lookup or matching problem. If they’ve gone, something is rebuilding or clearing them on boot.

  2. Check umbracoLanguage for oddities. Look for:

    • more than one language marked as default
    • duplicate ISO codes
    • a default language that changed after content was published

    Invariant content is stored against the default language ID, so a mismatch there would cause exactly this. uSync migrations from 13 can leave languages in a slightly odd state.

  3. Check culture and hostnames on the Home node. A domain assigned to a culture that’s missing, non-default or duplicated could break routing after a cache reload.

  4. Look for custom URL segment providers. Any custom IUrlSegmentProvider (his own code or a package) matters, because I believe a change in providers triggers a URL rebuild at startup. It’s worth confirming nothing nondeterministic is in there.

  5. Look for a second instance sharing the database. Another local instance, or a scheduled-publishing or server-role misconfiguration, could be triggering cache rebuilds he isn’t expecting.

  6. Turn on debug logging for the URL service at startup. Setting Umbraco.Cms.Core.Services to Debug should show whether a rebuild runs and what it does.

  7. Try a minimal repro. He already reproduced it on a fresh install with synced doc types. Next, try a fresh install with only the default en-US language, one invariant Home doc type, and nothing synced. If that works, add languages back one at a time.

If he does pin it down, the before-and-after rows from the URL table along with his language setup would be the most useful thing to add to #23234.

I’ve got a solution for this

And the fix is also being released in 17.8.0 I believe.

Hi @Strike3Digital Are you able to elaborate?

umbracoDocumentUrl - this table appears to be the issue. It is not getting populated. I manually populated it with my site’s homepage and the home page now consistently works. Now how to fix that…