Umbraco V17 - URLs are generated in the backoffice but not persisted to umbracoDocumentUrl

Hi,

I’m experiencing an unusual URL/routing issue in Umbraco 17.6.1 and would appreciate some help understanding what is happening internally.

Currently, I am working on a new project development in V17.6.1 so this is happening in my development environment, and deployment is handled through Azure DevOps.

The behaviour is:

  1. I publish content from the Umbraco backoffice.
  2. The URL is generated correctly and works immediately.
  3. However, the generated URL is not written to the umbracoDocumentUrl table.
  4. The URL appears to be available through the in-memory URL/cache mechanism, so routing works while the application is running.
  5. When I deploy changes through Azure DevOps, the application is restarted and the URL disappears.
  6. The content itself remains published.
  7. Publishing the content again causes the URL to work again, but the URL is still not persisted to umbracoDocumentUrl.

Investigation so far

I have been looking at the Umbraco 17.6.1 source code, particularly DocumentUrlAliasService.cs.

I noticed logic around the server role where database persistence is skipped when the current server is running as a Subscriber which call a method UpdateAliasCacheAsync(Guid documentKey) is specifically a cache-only operation and does not write to the database.

This appears to match what I am seeing. The URL is generated and available in memory, but the corresponding database persistence is skipped.

The main issue is that the content team has to republish content after every deployment because the URL works in the backoffice but isn’t persisted and therefore disappears when the application is restarted.

Any guidance from someone familiar with the DocumentUrlService implementation in Umbraco 17 would be greatly appreciated.

Thanks!

Hi @MJessicka

Are you running with a load balanced setup? The server roles are used in load balancing where you would have a publisher (the CMS backoffice server) and subscribers (the front-end servers). If you only have one server, it should be acting as both.

There are different setups for load balancing and you can now load balance the back office, have a look here:

Only the publisher will run certain things such as tasks, etc.

Justin

I’m guessing if you are running in a dev environment it won’t be load balancing, but rule that out first if you’re seeing that behaviour you mentioned re the document URLs.

Yes, no load balancing in my server.

Hi @MJessicka

Are you setting a server role anywhere from your code?

Check using this:

@inject Umbraco.Cms.Core.Sync.IServerRoleAccessor RoleAccessor
@RoleAccessor.CurrentServerRole

If not, that should rule out load balancing.

Are there any clues on your log file?

You can try setting DocumentUrlService to Debug to see if that outputs anything helpful.

"Serilog": {
  "MinimumLevel": {
    "Default": "Information",
    "Override": {
      "Microsoft": "Warning",
      "System": "Warning",
      "Umbraco.Cms.Core.Services.DocumentUrlService": "Debug"
    }
  }
}

Justin