mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-09 17:23:04 +03:00
Bitwarden not starting because of database error #1571
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cysieks on GitHub.
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
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
@cysieks commented on GitHub:
Already checked that and no luck.
Tomorrow I'm going to test mysql version, but I was hoping to keep it much simpler.
@BlackDex commented on GitHub:
You should add nobrl with cifs.
Also, Azure Blobs is a bit different and thus worked.
@BlackDex commented on GitHub:
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=falseec920b5756/.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.
@BlackDex commented on GitHub:
Since you can not change the mountpoint options at azure this will not work very well, this is unfortunately not something we can fix.
@cysieks commented on GitHub:
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
@BlackDex commented on GitHub:
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/