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]. After install and username/password- I just get continuous 2FA popups per 10 mins. #136

Closed bmpreston closed 1 year ago

bmpreston commented 1 year ago

Describe the bug Cannot initiate the downloads to backup my iCloud drive.

To Reproduce Steps to reproduce the behavior:

  1. Install
  2. Authenticate with the bash command line; enter my password
  3. Insert 2FA code
  4. Wait 10 minutes for the next code popup.

Expected behavior Download should initiate into the folder specified.

Running on unraid 6.11.5

mandarons commented 1 year ago

It seems that 2FA authentication isn't sticking. Are you using persistent storage for session directory?

bmpreston commented 1 year ago
Screenshot 2023-03-27 at 14 26 33

Both directories for the config and the data are on the /mnt drive. Not sure what else you might be asking about. Thanks!

mandarons commented 1 year ago

As shown in docker-compose, try mounting /app/session_data from the container as well.

When you authenticate using command line, pass the --session-directory=/app/session_data parameter authentication-required-after-container-creation-or-authentication-expiration.

bmpreston commented 1 year ago

Ok, I mounted a /app/session_data and the following is where I am. Logs show this:

Loading config from /app/config.yaml ... Loading config from /app/config.yaml ... 2023-03-29 20:14:19,986 :: ERROR :: root :: sync.py :: 102 :: Password is not stored in keyring. Please save the password in keyring. 2023-03-29 20:14:19,987 :: INFO :: root :: config_parser.py :: 65 :: Retrying login every 600 seconds. 2023-03-29 20:14:19,987 :: INFO :: root :: sync.py :: 109 :: Retrying login at Wed Mar 29 20:24:19 2023 ...

My Config.yaml is:

app:
  logger:
    # level - debug, info (default), warning or error
    level: "error"
    # log filename icloud.log (default)
    filename: "icloud.log"
  credentials:
    # iCloud drive username
    username: "foo@bar.com"
    # Retry login interval - default is 10 minutes
    retry_login_interval: 600
  # Drive destination
  root: "icloud"
  # smtp:
  # If you want to receive email notifications about expired/missing 2FA credentials then uncomment
  # email: "sender@test.com"
  # Uncomment this if your SMTP username is different than your sender address (for services like AWS SES)
  # username: ""
  # 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
  # valid values are - global (default - uses .com) or china (uses .com.cn)
  region: global
drive:
  destination: "drive"
  remove_obsolete: false
  sync_interval: 300
  filters:
    # File filters to be included in syncing iCloud drive content
    folders:
      - "folder1"
      - "folder2"
      - "folder3"
    file_extensions:
      # File extensions to be included
      - "pdf"
      - "png"
      - "jpg"
      - "jpeg"
photos:
  destination: "photos"
  remove_obsolete: false
  sync_interval: 500
  filters:
    albums:
      - "album 1"
      - "album2"
    file_sizes:
      # valid values are original, medium and/or thumb
      - "original"
      # - "medium"
      # - "thumb"

Any additional help here?

mandarons commented 1 year ago

Run following command and when it asks for storing the password in keyring, say yes... docker exec -it icloud /bin/sh -c "icloud --username=<icloud-username> --session-directory=/app/session_data"

bmpreston commented 1 year ago

I did say yes, just keeps cycling. For some reason, it doesn't seem to like this program.

Thanks!