iclouddrive: fresh non-ADP trust token immediately requires 2FA again after successful config
The associated forum post URL from https://forum.rclone.org
None yet. This appears distinct from #9730 because configuration and trusted-device 2FA complete successfully; the newly saved session fails on its first use.
What is the problem you are having with rclone?
A newly created iclouddrive remote completes SRP authentication and trusted-device 2FA without error, saves cookies and trust_token, but the first read-only command in a new process immediately fails with:
CRITICAL: Failed to create file system for "icloud-new:": trust token expired, please reauthThe account has Advanced Data Protection disabled. On iOS, iCloud.com → Allow Data Access is enabled.
This reproduces after deleting the remote and creating it from scratch with official rclone v1.75.1, using the regular Apple Account password and a fresh trusted-device 2FA code. It also reproduced with rclone config reconnect before the clean recreation.
The error text appears misleading. A sanitized header/status trace shows that the saved cookie session first fails validation with HTTP 421. Rclone then starts SRP authentication, includes the newly saved trust token, and Apple responds to /signin/complete with HTTP 409 requiring 2FA again:
POST /setup/ws/1/validate HTTP/1.1
HTTP/1.1 421
iclouddrive: authenticating
GET /appleauth/auth/authorize/signin HTTP/1.1
HTTP/1.1 200
POST /appleauth/auth/federate HTTP/1.1
HTTP/1.1 200
POST /appleauth/auth/signin/init HTTP/1.1
HTTP/1.1 200
POST /appleauth/auth/signin/complete HTTP/1.1
HTTP/1.1 409
iclouddrive: SRP sign in requires 2FA
trust token expired, please reauthA separate header-name-only trace confirmed that the final /signin/complete response contains X-Apple-Session-Token; no header values were retained or shared.
This differs from #9730: there, the 2FA validation request itself returns 409 and configuration aborts. Here, the trusted-device code is accepted, /2sv/trust and configuration finish without an error, and fresh credentials are written. The failure occurs when the new process tries to reuse those credentials.
Reproduction
- Delete an existing test remote, or start with a new remote name.
- Run
rclone config. - Create an
iclouddriveremote using the regular Apple Account password. - Leave Advanced config disabled.
- Enter a fresh trusted-device 2FA code.
- Save the remote. Configuration exits successfully.
- Run:
rclone lsd 'icloud-new:' --max-depth 1 -vvThe first access fails with trust token expired, please reauth.
Expected behavior
The cookie session or newly issued trust token should allow the first subsequent process to authenticate without requesting 2FA again, and lsd should list the remote.
What is your rclone version?
rclone v1.75.1
- os/version: debian 13.6 (64 bit)
- os/kernel: 6.12.105+deb13-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.26.8
- go/linking: static
- go/tags: noneWhich cloud storage system are you using?
iCloud Drive (iclouddrive), non-ADP Apple Account with HSA2/two-factor authentication.
Additional checks already performed
- Upgraded from official v1.75.0 to checksum-verified official v1.75.1.
- Reproduced after deleting and recreating the remote from scratch.
- Confirmed
cookiesandtrust_tokenare newly written after successful configuration without exposing their values. - Confirmed no upload, deletion, or other Drive operation is reached; failure occurs during authentication.
- The same result occurs when using a fixed user-agent for both reconnect and the subsequent read-only listing.
- A local diagnostic build with #9730's
acceptedDespiteConflictheader condition removed completed trusted-device 2FA, but stock rclone still could not reuse the resulting fresh credentials.
I can provide additional sanitized traces that retain HTTP methods, paths, status codes, and header names only. I will not post cookies, Apple session headers, tokens, or personal account identifiers.
Source: rclone/rclone