Back-up stopped working after update to 1.21.0

Hello

So I updated my docker image bitwarden_rs/server:latest (1.21.0 release) and I noticed my daily back-up cronjob started giving me an output error:

Task: Backup bitwarden_rs
Start time: Sat, 01 May 2021 11:12:09 GMT
Stop time: Sat, 01 May 2021 11:12:10 GMT
Current status: 126 (Interrupted)
Standard output/error:
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused “exec: "sqlite3": executable file not found in $PATH”: unknown

In the meantime I found out that the image had been deprecated and replaced my old image by vaultwarden/server. However still no luck in having working back-ups.

After some troubleshooting I found out the sqlite3 executable is missing in /usr/bin inside the docker image/container hence why my cronjob failed.

this is the script, found on the vaultwarden documentation page.

docker exec dockername sqlite3 data/db.sqlite3 “.backup ‘/path/to/backups/db-$(date ‘+%Y%m%d-%H%M’).sqlite3’”

So essentially this will run inside the docker container to dump the db.sqlite3 database to a seperate location.

Since the sqlite3 executable is missing (since 1.21.0?) my cronjob started failing.

For now I fixed the problem by installing sqlite3 inside the docker image:

docker exec -it dockername /bin/bash
apt update && apt install -y apt-transport-https ca-certificates sqlite3

I know when there’s a new update/reboot this won’t be persistent.

Thank you very much and I hope this explanation helps out some of my fellow Dockers.

EDIT: My permanent solution/workaround is posted in the comments

We have removed the sqlite3 binary from both alpine and debian, because it isn’t necessary. Also, tools like that are probably better to use from the host perspective.

Figured out a way to adapt the script so it runs from a host (my NAS) perspective.

sqlite3 volume1/docker/bitwarden/db.sqlite3 “.backup ‘/volume1/docker/bitwarden/backup/db-$(date ‘+%Y%m%d-%H%M’).sqlite3’”

It runs successfully in a SSH session but scheduling it in the Synology GUI returns following error output:

Task Scheduler has completed a scheduled task.

Task: Backup Vaultwarden
Start time: Sat, 01 May 2021 14:09:23 GMT
Stop time: Sat, 01 May 2021 14:09:23 GMT
Current status: 1 (Interrupted)
Standard output/error:
Error: unable to open database “volume1/docker/bitwarden/db.sqlite3”: unable to open database file

It does create the file in the back-up directory but it has 0 bytes…
FYI, I’m aware my back-up is in the same directory as the live version, I have a CloudSync set up.

Any ideas/suggestions?

EDIT:

Think I figured it out, syntax is key…
Ended up with:

sqlite3 /volume1/docker/bitwarden/db.sqlite3 “.backup /volume1/docker/bitwarden/backup/db-$(date ‘+%Y%m%d-%H%M’).sqlite3”

Notice a silly / is missing in the first command I used.