NuCache\NuCache.Content.db' because it is being us...
# help-with-umbraco
j
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
j
Can something like this be put into 8 as weel?
k
Same questions as in the other thread. Is it Azure? Is it multi-instance (i.e., "load-balanced")? Is it multi-site?
j
It is on Azure and on a load balance set up
e
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
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
Thanks but we do not use Azure, we use dedicated hosting like I said... What then?
j
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
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.
133 Views