[GH-ISSUE #1201] Bitwarden not starting because of database error #849

Closed
opened 2026-03-03 02:03:54 +03:00 by kerem · 6 comments
Owner

Originally created by @cysieks on GitHub (Oct 26, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1201

Subject of the issue

I installed a fresh bitwarden docker image in Azure App Service. Attached Azure File Share as /data.
The problem is that it's not starting at all.

Your environment

  • Bitwarden_rs version:
    Docker image bitwardenrs/server:latest

Steps to reproduce

Started as Web App Service

Expected behaviour

The application should start normally.

Actual behaviour

Errors in log
[panic][ERROR] thread 'main' panicked at 'Failed to turn on WAL: DatabaseError(__Unknown, "database is locked")': src/db/mod.rs:275

When I changed ENABLE_DB_WAL=false, then first WARN is x14 times
[2020-10-26 19:27:40.192][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
DatabaseError(
__Unknown,
"database is locked",
),
)
[2020-10-26 19:27:41.294][bitwarden_rs][ERROR] Error creating database pool: DieselMigError.
[CAUSE] QueryError(
DatabaseError(
__Unknown,
"database is locked",
),
)

When I checked Azure File Share, there are RSA keys, icon_cache folder, and 0 bytes db.sqlite3 file.
Added next settings:
LOG_FILE=/data/bitwarden.log
LOG_LEVEL=trace
EXTENDED_LOGGING=true

but the only difference is that I have 14x WARN + 1x ERROR in this file.
Do you have an idea of how to make this work?

Relevant logs

Originally created by @cysieks on GitHub (Oct 26, 2020). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1201 ### Subject of the issue I installed a fresh bitwarden docker image in Azure App Service. Attached Azure File Share as /data. The problem is that it's not starting at all. ### Your environment * Bitwarden_rs version: Docker image bitwardenrs/server:latest ### Steps to reproduce Started as Web App Service ### Expected behaviour The application should start normally. ### Actual behaviour Errors in log [panic][ERROR] thread 'main' panicked at 'Failed to turn on WAL: DatabaseError(__Unknown, "database is locked")': src/db/mod.rs:275 When I changed ENABLE_DB_WAL=false, then first WARN is x14 times [2020-10-26 19:27:40.192][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "database is locked", ), ) [2020-10-26 19:27:41.294][bitwarden_rs][ERROR] Error creating database pool: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "database is locked", ), ) When I checked Azure File Share, there are RSA keys, icon_cache folder, and 0 bytes db.sqlite3 file. Added next settings: LOG_FILE=/data/bitwarden.log LOG_LEVEL=trace EXTENDED_LOGGING=true but the only difference is that I have 14x WARN + 1x ERROR in this file. Do you have an idea of how to make this work? ### Relevant logs <!-- Share some logfiles, screenshots or output of relevant programs with us. -->
kerem closed this issue 2026-03-03 02:03:54 +03:00
Author
Owner

@BlackDex commented on GitHub (Oct 26, 2020):

Hello @cysieks,

Azure is using a Samba (Smab/CIFS) shared volume which can't handle locking that well.

On Azure you are better of using either a MySQL or Postgresql based database.

You could try to disable WAL for Sqlite which maybe solves your problem. For this you need to set ENABLE_DB_WAL=false github.com/dani-garcia/bitwarden_rs@ec920b5756/.env.template (L87)

Be sure to delete the already created db.sqlite before you start again with the WAL set to false, since this is something which will be set during creation of the file.

<!-- gh-comment-id:716804769 --> @BlackDex commented on GitHub (Oct 26, 2020): Hello @cysieks, Azure is using a Samba (Smab/CIFS) shared volume which can't handle locking that well. On Azure you are better of using either a MySQL or Postgresql based database. You could try to disable WAL for Sqlite which maybe solves your problem. For this you need to set `ENABLE_DB_WAL=false` https://github.com/dani-garcia/bitwarden_rs/blob/ec920b5756fdae0b64edde328f634fbe2cd92ac0/.env.template#L87 Be sure to delete the already created db.sqlite before you start again with the WAL set to false, since this is something which will be set during creation of the file.
Author
Owner

@cysieks commented on GitHub (Oct 26, 2020):

Already checked that and no luck.

Tomorrow I'm going to test mysql version, but I was hoping to keep it much simpler.

<!-- gh-comment-id:716830018 --> @cysieks commented on GitHub (Oct 26, 2020): Already checked that and no luck. Tomorrow I'm going to test mysql version, but I was hoping to keep it much simpler.
Author
Owner

@BlackDex commented on GitHub (Oct 26, 2020):

Since you can not change the mountpoint options at azure this will not work very well, this is unfortunately not something we can fix.

<!-- gh-comment-id:716830956 --> @BlackDex commented on GitHub (Oct 26, 2020): Since you can not change the mountpoint options at azure this will not work very well, this is unfortunately not something we can fix.
Author
Owner

@cysieks commented on GitHub (Oct 26, 2020):

What mount point options should be changed?

Strange thing is, that it worked about a year ago when Azure Blob was an option for mounting point.
Right now all files are created/amended properly (like log file), except the database file. So it looks like it's sqllite handling issue.

Thanks

<!-- gh-comment-id:716834707 --> @cysieks commented on GitHub (Oct 26, 2020): What mount point options should be changed? Strange thing is, that it worked about a year ago when Azure Blob was an option for mounting point. Right now all files are created/amended properly (like log file), except the database file. So it looks like it's sqllite handling issue. Thanks
Author
Owner

@BlackDex commented on GitHub (Oct 26, 2020):

You should add nobrl with cifs.
Also, Azure Blobs is a bit different and thus worked.

<!-- gh-comment-id:716835950 --> @BlackDex commented on GitHub (Oct 26, 2020): You should add nobrl with cifs. Also, Azure Blobs is a bit different and thus worked.
Author
Owner

@BlackDex commented on GitHub (Nov 18, 2020):

Closing this issue because it's not something we can fix on our side.
Also, if you want to discuss this further i suggest to use the forum: https://bitwardenrs.discourse.group/

<!-- gh-comment-id:729624888 --> @BlackDex commented on GitHub (Nov 18, 2020): Closing this issue because it's not something we can fix on our side. Also, if you want to discuss this further i suggest to use the forum: https://bitwardenrs.discourse.group/
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#849
No description provided.