mandarons / icloud-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
1.19k stars 49 forks source link

[BUG] ERROR :: root :: sync.py :: 116 :: Password is not stored in keyring. Please save the password in keyring. #256

Closed knmax closed 2 months ago

knmax commented 3 months ago

Describe the bug ERROR :: root :: sync.py :: 116 :: Password is not stored in keyring. Please save the password in keyring.

To Reproduce Steps to reproduce the behavior:

  1. login with 2FA
  2. See error

Expected behavior successful login

Screenshots

image

Configuration default configuration as I was upgrading from an older release and nothing worked

mandarons commented 3 months ago

Please try:

docker exec -it --user=abc icloud /bin/sh -c "icloud --username= --session-directory=/config/session_data"

knmax commented 3 months ago

Please try:

docker exec -it --user=abc icloud /bin/sh -c "icloud --username= --session-directory=/config/session_data"

I already did that to login with 2FA - otherwise no login is possible with 2FA or am I missing anything?

mandarons commented 3 months ago

Did you run the command with '--user=abc' flag?

knmax commented 3 months ago

yes

mandarons commented 3 months ago

Looks like your user id is 0 and group id is 911.

Try with '--user=0:911' flag.

knmax commented 3 months ago

just tried, but still the same message. Strange thing is, output of id -u $user and id -g $user is both 0 - I filled that in the docker-compose.yaml but it get's ignored when starting the container

mandarons commented 3 months ago

May be try removing PUID and PGID from your docker configuration?

knmax commented 3 months ago

When trying to start the container without PUID and GUID I get this:

image

I found that I have a spelling error in my docker-compose.yaml I wrote PUID and GUID instead of PUID and PGID After correcting this I finally have the correct PUID and PGID shown when running docker compose up, but I'm still getting the message that the password is not stored in keyring. I found a different issue which mentions not using the ENV_ICLOUD_PASSWORD - I'm also not using it as I don't want my iCloud Password in clear text in the configfiles, might this be some kind of issue?

knmax commented 3 months ago

I found the issue - as I was already using a older version in the past, I did not know that the config-path must be mentioned in the .env.icloud file, therefore it was not in there. I was now able to start the container and get a successful authentication even without having the ENV_ICLOUD_PASSWORD variable filled, now I am being served with the following error message.

image

Also the part where it "syncs" my drive, I have over 20 folders in my Drive and I don't believe that it syncs all those folders in a matter of a few seconds.

mandarons commented 3 months ago

The error that you're seeing is indicating that default (app provided) config.yaml file is being used. Default config.yaml has album 1 in it as an example filter.

Please make sure you're mounting local config/ to /config folder in the container (i.e. ${PWD}/config:/config # Must contain config.yaml), as mentioned in the README.

Going through README thoroughly just to double-check if everything has been set up correctly would be good idea.

knmax commented 3 months ago

The problem was that I was in the wrong folder when starting the container and therefore there was truly no config.yaml present... I managed to get past the other Error but, now it seems I'm presented with this Error:

image
mandarons commented 3 months ago

This error is about your config file. There seems to be misalignment at line 39 and 47.

knmax commented 3 months ago

I just directly copied the example config file into my setup and just removed the lines that are not needed for my setup, please have a look. Now I get the same message about line 40 and 44

image
app:
  logger:
    # level - debug, info (default), warning or error
    level: "info"
    # log filename icloud.log (default)
    filename: "/config/icloud.log"
  credentials:
    # iCloud drive username
    username: " myappleid"
    # Retry login interval - default is 10 minutes, specifying -1 will retry login only once and exit
    retry_login_interval: 600
  # Drive destination
  root: "/icloud"
  discord:
  # webhook_url: <your server webhook URL here>
  # username: icloud-docker #or any other name you prefer
  telegram:
  # bot_token: <your Telegram bot token>
  # chat_id: <your Telegram user or chat ID>
  smtp:
    ## If you want to receive email notifications about expired/missing 2FA credentials then uncomment
    # email: "user@test.com"
    ## optional, to email address. Default is sender email.
    # to: "receiver@test.com"
    # password:
    # host: "smtp.test.com"
    # port: 587
    # If your email provider doesn't handle TLS
    # no_tls: true
  region: global # For China server users, set this to - china (default: global)
drive:
  destination: "drive"
  remove_obsolete: false
  sync_interval: 300
  ignore:
    # When specifying folder paths, append it with /*
    - "node_modules/*"
    - "*.md"
photos:
  destination: "photos"
  remove_obsolete: false
  sync_interval: 500
  all_albums: true # Optional, default false. If true preserve album structure. If same photo is in multiple albums creates duplicates on filesystem
    file_sizes: # valid values are original, medium and/or thumb
      - "original"
      # - "medium"
      # - "thumb"
mandarons commented 3 months ago

You're missing 'filters:' just above 'file_sizes:' in your config file.

knmax commented 3 months ago

This error is about your config file. There seems to be misalignment at line 39 and 47.

Ok, I thought I could also remove that if I just want to download all, will retry in the evening.

knmax commented 3 months ago

Thanks for the point in the right direction. The sync is now working One thing which would be good to add in the instructions is how to set a different docker volume for storage as I guess some people would want to store the drive and pictures in a different volume.

mandarons commented 2 months ago

Mounting /icloud/drive and /icloud/photos to different paths in docker configuration should do it.