Umbraco cloud: Page returns 404 during deploy to live

I’ve implemented Production runtime mode for a client that has a Umbraco 13-site up on Cloud and during the time when the site is deployed from Development to Live all pages returns 404. Backoffice still works. Once the deployment is complete the site is up and running again like normal.

I have the same setting on Umbraco 17-sites but I don’t encounter this problem on those sites, only on this 13-site.

Has anyone else experienced these types of problems?

I’ve followed this guide: Runtime Modes | CMS 13.latest (LTS) | Umbraco Documentation

Hi @AlexanderWagner82

Typically, if there’s an issue with the runtime mode, then Umbraco won’t boot and you will get an error in the log file. Given that you are getting a 404 and the backoffice loads, than it may be another issue. Have you configured the hostnames/domains correctly in the CMS and are there any warnings or errors in the logs?

Justin

Hi Justin

hostnames/domains are set correctly and I don’t have any special errors or warnings in the log during this time (I’ve only checked the logs in the Settings-tab though).

Hi @AlexanderWagner82

The settings log should be enough. Do you have a cloud test site that exhibits the same behaviour and does this only happen in live? Also, may be worth rebuilding the published cache (both database and in memory).

If you look in the info tab for any content (i.e. the home page) do you see a link or does it say something where the link should be?

Justin

Hi @justin-nevitech

Just tried a deploy to the test site and it didn’t exhibit the same behaviour. Rebuilding the published cache was the first thing I tried when I saw that the page threw 404 (both memory and db) but that didn’t do anything.

The links look just fine, and it they looked fine during this period since I had to go via backoffice to try some of the sub-pages (just to check if it only was the start page that was affected). Backoffice preview also threw 404.

Since this behaviour didn’t occur before adding the Production runtime mode I wonder if it’s something that happens during startup with this mode enabled.

Hi @AlexanderWagner82

Does your test site also run in production mode, the same as your live site? Can you try turning of runtime mode temporarily to see if it loads? Can you also try running your live site in debug mode to see if anything else gets captured in the logs?

Justin

Hi @justin-nevitech

The test-site runs in development mode, we don’t have any special rules for that environment. I’ll have to talk with my client regarding turning of runtime mode on live since they have to be onboard if the site behaves weird for a minute or two. As you can imagine they got a bit scared when they first saw the 404 error.

Hi @AlexanderWagner82

I would turn the test site runtime mode to production to see if that exhibits the same issue and debug from there. At least that would confirm the issue. In my opinion, test should mirror live as closely as possible.

Really odd if you’re not getting anything in the log, as it should tell you why it is not working and from my experience normally fails to boot completely.

It may also be worth turning on the logs in the web.config (stdoutLogEnabled=“true”) to see if there’s anything that gets logged from there.

Let me know how you get on.

Justin

Ho @justin-nevitech

This is odd. I added the same settings to development as in production (except hosting:debug was true) and didn’t experience the same problem at all. Even tried with another deployment (just adding a space in web.config).

I’ve tried setting Hosting:Debug to false as well (third deployment) and all looked good. One thing I noticed though was that this popup came up on the test-site but I didn’t notice that one the live-site.

Very odd, so is it all working now? The docs say Hosting:Debug needs to be false along with the following when running in production:

{
  "Umbraco": {
    "CMS": {
      "Runtime": {
        "Mode": "Production"
      },
      "Hosting": {
        "Debug": false
      },
      "Global": {
        "UseHttps": true
      },
      "ModelsBuilder": {
        "ModelsMode": "Nothing"
      },
      "WebRouting": {
        "UmbracoApplicationUrl": "https://<REPLACE_WITH_YOUR_PRIMARY_DOMAIN>/"
      }
    }
  }
}

Justin

That’s correct. Those settings returns 404 while site restarts during/after deploy on live environment but not on development.

So those settings don’t work on live? Have you checked you’ve done all the steps for production runtime mode as per the docs?

Are you also done this part:

To compile your views at build/publish time, remove the <RazorCompileOnBuild> and <RazorCompileOnPublish> properties from your project file (see the Development mode section). If you don't, Umbraco can't find the templates and will return 404 (Page Not Found) errors.

Justin

Well, it works as in live environment is in production mode, but it returns 404 during deployments while same settings in development doesn’t return 404.

Yes, those are removed as well in the csproj