mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-26 01:35:54 +03:00
[GH-ISSUE #1201] Bitwarden not starting because of database error #849
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#849
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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 (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
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
@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=falsegithub.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.
@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.
@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.
@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
@BlackDex commented on GitHub (Oct 26, 2020):
You should add nobrl with cifs.
Also, Azure Blobs is a bit different and thus worked.
@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/
ADMIN_TOKENinstead of bailing out #2838