#8363 wrangler caches account ID which causes auth 10000 error when moving accounts
Related fix in PR #11962 (wrangler 4.59.3) improves account caching behavior. Reporter on v3.111.0, commenter on v4.10.0. May not fully address cross-deployment cache staleness.
Ask users to upgrade to wrangler 4.59.3+ and verify if issue persists
Analysis Report
Issue #8363: wrangler caches account ID which causes auth 10000 error when moving accounts
Summary
| Field | Value |
|---|---|
| Issue | #8363 |
| Title | wrangler caches account ID which causes auth 10000 error when moving accounts |
| State | OPEN |
| Created | 2025-03-05 |
| Updated | 2025-10-30 |
| Labels | bug |
| Reporter Version | 3.111.0 |
| Latest Version | 4.60.0 |
Problem Description
Users deploying Pages projects to different Cloudflare accounts encounter authentication error 10000 because Wrangler caches the account ID in node_modules/.cache. When switching accounts (using different API tokens), Wrangler continues to use the cached account ID from the previous deployment, causing a mismatch between the authentication credentials and the target account.
Reported workaround: Deleting node_modules and running npm install clears the cache and fixes the issue.
Analysis
Related Fix Found
PR #11962 (merged 2026-01-19) addresses a closely related issue with account caching:
"Cache chosen account in memory to avoid repeated prompts"
When users have multiple accounts and no
node_modulesdirectory exists for file caching, Wrangler would prompt for account selection multiple times during a single command. Now the selected account is also stored in process memory, preventing duplicate prompts and potential issues from inconsistent account choices.
This fix is included in wrangler 4.59.3+.
Version Gap
- Reporter's version: 3.111.0 (March 2025)
- Commenter's version: 4.10.0 (April 2025)
- Fix version: 4.59.3 (January 2026)
- Latest version: 4.60.0
Root Cause Assessment
The issue stems from Wrangler persisting account selection in a file cache under node_modules/.cache. While PR #11962 improves the in-memory caching behavior, the underlying issue of the file cache persisting stale account IDs across different token/account contexts may still exist for users who:
- Deploy with one account token
- Switch to a different account token
- Deploy again without clearing cache
The fix in 4.59.3 primarily addresses repeated prompts within a single command execution rather than the cross-deployment cache staleness issue described in #8363.
Additional Related Improvement
PR #11683 adds a warning when authentication errors occur and the account_id in configuration doesn't match authenticated accounts - this provides better user feedback for this class of issues.
Recommendation
KEEP OPEN - The issue should remain open with a request for more information:
- Partial fix available: PR #11962 improves account caching behavior but may not fully address the cross-deployment cache staleness scenario
- Version upgrade needed: Both the original reporter (3.111.0) and commenter (4.10.0) should upgrade to 4.59.3+ and verify if the issue persists
- Potential remaining gap: The file cache in
node_modules/.cachemay still cause issues when switching between accounts across separatewrangler deployinvocations
Suggested Actions
- Add a comment asking users to upgrade to wrangler 4.59.3+ and report if the issue persists
- Consider whether the file cache should be invalidated when the API token changes
- Document the workaround of clearing the cache when switching accounts
Evidence
- Changelog entry for 4.59.3 references PR #11962 addressing account caching
- PR #11962 merged 2026-01-19, included in 4.59.3
- No direct reference to issue #8363 in any PRs or commits
Notes & Feedback (0)
No notes yet.