https://discord.umbraco.com logo
#help-with-umbraco
NuCache\NuCache.Content.db' because it is being used by another process. - in Umbraco 12
# help-with-umbraco
u

.jonroberts

02/02/2024, 3:46 PM
Hi - how can we fix this type of error from happening again in Umbraco 12? System.IO.IOException: The process cannot access the file 'C:\home\site\wwwroot\umbraco\Data\TEMP\NuCache\NuCache.Content.db' because it is being used by another process. Thanks
r

ruizhii

02/04/2024, 2:56 AM
u

.jonroberts

02/05/2024, 3:10 PM
Can something like this be put into 8 as weel?
k

kdxperbol

02/06/2024, 8:09 AM
Same questions as in the other thread. Is it Azure? Is it multi-instance (i.e., "load-balanced")? Is it multi-site?
u

.jonroberts

02/06/2024, 9:10 AM
It is on Azure and on a load balance set up
e

ewuskija

02/13/2024, 10:22 AM
This cannot be true...! We just had the same issue in Umbraco 10.8.3, on dedicated hosting & with no load balancing. The issue had been going on for a few hours at night until we saw a big 500 error across the entire site in the morning... Is the only fix to make NuCache work on memory? It is a contradiction of the purpose of NuCache, isn't it? What else can access NuCache files that it gets busy?
j

Jason

02/13/2024, 12:51 PM
This one error probably needs its own section in docs, there are a lot of potential causes. The key thing to fixing it is to understand how Umbraco uses the NuCache file. When Umbraco boots it opens the NuCache file, and locks it open, until it's shut down. On Azure, a new instance might get spun up before the other shuts down (see WEBSITE_DISABLE_OVERLAPPED_RECYCLING, https://learn.microsoft.com/en-us/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#logging) - this can happen whether you're scaling or not, and should be disabled for Umbraco sites in Azure. Also on Azure, the default filesystem is actually a remote file share which can be flaky - sometimes files are not released when they're finished with. This is much (much much) more likely when Umbraco fails to shut down properly (which is usually due to scheduled/background tasks that developers have failed to add graceful shutdown logic to). For that reason the docs recommend that you use these settings: https://docs.umbraco.com/umbraco-cms/fundamentals/setup/server-setup/azure-web-apps#recommended-configuration this stores the cache and Lucene on the fast local SSD which doesn't have the same problems.
e

ewuskija

02/13/2024, 2:47 PM
Thanks but we do not use Azure, we use dedicated hosting like I said... What then?
j

Jason

02/13/2024, 4:45 PM
Indeed, but OP does. Does your issue correspond to a Umbraco reboot? If you're on IIS is the app pool being recycled (and is overlapped recycling enabled)? Was there a server/service restart that allowed something else to lock the file at a bad moment? The problem is, when it comes to this file locking problem it's likely not Umbraco's fault and we have to start guessing about what other code might be in your app or what's going on with your app's infrastructure that could cause that file to get locked up.
e

ewuskija

02/25/2024, 1:20 PM
It doesn't happen on reboot. It happens randomlywhen the app is running. Do you mean WEBSITE_DISABLE_OVERLAPPED_RECYCLING? NO, it is not enabled.
22 Views