Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mathias 51 posts 205 karma points
    Oct 31, 2019 @ 07:35
    Mathias
    0

    Umbraco crashes from time to time - NuCache.Content.Db is being used by another process

    Hello

    I am encountering this weird issue which I cannot explain.

    So I got this Umbraco website that we've built for a client, which is hosted in Azure. The site works wonders, but from time to time (it's been quite while since this last happend), the site crashes and we have the restart the entire Azure AppService.

    Checking in the Umbraco 8 Logviewer I find this error, the same error that we've encountered before if my memory serves me:

    https://ibb.co/ZM4wbkx

    System.IO.IOException: The process cannot access the file 'D:\home\site\wwwroot\App_Data\TEMP\NuCache\NuCache.Content.db' because it is being used by another process.
    

    Something seems to be holding the NuCache.Content.db file hostage, restarting the App service seems to solve it. But this is not a sustainable solution to the problem.


    Has anyone else come across this issue?

    Any suggestions on how we can solve it?


    Many thanks,

    Mathias

  • Steve Megson 151 posts 1024 karma points MVP c-trib
    Oct 31, 2019 @ 15:40
    Steve Megson
    101

    There are a few issues in github discussing this:

    https://github.com/umbraco/Umbraco-CMS/issues/5035

    https://github.com/umbraco/Umbraco-CMS/issues/6363

    https://github.com/umbraco/Umbraco-CMS/issues/6546

    There are a few possible solutions suggested, I think the recommended solution is this one.

  • Mathias 51 posts 205 karma points
    Nov 01, 2019 @ 07:47
    Mathias
    0

    Thanks Steve!

    I followed the instructions from the recommended solution. Hopefully this will sort out our problem.

  • MP 7 posts 76 karma points
    May 24, 2024 @ 08:12
    MP
    0

    I tried both the solutions below, but neither of it worked for me unfortunately. I'm still facing the same issue.

    https://github.com/umbraco/Umbraco-CMS/issues/6546#issuecomment-545224926

    https://github.com/umbraco/Umbraco-CMS/issues/6546#issuecomment-593182604

    I have the application running on Azure in two slots and i have made the changes to both the slots. Any help is greatly appreciated.

  • Kieron McIntyre 6 posts 28 karma points
    Oct 21, 2024 @ 19:26
    Kieron McIntyre
    0

    Hi all,

    We have recently had a series of downtime because of this issue. The issue for us seemed to be because we had two instances of the Umbraco application on the same App Service Plan, one for the front end of the website and one for the backoffice. The configuration of each was as per the documentation.

    It appears that although each were separate applications, they shared access to the same NuCache.Content.db file. This wouldn't necessarily be a problem provided that no attempt was made to move the NuCache.Content.db file.

    However, my understanding is that Azure occasionally likes to migrate an App Service Plan from one VM to another for various reasons (e.g. VM health). You will see this in the logs when the machine name changes, e.g. WN1FRDWK1000S9.

    When Azure attempts the migration, it will move one application at a time. During the restart of the first application Umbraco will realise that NuCache.Content.db file is still being used by the other instance and refuse to start up, throwing this error.

    In our case, once the second application was migrated, the NuCache.Content.db file was released and allowed the first application to complete its start up. But this meant it was down for 10 minutes.

    Solution

    The solution for us was to ensure that (at least) one instance was always running using the NuCache.Content.db in-memory, i.e. IgnoreLocalDb = true. We opted for the CMS instance as it had lesser impact on the start up.

    With the Azure slot swap process, it makes sense that the same issue is happening but between the two instances that are being swapped since by default the apps on both slots are running when swapped. This is why the solution of specifying WEBSITE_DISABLE_OVERLAPPED_RECYCLING = 1 in the app service settings of both slots will work in the slot swapping scenario because it ensures that both applications are stopped when the swap occurs.

    An alternative would be to configure that both slots are configured to use NuCache.Content.db in-memory.

Please Sign in or register to post replies

Write your reply to:

Draft