mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-25 17:25:57 +03:00
[GH-ISSUE #1518] No support for litestream (sqlite streaming replication) #990
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#990
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 @James-Quigley on GitHub (Mar 20, 2021).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1518
Subject of the issue
Attempting to use litestream corrupts the sqlite database. It would be very useful to have this support to make for really easy database backups. Litestream has a tips/tricks page for getting your application to support litestream
Deployment environment
Install method: Docker image
Clients used:
Reverse proxy and version:
MySQL/MariaDB or PostgreSQL version:
Other relevant details:
Steps to reproduce
Run bitwarden_rs, run litestream replicate
Expected behaviour
No database corruption
Actual behaviour
Database corruption
Troubleshooting data
@BlackDex commented on GitHub (Mar 20, 2021):
This is more a feature request then an issue.
To have this supported we probably need to add a new configuration parameter or something special to the database url.
So, something like after the database file
DATABASE_URL=/data/db.sqlite3;busy_timeout=5000,synchronous=NORMALcould be an option.That way people can also change more PRAGMA settings if they really want.
@jjlin commented on GitHub (Mar 20, 2021):
I would go further -- this is all feature request, zero issue.
I'm not sure what exactly is meant by "database corruption", but https://litestream.io/tips/ only seems to say that WAL mode is required, which bitwarden_rs already uses by default. The other settings seem to be for better performance (the
PRAGMA synchronoussetting) or better robustness in the main application (thePRAGMA busy_timeoutsetting). So this could well be a bug in Litestream instead. (I personally wouldn't entrust my backup regimen primarily to a program that's only been released for 3 months, but if you want to, it's your funeral.)If bitwarden_rs were to provide more user control over database init, it would probably be better to provide a new config item like
DATABASE_INIT_FILEthat points to a file containing SQL statements to run on startup, then usediesel::sql_queryto run each non-blank/comment line. This would provide people with yet another way to shoot themselves in the foot, though.