Umbraco-CMS icon indicating copy to clipboard operation
Umbraco-CMS copied to clipboard

Process cannot access NuCache.Content.db during umbraco 13 upgrade

Open jaandrews opened this issue 1 year ago • 4 comments

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

13.0.3

Bug summary

When I run the installer to upgrade the database from 11.4.2 to 13.0.3, I get an error saying NuCache.Content.db is being used by another process. I was able to resolve the issue locally by deleting the folder, but I don't have access to this directory in the production environment (azure in my case) and so can't apply that fix.

Specifics

A stack trace of the error can be seen below.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> Umbraco.Cms.Core.Install.InstallException: The database failed to upgrade. ERROR: The database configuration failed with the following message: The process cannot access the file 'C:\local\Temp\UmbracoData\1185734e5ea281c018f765971bc6eeb9a20d523b\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')
   at Umbraco.Cms.Infrastructure.Install.InstallSteps.DatabaseUpgradeStep.ExecuteAsync(Object model)
   at InvokeStub_InstallSetupStep`1.ExecuteAsync(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Umbraco.Cms.Web.BackOffice.Install.InstallApiController.ExecuteStepAsync(InstallSetupStep step, Object instruction)
   at Umbraco.Cms.Web.BackOffice.Install.InstallApiController.PostPerformInstall(InstallInstructions installModel)

Steps to reproduce

  1. Create an umbraco 11.4.2 project.
  2. Upgrade it to umbraco 13.0.3, by manually updating the Umbraco.Cms packagte reference in the csproj file (I wasn't able to use the nuget package manager in my case, as there were other libraries that shared dependencies with Umbraco.Cms, so it would always block the upgrade).
  3. Log into umbraco and run through the upgrade process.

Expected result / actual result

I expect the install to run successfully.

jaandrews avatar Jan 24 '24 17:01 jaandrews

Hi there @jaandrews!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

github-actions[bot] avatar Jan 24 '24 17:01 github-actions[bot]

Just wanted to drop a note that I had a similar issue to this and reported it here: https://github.com/umbraco/Umbraco-CMS/issues/14863 HQ mentioned they fixed the initial issue, but it seems that even with ShowMaintenancePageWhenInUpgradeState set to true it still happens. I recently released an upgrade to Azure and restarting the web app(s) manually, after deploying the code, fixed it for me. (the nucache files are deleted when there is a web app restart, but not a deployment)

lauraneto avatar Jan 24 '24 17:01 lauraneto

@lauraneto Thanks for the tip. That fixed it for me.

I'll hold off on closing this issue, since the root cause hasn't been resolved, but the restart is a simple workaround for the issue in the meantime.

jaandrews avatar Jan 24 '24 18:01 jaandrews

Update: Bjarnes approach worked for me: https://github.com/umbraco/Umbraco-CMS/issues/14863#issuecomment-1893526478


I have the same issue on my local machine going from 10.6.1 -> 12.3.7

image

rpjengaard avatar Feb 16 '24 09:02 rpjengaard

We are experiencing the same error with Umbraco Version 13.4.1 hosted in Azure. We have tried:

  • Restarting the Umbraco app service

  • Tried deleting the NuCache folder

  • Deleted the entire Umbraco directory and redeploying over and nothing seems to fix this error.

  • We attempted to use our stage database in our production environment to rule out database issues with our production environment.

This is taking down our production environment and we need this fixed as soon as possible. We have not made any changes to our instance either. image

AquaLes avatar Aug 06 '24 16:08 AquaLes