Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Keyring never seen as saved - ERROR :: root :: sync.py :: 116 :: Password is not stored in keyring. Please save the password in keyring. #238

Closed
TheCase opened this issue Jun 29, 2024 · 25 comments
Assignees
Labels
awaiting-info Awaiting more information to proceed bug Something isn't working

Comments

@TheCase
Copy link

TheCase commented Jun 29, 2024

I know this is a duplicate of the previous report, but am filing separately as that issue is awaiting a response. I am using the new /config directory layout for local config and session_data storage (as seen in the included docker-compose and config file)

Describe the bug
The authentication information is not correctly stored in the keyring, according to the app

App was working fine before the recent updates. Love the app. So dearly want it to be working again!

Platform: Synology NAS

To Reproduce

  1. delete all session data in ./config
  2. docker-compose up -d
  3. log in using following command (outside docker container):
  4. docker exec -it icloud /bin/sh -c "icloud [email protected] --session-directory=/config/session_data"
  5. answer "y" to save keyring prompt
  6. enter TFA
  7. assume that nothing returned means login was successful
  8. either a) wait 10 minutes or b) stop container and restart
  9. see error "Password is not stored in keyring"

Expected behavior
keyring save should result in successful login

Configuration
docker-compose.yaml

version: "3.4"
services:
  iCloud:
    container_name: icloud
    image: mandarons/icloud-drive:latest
    environment:
      - PUID=1000
      - GUID=1000
      - ENV_CONFIG_FILE_PATH=/config/config.yaml
      - TZ=America/Boise
    volumes:
      - ./config:/config
      - ./icloud:/icloud

I've also set the config to have logs at debug level. I don't see debug level logs. I know the config is somewhat working, as the Discord notifications about TFA requirements are working

./config/config.yaml:

app:
  logger:
    level: "debug"
    filename: "/config/icloud.log"
  credentials:
    username: "[email protected]"
    retry_login_interval: 600
  root: "/icloud"
  discord:
    webhook_url: https://discord.com/api/webhooks/XXXwebookidXXX
    username: iCloud-Files
  region: global
drive:
  destination: "drive"
  remove_obsolete: false
  sync_interval: 600
photos:
  destination: "photos"
  remove_obsolete: false
  sync_interval: 300
  all_albums: true 
  folder_format: "%Y/%m" 
  filters:
    file_sizes:
      - "original"
@TheCase TheCase added the bug Something isn't working label Jun 29, 2024
@TheCase
Copy link
Author

TheCase commented Jun 29, 2024

I'll add that subsequent attempts to authenticate do not prompt for password - just exits code 0.

@mandarons
Copy link
Owner

Try setting the ENV_ICLOUD_PASSWORD variable.

@jmsaham
Copy link

jmsaham commented Jul 6, 2024

Same issue. Adding the ENV_ICLOUD_PASSWORD variable to Docker container does nothing.
I have it setup with Telegram. I get the notification to run the Auth command, since the variable is set it doesn't ask me for a password, and then I enter the 2FA code, it takes me back to a prompt.

2024-07-05 21:07:58,417 :: INFO :: icloudpy.base :: base.py :: 253 :: Session file does not exist
2024-07-05 21:07:59,567 :: ERROR :: root :: sync.py :: 100 :: Error: 2FA is required. Please log in.
2024-07-05 21:07:59,567 :: INFO :: root :: config_parser.py :: 69 :: Retrying login every 600 seconds.
2024-07-05 21:07:59,567 :: INFO :: root :: sync.py :: 109 :: Retrying login at Fri Jul 5 21:17:59 2024 ...

@TheCase
Copy link
Author

TheCase commented Jul 10, 2024

I have also tried the ENV_ICLOUD_PASSWORD variable. Still no luck

@rix1337
Copy link

rix1337 commented Jul 13, 2024

Yep. Also still broken here.

@gniting
Copy link

gniting commented Jul 13, 2024

I was having the same issue and adding the ENV_ICLOUD_PASSWORD env variable fixed it for me.

@rix1337
Copy link

rix1337 commented Jul 13, 2024

Not for me. I am using that exact var.

@gniting
Copy link

gniting commented Jul 13, 2024

@rix1337 Onboarding is not smooth, I give you that. I've had to find my way to various trials and errors to get the latest version to run properly. The latest release(s) have made some underlying changes that are most likely the cause of the confusion.

The other problem I am running into is this. Not a big deal, but it's not "clean." This never happened before the latest releases either. Are you seeing the same?

@rix1337
Copy link

rix1337 commented Jul 13, 2024

Agreed. The docker was working for months. The recent changes broke it with the above error.
The new ENV does not help, even when used.

@jyourstone
Copy link

Same issue here, keep getting the error "Password is not stored in keyring. Please save the password in keyring." on reboot. If I add the ENV variable ENV_ICLOUD_PASSWORD I get a TFA push notification from Apple on reboot. If I manually remove the password from keyring and login again everything seems fine in the console, but the errors are still there.

@gniting
Copy link

gniting commented Jul 13, 2024

I also noticed that the init script makes a directory called session under /config but the code and examples reference a directory called session_data. So I made session a symlink to session_data, emptied the directory and started with a new login. Seems to have worked.

At this point, I am just shooting in the dark and hoping something sticks! 🙂

Let's wait for @mandarons to share guidance.

@rix1337
Copy link

rix1337 commented Jul 13, 2024

Sounds like that’s the bug

@rix1337
Copy link

rix1337 commented Jul 13, 2024

I debugged this project and found the issue.

Do not run icloud --session-directory=/app/session_data [email protected] --> this dir is not referenced at all
Run this instead icloud --session-directory=/config/session_data [email protected]

@jyourstone
Copy link

I debugged this project and found the issue.

Do not run icloud --session-directory=/app/session_data [email protected] --> this dir is not referenced at all Run this instead icloud --session-directory=/config/session_data [email protected]

That worked, thank you!

@rix1337
Copy link

rix1337 commented Jul 13, 2024

@mandarons the current docket build notifications reference a wrong dir

@mandarons
Copy link
Owner

Sorry folks for delayed response here. Life has been busy lately.

I fixed 2 of the issues mentioned here (#245 and #246). It looks like documentation is also up to date with changes for using /config/session_data path (instead of /app/session_data).

Please give it a try with mandarons/icloud-drive:main tag and let me know if you still see any issues.

@mandarons mandarons added the awaiting-info Awaiting more information to proceed label Jul 20, 2024
@nicx
Copy link

nicx commented Jul 22, 2024

@mandarons I updated yesterday to the last version. With this version I'll get the 2FA Apple prompt every hour.

But I have already executed the command "docker exec -it icloud-docker /bin/sh -c "icloud --username=*** --session-directory=/app/session_data"" and filled in the Auth code once. Repeating that commend does not show any missing info, so I'll get no output anymore.

So this is unfortunately still not working! :(

This is the log:

2024-07-22 11:43:57,770 :: ERROR :: icloudpy.base :: base.py :: 186 :: Authentication required for Account. (421)
2024-07-22 11:43:59,306 :: ERROR :: root :: sync.py :: 100 :: Error: 2FA is required. Please log in.

@mandarons
Copy link
Owner

@nicx : Please use /config/session_data instead of /app/session_data and try again.

@nicx
Copy link

nicx commented Jul 22, 2024

@mandarons shit, that was my mistake. thanks for your hint! I just used the old command from an old mail :)

@TheCase
Copy link
Author

TheCase commented Jul 28, 2024

I got a chance to try the latest "main" tag today, seeing this error:

Starting icloud ... done
Attaching to icloud
icloud    | s6-rc-compile: fatal: unable to open /etc/s6-overlay/s6-rc.d/svc-icd/up: No such file or directory

@mandarons
Copy link
Owner

@TheCase please try again. I added the missing file. It seems to be working on my system.

@TheCase
Copy link
Author

TheCase commented Jul 28, 2024

Ok. That worked...

But only when ENV_ICLOUD_PASSWORD is defined. This was not a requirement before the latest changes (where you moved config assets from /app to /config).

I would prefer not to hard core my iCloud password in a file or provide it to the docker environment (where it is visible in the docker inspect output of the container).

Unfortunately, this is still a bug. Auth was working fine without the var, previously.

That said, I have a feeling you do this in your free time. I very much appreciate the effort you made to get this app working for several of us!

@mandarons
Copy link
Owner

@TheCase: Completely agree with you about recent hard requirement of ENV_ICLOUD_PASSWORD. Please try the following steps and let me know if that works (it seem to be working for me).

  1. Remove ENV_ICLOUD_PASSWORD variable
  2. Use docker exec -it --user=abc icloud /bin/sh -c "icloud --username=<icloud-username> --session-directory=/config/session_data" to save icloud password in keyring. (Note the use of --user=abc option in docker exec command).

Please let me know if it works. I will update the documentation accordingly.

@TheCase
Copy link
Author

TheCase commented Aug 7, 2024

Indeed, that --user add was the trick!

Please note that this did not work until I deleted any existing session data from the /config volume.

Thank you! This is perfect. Cheers!

@TheCase TheCase closed this as completed Aug 7, 2024
@mandarons
Copy link
Owner

I will update the docs to indicate ENV_ICLOUD_PASSWORD is optional (again). Thanks for quickly testing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-info Awaiting more information to proceed bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants