Umbraco-CMS: Can't upgrade to 12 when 'ShowMaintenancePageWhenInUpgradeState' is set to false

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

12.2.0

Bug summary

When trying to upgrade from 11.5.0 to 12.2.0, and the ShowMaintenancePageWhenInUpgradeState app setting is set to false, I get the following error:

The database failed to upgrade. ERROR: The database configuration failed with the following message: The process cannot access the file 'C:\...\umbraco\Data\TEMP\NuCache\NuCache.Content.db' because it is being used by another process. Please check log file for additional information (can be found in 'LoggingSettings.Directory')

Note: This does not occur when UpgradeUnattended is enabled.

Specifics

In the logs I can see:

[13:25:20 INF] Starting 'Umbraco.Core'...
[13:25:20 INF] At {2CA0C5BB-170B-45E5-8179-E73DA4B41A46}
[13:25:20 INF] Execute UseNvarcharInsteadOfNText
[13:25:20 INF] At {888A0D5D-51E4-4C7E-AA0A-01306523C7FB}
[13:25:20 INF] Execute ResetCache
[13:25:20 ERR] Plan failed at step {539F2F83-FBA7-4C48-81A3-75081A56BB9D}
[13:25:20 ERR] Database configuration failed
System.IO.IOException: The process cannot access the file 'C:\Projects\#Random\Umbraco-122\umbraco\Data\TEMP\NuCache\NuCache.Content.db' because it is being used by another process.

So the error is when trying to execute the ResetCache step to delete the NuCache files.

Steps to reproduce

  1. Create a new project using version 11.5.0.
  2. Adjust your appsettings.json to include the ShowMaintenancePageWhenInUpgradeState and UpgradeUnattended settings set to false.
"Umbraco": {
  "CMS": {
    "Global": {
      ...
      "ShowMaintenancePageWhenInUpgradeState": false
    },
    ...
    "Unattended": {
        "UpgradeUnattended": false
    }
  1. Run the install and once finished stop the website.
  2. Update the Umbraco nuget to 12.2.0.
  3. Run the website, click on Continue to perform the upgrade and then verify you are faced with the error.

Expected result / actual result

The website should be properly upgraded without errors.

Also, it should be checked if the ResetCache step is doing anything on Subscriber servers for load balanced environments, as I think this might be yet another issue.


This item has been added to our backlog AB#33248

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (12 by maintainers)

Most upvoted comments

I had the same error, going from v11.4.2 to v13.0.3, locally on IISExpress. Adding the two suggested settings in the appsettings file and a “clean solution & rebuild solution” did not help.

However, I fixed it by:

  1. Deleting the folders “obj”, “bin” and “umbraco/Data/Temp”
  2. Rebuild the solution
  3. Note: I still had the the two suggested appsettings “ShowMaintenancePageWhenInUpgradeState”: true and “UpgradeUnattended”: true
  4. Run from VS2022 in IISExpress

And it was working without any errors or problems 😃

I had a similar issue when upgrading from v10.8.3 -> v12.3.6

As @wvdweerd mention this fixed it for me:

  • Deleted umbraco/Data/Temp
  • Removed obj folder
  • Set "ShowMaintenancePageWhenInUpgradeState": true
  • Restarted application (IIS Express)

I had the same error, going from v11.4.2 to v13.0.3, locally on IISExpress. Adding the two suggested settings in the appsettings file and a “clean solution & rebuild solution” did not help.

However, I fixed it by:

  1. Deleting the folders “obj”, “bin” and “umbraco/Data/Temp”
  2. Rebuild the solution
  3. Note: I still had the the two suggested appsettings “ShowMaintenancePageWhenInUpgradeState”: true and “UpgradeUnattended”: true
  4. Run from VS2022 in IISExpress

And it was working without any errors or problems 😃

Cheers, this is what worked for me also. (10.3.2 -> 13.0.3)