Azure App Service Nodejs sqlite3 lock issue - CIFS mount noblr

Sébastien Perin 36 Reputation points
2021-03-17T14:59:58.883+00:00

I've been experiencing difficulties to use sqlite3 node module in an Azure Web app Nodejs (Linux Code Hosting)

First node-gyp failed to build the sqlite3 module with NodeJS 14 LTS but succeeds with NodeJS 12 LTS, see this other thread.
Then it failed to run the first and simple "CREATE TABLE" statement of myExpressApp, see the attached app-service.log for the error SQLITE_BUSY: database is locked.

It took me sometimes to finally found the explanation on stackoverflow:

The problem is that /home is mounted as CIFS filesystem which can not deal with SQLite3 lock.

So this workaround suggests to use sqlite PRAGMA journal_mode=wal; whcih does fix my SQLITE_BUSY: database is locked error.
However I would have prefer to add the noblr option to the CIFS filesystem mount as suggested in the previous workaround.

But I'm using the Azure App Service NodeJS Quick Start and I couldn't find how I could set such an option. Could you please [78775-app-service.log][8]point me into the right direction?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2021-03-18T14:48:15.777+00:00

    Hi @Sébastien Perin per our email discussion, I'm posting my response here to help the broader community. File system mounts isn't something that can be changed by you as it's done in the backend when the app service is first created.

    One option that could work is mounting your /databse folder to an Azure File storage mount under Path Mappings on the Configuration blade, see https://learn.microsoft.com/en-us/azure/app-service/configure-connect-to-azure-storage?pivots=container-linux.

    79245-image.png

    The mount path should match the folder directory of your database path e.g. /home/site/wwwroot/database and storage container should be the name of your File share container.

    Regards,
    Ryan


  2. Ankit Gupta 1 Reputation point
    2022-10-17T11:51:44.977+00:00

    Hi @Ryan Hill ,

    I hope you're doing well. I also have same problem with Linux based Azure app service and sqlite3 database.
    I tried your solution but no luck. I'm still getting "General error: 5 database is locked".

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.