mandarons / icloud-drive-docker

Dockerized iCloud Client - make a local copy of your iCloud documents and photos, and keep it automatically up-to-date.
BSD 3-Clause "New" or "Revised" License
985 stars 47 forks source link

[BUG] mounting error #94

Closed isaaccs closed 1 year ago

isaaccs commented 1 year ago

Describe the bug

-v '/mnt/user/appdata/icloud-drive-sync/config.yaml':'/app/config.yaml':'rw' -v '/mnt/user/icloud-drive-sync/':'/app/icloud/':'rw' --restart always 'mandarons/icloud-drive'
63a2034e9070c6f14422ee29112f6ca48ea8d28146184a4c26d01d94866301da
docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:75: mounting "/mnt/user/appdata/icloud-drive-sync/config.yaml" to rootfs at "/app/config.yaml" caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.

To Reproduce It appears on Unraid

Screenshots

Capture d’écran 2022-08-16 à 23 05 27
mandarons commented 1 year ago

@isaaccs : Try creating config.yaml file first and then mount it on container.

bjsharplin commented 1 year ago

For "Config Path:"-Click Edit button-Change "Container Path", "HostPath","Default Value". When you edit the config.yaml in the console, it's /app/config.yaml.
Snag_1598d9b

isaaccs commented 1 year ago

Do you mean to create a folder with the config file ?

mandarons commented 1 year ago

Correct - as shown in installation using docker compose, it should be:

Container Path: /app/config.yaml Host Path: /mnt/user/appdata/icloud-drive-sync/config.yaml

bjsharplin commented 1 year ago

Have you tried that setting? That will throw an error using unRaid docker. It seems to want to create a drive/folder not a file.

mandarons commented 1 year ago

No. Sorry, I never used unRaid and cannot try it on my end. Is there any other way to specify volumes in unRaid? Probably some CLI to bypass the GUI?

isaaccs commented 1 year ago

I changed my settings as suggested then i put my config file in in icloud-drive-sync folder

Capture d’écran 2022-10-03 à 18 20 26

I run my docker, then open my console and run: icloud --username= --session-directory=/app/session_data And I have the following error

Capture d’écran 2022-10-03 à 18 21 03
bjsharplin commented 1 year ago

When you run this command from the console, be sure to set your icloud username after the equals sign

icloud --username=!!!!!!!!!!! --session-directory=/app/session_data

isaaccs commented 1 year ago

of course it's what i did

bjsharplin commented 1 year ago

did you update the /app/config.yaml file to include your icloud account and the icloud folders you want to sync over?

isaaccs commented 1 year ago

yes

bjsharplin commented 1 year ago

the password is stored to the keyring when you run this command. perhaps you need to run it again. it should prompt for password, ask to save to keyring, and 2fa code (if you have that turned on).

isaaccs commented 1 year ago

I restart my container and I have the same error

isaaccs commented 1 year ago
/app # icloud --list
usage: icloud [-h] [--username USERNAME] [--password PASSWORD] [-n] [--delete-from-keyring] [--list] [--llist] [--locate] [--device DEVICE_ID] [--sound]
              [--message MESSAGE] [--silentmessage SILENTMESSAGE] [--lostmode] [--lostphone LOST_PHONE] [--lostpassword LOST_PASSWORD]
              [--lostmessage LOST_MESSAGE] [--outputfile] [--session-directory SESSION_DIRECTORY] [--region REGION]
icloud: error: No username supplied
isaaccs commented 1 year ago

my config file

app:
  logger:
    # level - debug, info (default), warning or error
    level: "info"
    # log filename icloud.log (default)
    filename: "icloud.log"
  credentials:
    # iCloud drive username
    username: "myemail"
    # Retry login interval - default is 10 minutes
    retry_login_interval: 600
  # Drive destination
  root: "icloud"
  smtp:
    # If you want to recieve email notifications about expired/missing 2FA credentials then uncomment
    # email: "sender@test.com"
    # default to is same as email above
    # to: "receiver@test.com"
    # password:
    # host: "smtp.test.com"
    # port: 587
    # If your email provider doesn't handle TLS
    # no_tls: true
  region: global # valid values are - global (default - uses .com) or china (uses .com.cn)
drive:
  destination: "drive"
  remove_obsolete: true
  sync_interval: 3600
photos:
  destination: "photos"
  remove_obsolete: true
  sync_interval: 3600
bjsharplin commented 1 year ago

This is what my config.yaml look like. I have folders specified under the "drive" section, and "All Photos" for pictures. I did move all my folders into and "iCloud" folder to make this setup very simple, but you could list them all out. Maybe the filters section is optional?? image

isaaccs commented 1 year ago

I don't specify any filters because I want to backup all my iCloud data

mandarons commented 1 year ago

@isaaccs : Also mount -

${PWD}/icloud/data:/app/icloud (if you want to save the iCloud data outside container) ${PWD}/session_data:/app/session_data (this will eliminate the need of entering password after container recreation)

Pleas make sure to say 'yes' to save password in keyring when you execute icloud --username=<your_email> --session-directory=/app/session_data inside the container.

rastacalavera commented 1 year ago

Hello! Thank you for making this available :) I too am having an issue. I was able to get the container up and running by following some of the advice in this thread but now after authenticating, the container is just constantly restarting. Logs below:

2022-10-04T15:00:46.099738572Z 2022-10-04 15:00:46,099 :: INFO :: keyring.backend :: backend.py :: 154 :: Loading Gnome
2022-10-04T15:00:46.120295762Z 2022-10-04 15:00:46,120 :: INFO :: keyring.backend :: backend.py :: 154 :: Loading Google
2022-10-04T15:00:46.121924022Z 2022-10-04 15:00:46,121 :: INFO :: keyring.backend :: backend.py :: 154 :: Loading Windows (alt)
2022-10-04T15:00:46.123806336Z 2022-10-04 15:00:46,123 :: INFO :: keyring.backend :: backend.py :: 154 :: Loading file
2022-10-04T15:00:46.124437058Z 2022-10-04 15:00:46,124 :: INFO :: keyring.backend :: backend.py :: 154 :: Loading keyczar
2022-10-04T15:00:46.124702569Z 2022-10-04 15:00:46,124 :: INFO :: keyring.backend :: backend.py :: 154 :: Loading multi
2022-10-04T15:00:46.125200705Z 2022-10-04 15:00:46,125 :: INFO :: keyring.backend :: backend.py :: 154 :: Loading pyfs
2022-10-04T15:00:46.183662895Z Loading config from /app/config.yaml ...
2022-10-04T15:00:47.862400249Z Traceback (most recent call last):
2022-10-04T15:00:47.862477918Z   File "/app/./src/main.py", line 6, in <module>
2022-10-04T15:00:47.862600024Z     sync.sync()
2022-10-04T15:00:47.862647253Z   File "/app/src/sync.py", line 70, in sync
2022-10-04T15:00:47.863270602Z     sync_photos.sync_photos(config=config, photos=api.photos)
2022-10-04T15:00:47.863326126Z   File "/app/venv/lib/python3.9/site-packages/icloudpy/base.py", line 582, in photos
2022-10-04T15:00:47.864405820Z     self._photos = PhotosService(service_root, self.session, self.params)
2022-10-04T15:00:47.864448109Z   File "/app/venv/lib/python3.9/site-packages/icloudpy/services/photos.py", line 153, in __init__
2022-10-04T15:00:47.864945267Z     raise ICloudPyServiceNotActivatedException(
2022-10-04T15:00:47.865037304Z icloudpy.exceptions.ICloudPyServiceNotActivatedException: iCloud Photo Library not finished indexing. Please try again in a few minutes.

My folder structure looks like this:

drwxrwxr-x  4 tiny tiny 4096 Oct  4 14:44 .
drwxr-x--- 18 tiny tiny 4096 Oct  4 14:11 ..
-rw-rw-r--  1 tiny tiny 1381 Oct  4 14:43 config.yaml
drwxr-xr-x  2 root root 4096 Oct  4 14:39 data
-rw-rw-r--  1 tiny tiny  473 Oct  4 14:39 docker-compose.yml
-rw-rw-r--  1 tiny tiny   68 Oct  4 14:18 .env.icloud
drwxr-xr-x  2 root root 4096 Oct  4 14:44 session_data

and my compose file:

version: "3.4"
services:
  icloud:
    image: mandarons/icloud-drive
    environment:
      - PUID=1000
      - GUID=1000
    env_file:
      - .env.icloud #should contain ENV_ICLOUD_PASSWORD=<password>
    container_name: icloud
    restart: unless-stopped
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - ${PWD}/config.yaml:/app/config.yaml
      - ${PWD}/data:/app/icloud
      - ${PWD}/session_data:/app/session_data

I removed the second icloud folder that was in the sample compose because i didn't want two icloud folders.

In my config.yml i commented out all of the drive stuff since I only want photos. I put in a single album name in the filter just to give things a try. Any help would be appreciated :)

mandarons commented 1 year ago

2022-10-04T15:00:47.865037304Z icloudpy.exceptions.ICloudPyServiceNotActivatedException: iCloud Photo Library not finished indexing. Please try again in a few minutes.

@rastacalavera : looks like server side issue. You will need to wait (not sure, how long) for server side indexing to finish.