Part-DB / Part-DB-server

Part-DB is an Open source inventory management system for your electronic components
https://docs.part-db.de/
GNU Affero General Public License v3.0
891 stars 96 forks source link

Unable to backup on raspberry pi docker. Permission denied. #619

Closed dryet closed 4 months ago

dryet commented 4 months ago

I am running latest version of 64bit pi OS lite on my raspberry pi zero 2 W. I have my user in docker group.

Steps to reproduce the behavior:

  1. Install docker and docker compose.
  2. Install part-db following steps on part-db website.
  3. After sucesfully setting up part db try to backup using: docker exec --user=www-data -it partdb bin/console partdb:backup --full /home/partdb_backup.zip
  4. Error failed to open stream: Permission denied or File not found

Expected behavior Back up completed and data stored in zip file.

Screenshots If applicable, add screenshots to help explain your problem.

Server Side

Additional context I am a begginer with linux and part-db. Maybe I am missing something. This probably isn't a bug and I am just missing something. Thank you in advance.

RaptorDE commented 4 months ago

The command is executed in the docker container, so the output path must also be in the container.

I put it in the media directory.

docker exec --user=www-data partdb php bin/console partdb:backup --full /var/www/html/public/media/backup.zip

Then I copy the zip with a script to another location.

dryet commented 4 months ago

Okay. This worked but I still can't acces the file using WinSCP because it is probably inside the docker container at /var/lib/docker.

Do you know the complete path of this backup when I create it to /var/www/html/public/media/backup.zip? Or at least a way I could copy it out of there without signing in a root?

RaptorDE commented 4 months ago

If you have used the Docker compose file from the documentation, the media directory should be located in the public_media folder on your Raspberry.

https://docs.part-db.de/installation/installation_docker.html#docker-compose

More info about docker volumes. https://docs.docker.com/storage/volumes/

dryet commented 4 months ago

YES! You are right. Thank you. This gave me a lot of information about docker file system that I was not able to easily find. Thank you so much. I am closing this issue.