mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-26 01:35:54 +03:00
[GH-ISSUE #1656] Command not found: sqlite3 #1028
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#1028
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 @alexpovel on GitHub (May 2, 2021).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1656
Subject of the issue
The docs for backing up Vaultwarden still mention SQLite and its corresponding
sqlite3binary. Back when I first started using Bitwarden_RS, I had written a backup script around that (requiresrsync):Click to expand
It has been working just fine but recently broke. I feel like I missed something because there isn't an open issue on this yet, but the docs linked above seem reasonably up to date (mention
sendsdirectory), so I'm hoping thesqlite3part is still relevant.I have looked in different locations for help but wasn't succesful:
sqlite31.16to1.21with lots of DB migration stuff, but I updated from1.20to1.21and see none of that in my logsvaultwarden one has no sqlite executable", which I can confirm but doesn't helpDeployment environment
vaultwarden version:
Install method: Docker
MySQL/MariaDB or PostgreSQL version: SQLite!
Steps to reproduce
There's no
sqlite3program anymore in the current Docker image (see above for the exact version):Expected behaviour
sqlite3to be present so backups succeed as described in the docs.Its present in
1.20, so one minor version prior (vaultwarden/serverisn't available for this one):That tells me the place to look for such a breaking change is the 1.21 changelog, but there's nothing there concerning databases.
Actual behaviour
sqlite3is not present (apt-get install sqlite3in a child image fixes this for now).@fdisamuel commented on GitHub (May 2, 2021):
Hi @alexpovel!
I think this commit is related to your problem:
github.com/dani-garcia/vaultwarden@95fc88ae5bAs you can see, local sqlite3 packages has been removed from the image, as they are not needed anymore for the admin panel database backup function.
My workaround for this, that I run my backup script from the host system which has the necessary sqlite3 packages, not inside the container (I use bind mount from the
/datadirectory to my host local/home/user/bwdatafolder so I can reach and backup thedb.sqlite3from the host.)@dani-garcia commented on GitHub (May 2, 2021):
Yeah, the docs are mostly meant for the user running the sqlite command from the host side, where the data directory is mounted.
If you still want to run it from inside the container, mounting a shell script into
/etc/vaultwarden.shor/etc/vaultwarden.d/*.shinside the container would run that script during startup, so you can make sure anything else you need inside the container is installed any time.@alexpovel commented on GitHub (May 2, 2021):
@fdisamuel excellent, thanks for pointing out the exact commit. I have built multipe services around the idea of backing up from within containers:
/mnt/backup(using Docker's built-in NFS driver, so the backups go directly to the correct destination)/etc/backup.sh; these are tailor-made for each application, like the one in the OP for vaultwardenbackup.enabledsystemdtimer and simply gets all containers with the above label, and runsdocker exec <id> /etc/backup.sh, where those shell scripts write to/mnt/backupAnyway... that's why running everything from within the containers is my chosen course of action. After all, these containers already ship with everything required, might as well use them. (Sometimes we need to be in the container anyway, like to enable maintenance mode for Nextcloud) It only sucks for scheduling, so that's done on the host.
Ah okay, I read that wrong then.
Okay thanks! But I take it it's safe to
apt-get install sqlite3in a child image and continue that route? Would be much more Docker-friendly.@andrewlow commented on GitHub (May 29, 2021):
Maybe the wiki doc should be updated to make it more clear that sqlite3 is NOT in the image, but should be on the host?
https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault#restoring-backup-data
I personally just added the "missing" sqlite3 command to the container image which let my old script work fine (which did the backup from within the image).
@jjlin commented on GitHub (May 29, 2021):
Docker images are expected to be minimalistic, but for users who aren't familiar with the Docker philosophy, I've updated https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault#sqlite-database-files.
@andrewlow commented on GitHub (May 29, 2021):
💯 agree on minimalistic docker images.
However, the small addition of the sqlite3 command enables that same minimal image to do backups.
Now that said, I trigger the job from outside the container (using cron) - because adding cron to the image would be very much against the docker philosophy.
The doc update looks good and helps people understand the recommended way to do this - I value the time and effort the folks maintaining this project put into, so thank you.