question

SebastienPerin-5295 avatar image
0 Votes"
SebastienPerin-5295 asked SebastienPerin-5295 commented

Azure App Service Nodejs sqlite3 lock issue - CIFS mount noblr

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-webappsazure-webapps-content-deployment
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ryanchill avatar image
0 Votes"
ryanchill answered SebastienPerin-5295 commented

Hi @SebastienPerin-5295 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://docs.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



image.png (120.6 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks a lot for your help @ryanchill

I cannot try that yet, but I'll post back here if I do and it works.

1 Vote 1 ·