boredazfcuk / docker-icloudpd

An Alpine Linux container for the iCloud Photos Downloader command line utility
1.57k stars 149 forks source link

SMB or NFS Mount on Host #589

Closed cutzenfriend closed 3 days ago

cutzenfriend commented 5 days ago

Scenario:

VM has mounted a Synology volume on /mnt/x (tried SMB and NFS) and running Container has mount /mnt/x -> /home/* inside the container. Already tried to use the mount option ":z". Doesn't help.

I always get this error. If I go inside the container with sh I can write / read inside /home/* without any issues.

icloudpd  | 2024-06-27 12:29:16 ERROR    IOError while writing file to /home/*/iCloud/2015/02/15/IMG_9616.JPG. You might have run out of disk space, or the file might be too large for your OS. Skipping this file...
icloudpd  | 2024-06-27 12:29:17 ERROR    IOError while writing file to /home/*/iCloud/2015/02/15/IMG_9611.JPG. You might have run out of disk space, or the file might be too large for your OS. Skipping this file...
boredazfcuk commented 5 days ago

This error is always down to permissions.

Are you performing the test writes as the root account, or the user account which actually performs the writes? The shell prompt should be green if you are logged on as the user, not red.

cutzenfriend commented 5 days ago

The script within the container runs as root. Inside the config I added username, id and group. But this user doesn't get created when I start the container.

image
boredazfcuk commented 4 days ago

The script within the container runs as root.

Script uses su to switch users. This error you're raised is always permissions. Maybe your container is running rootless, or unprivileged, or your SMB/NFS shares are filtering the changes, etc.

Try removing the /config mount from the container's configuration and see if that creates the icloudpd.conf file as expected. Edit the file from within the container to remove some lines, then restart it and see if they get put back.

cutzenfriend commented 3 days ago

Okay I changed some parameters of the mount command. If I recreate the container it runs until this log entry and then stops:

icloudpd  | 2024-06-28 18:39:39 INFO     Failsafe file /home/user/iCloud/.mounted exists, continuing
icloudpd  | 2024-06-28 18:39:39 INFO     Directory is writable: /config/python_keyring/
icloudpd  | 2024-06-28 18:39:39 INFO     Keyring file exists, continuing
icloudpd  | 2024-06-28 18:39:39 INFO     Sync user: user
icloudpd  | 2024-06-28 18:39:39 INFO     Synchronisation starting at 18:39:39
icloudpd  | 2024-06-28 18:39:39 INFO     Keyring file exists, continuing

sh inside the docker is "green" an I can read and write everywhere. Host system is an Alpine Linux if that helps.

cutzenfriend commented 3 days ago

I started from scratch an downloaded everything from the start. This worked.

boredazfcuk commented 2 days ago

Thanks for letting me know