gilesknap / gphotos-sync

Google Photos and Albums backup with Google Photos Library API
Apache License 2.0
1.97k stars 161 forks source link

Can't run with docker on my Pi4 (OpenMediaVault 5) #384

Closed stepc0re closed 1 year ago

stepc0re commented 1 year ago

Hi i have issues starting gphotos-sync with docker on my NAS. Because it's headless i first started it once on my laptop (ubuntu). This finally worked and I got my .gphotos.token.

Ubuntu:~$ gphotos-sync --skip-files --skip-albums --skip-index gphotos-sync/
09-18 15:43:28 WARNING  gphotos-sync 3.0.3 2022-09-18 15:43:28.087456 
09-18 15:43:28 WARNING  Done. 

I copied it to the location where I want to have my photos synced. It's on the NAS-Drive I set up with OpenMediaVault.

it looks like this:

storage=/path to storage
config=/path to config

because i dont need the webpage I used this syntax:

user@raspberry:/$ sudo docker run --rm -v $config:/config -v $storage:/storage ghcr.io/gilesknap/gphotos-sync /storage

and i got

Traceback (most recent call last):
  File "/root/.local/bin/gphotos-sync", line 5, in <module>
    from gphotos_sync.Main import main
  File "/root/.local/lib/python3.10/site-packages/gphotos_sync/Main.py", line 2, in <module>
    import logging
  File "/usr/local/lib/python3.10/logging/__init__.py", line 57, in <module>
    _startTime = time.time()
PermissionError: [Errno 1] Operation not permitted

did I forget something?

My NAS runs on a Raspberry Pi4 with OpenMediaVault 5. The filesystem of the storage is ext4.

Thanks in advance!

gilesknap commented 1 year ago

I think there are a few tricks to running docker on a pi. A quick google found this which may be relevant to your issue: https://stackoverflow.com/questions/70195968/dockerfile-raspberry-pi-python-pip-install-permissionerror-errno-1-operation

I don't run docker on pi but I do run a kubernetes cluster with its own container runtime. I have to add this to the end of the command line in /boot/cmdline.txt

cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
stepc0re commented 1 year ago

Thanks! It looks like it works. I needed to update libseccomp2 like shown on the page.

We have nearly 200gb of Fotos on the cloud so it'll take a while. 10-11 20:53:26 WARNING gphotos-sync 0.1.dev1+g2f6bcbb 2022-10-11 20:53:26.482020 10-11 20:53:27 WARNING Indexing Google Photos Files ...

Will it also download the files my wife shared with me?

gilesknap commented 1 year ago

Yes. If you see the photos in your library then they should be downloaded, even if they are in shared albums.

stepc0re commented 1 year ago

Yep they are. Awesome!