ttionya / vaultwarden-backup

Backup vaultwarden (formerly known as bitwarden_rs) SQLite3/PostgreSQL/MySQL/MariaDB database by rclone. (Docker)
MIT License
998 stars 115 forks source link

cannot access /bitwarden/data: No such directory #73

Closed Lucascoco closed 3 days ago

Lucascoco commented 2 years ago

Hallo, when i run the docker, i become this message above. what did i wrong?

ttionya commented 2 years ago

If you are using "Automatic Backups", please read the documentation.

If you are using docker-compose, which normally shouldn't have this problem, please let me know.

Lucascoco commented 2 years ago

i found the mistake, it was the env... -e CRON=0 13 * \ make i a mistake with this?

ttionya commented 2 years ago

Did you add the -e DATA_DIR="/data"?

Lucascoco commented 2 years ago

Yes i do..and i think verything is fine, only the cron entry. I have just noticed that the zp password variable does not work either.

Lucascoco commented 2 years ago

And the log is fine, he make a temp Backup to the path bitwarden/backup and say upload to file storage, but he dont do.

ttionya commented 2 years ago

A short description will not give me enough information to help you, please provide more detailed information, such as logs, system version, etc.

Lucascoco commented 2 years ago

Hello, thanks, i will try

i run docker in version 20.10.17 on a Linux 5.10.0-16-amd64 #1 SMP Debian 5.10.127-1 (2022-06-30) x86_64 GNU/Linux

my docker run call docker run -d \ --restart=always \ --name vaultwarden_backup \ --volumes-from=bitwarden \ --mount type=volume,source=vaultwarden-rclone-data,target=/config/ \ -e DATA_DIR="/data" \ -e TIMEZONE=Europe/Berlin \ -e CRON=0 13 * \ -e ZIP_PASSWORD=mypassword \ ttionya/vaultwarden-backup:latest

here is the log _vaultwarden_backup_logs.txt

and here the rclone dir root@LinuxDocker:/home/lucascoco# rclone lsd BitwardenBackup: -1 2022-07-28 16:36:42 -1 BitwardenBackup

or is that the problem, when i type the command under my normal user, i get a error, i must do it under roo.

ttionya commented 2 years ago

The log appears to be normal, it is backing up properly and there are no errors reported.

About CRON environment variable, you can try adding quotes, otherwise it may not be recognized correctly, -e CRON="* 13 * * *".

root@LinuxDocker:/home/lucascoco# rclone lsd BitwardenBackup: -1 2022-07-28 16:36:42 -1 BitwardenBackup

or is that the problem, when i type the command under my normal user, i get a error, i must do it under roo.

I don't understand this sentence, which remote storage did you use rclone to backup to? You can check on the remote storage to see if it is being backed up properly. If it is normal, you are only experiencing problems with your linux system usage.

Lucascoco commented 2 years ago

Yes i use rclone. When i type rclone lsd BitwardenBackup: i can see this -1 2022-07-28 16:36:42 -1 BitwardenBackup so i think the Storage is okay

ttionya commented 2 years ago

Is there backup files in the folder?

Lucascoco commented 2 years ago

Not in this folder only in the local docker temp folder

ttionya commented 2 years ago

Sorry I'm not good at English and use translation software to communicate with you. Sometimes I can't understand your replies accurately. But I would very much like to help you with your problem.

Let's start from the beginning.

At the beginning you did not add environment variables via -e DATA_DIR="/data", this problem has been resolved.

Then it was cron not working correctly and I suggested you to use quotes. You didn't tell me if the problem was solved by adding quotes, but I assume it was fixed.

The ZIP_PASSWORD environment variable is also, you could try wrapping it in quotes.

Then later you say the backup program is working, but not being uploaded to remote storage. I checked the logs and everything is fine. You should confirm the backup file exists in remote storage, not somewhere else like "docker temp folder". To be honest I don't understand what you mean by "docker temp folder".

Maybe you can provide which remote storage you backed up to? Like OneDrive, S3 etc.

Lucascoco commented 2 years ago

Sry my english is not good too. ;) and i always you the translater too. Now i have the zip variable in quotes, but he still take the standart passwort. he make the backup in docker/overlay2/9346d64475f3a9fe3/diff/mnt/BitwardenBackup but copy i dont to my nas. i will try tomorrow my onedrive storage.

Lucascoco commented 2 years ago

The same problem with OneDrive. He make the backup on local storage but I don’t upload. Passwort ist working with only 16 sign . When I make this without root, it will be the same

ttionya commented 2 years ago

Passwort ist working with only 16 sign .

You mean the password can only be set to 16 bits? There is no limit on the number of password digits in the script. The default password has 18 digits, if it shows 16 digits, that means it's in effect, maybe you can try using only numeric letters.

He make the backup on local storage but I don’t upload.

My understanding is that you said the script created the backup file but didn't upload it to the remote storage.

No errors were reported in the previous logs, so by definition the upload should have been successful. You can execute docker exec -it vaultwarden_backup to enter the container and create a new file, execute rclone copy "your file" "BitwardenBackup:/BitwardenBackup" and see if the upload was successful.

When I make this without root, it will be the same

If you do not specify the --user option when executing docker, the container will run with the root user by default.

Lucascoco commented 2 years ago

i think i found the problem. i run BitwardenBackup in a docker and rclone direkt on my linux system, and after i exec the contaier, i saw that the config rclone config file was wrong. After this i try to edit the config file without the container, but it dont work. so i copy the file in the volume and try the copy command. And it works. Must i run rclone in a Docker, is that bedder? THX for your great work.

Lucascoco commented 2 years ago

and now i make it with alias too, it is a littel bit tricky. i need to make a volume, that mount per smb my nas. After this i mount the volume in my docker, so rclone can copy the files now...

ttionya commented 2 years ago

The backup docker image includes the rclone command, why would you want to use rclone in the host?

Lucascoco commented 2 years ago

I didn't know any better and thought it had to be done from the host. And also mount the local drive to the NAS there, which was completely wrong.

Lucascoco commented 2 years ago

what is bedder, rcloen install direkt on the linux system or as an docker?

ttionya commented 2 years ago

Seeing that you mention your NAS a lot, if you have vaultwarden installed on your NAS and want to back up your backup files to your host local filesystem, you can try using rclone local filesystem. Of course it's never a good idea to put the backup files on the same machine. But you may use NAS backup tools to sync backup files to other remote storage, whatever you like.

A more common use of this backup tool is to sync directly to a remote storage using the built-in rclone tool. This way you don't need any software on your host for synchronization.

So

what is bedder, rcloen install direkt on the linux system or as an docker?

You don't need to install rclone on your host machine.

Lucascoco commented 2 years ago

Not on the host, but on the docker Maschine , I think or?

ttionya commented 2 years ago

Uploading backup files to remote storage is done through this backup tool, you just need to follow the configure rclone and backup section of the documentation to complete the configuration and leave the rest of the work to this tool.

Your docker engine is installed on the host, and then the container is started through the docker engine. If you have any questions about docker, you can read the docker documentation.