umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.42k stars 2.66k forks source link

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

Open jaandrews opened 7 months ago

jaandrews commented 7 months ago

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.

github-actions[bot] commented 7 months ago

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 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:

lauraneto commented 7 months ago

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)

jaandrews commented 7 months ago

@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.

rpjengaard commented 7 months ago

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

AquaLes commented 1 month ago

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

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