`wrangler d1 migrations list --remote` ignores `account_id` from the config file
Maintainers usually reply within 1 day
@idhanth is already working on this.
Since Oct 15, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
Research direction
The bug is in the --remote branch of the d1 migrations list handler in packages/wrangler/src/d1/migrations/list.ts, around lines 53-55, where requireAuth({}) is called with an empty config. Compare it with the migrations apply handler, which already passes the loaded config and works with account_id set. To check the fix, run the list command with --remote in a non-interactive shell on a login with two accounts, using a config that sets account_id. Done means the command selects the configured account without prompting or erroring.
Written by the indexing model from the issue text.
Description
What versions & operating system are you using?
wrangler 4.151.0 (also 4.134.0), Node 22, macOS 15 (Darwin 24.6.0, arm64)
Please provide a link to a minimal reproduction
No repo needed. Any project whose wrangler.jsonc sets account_id and has a D1 binding, run by a user whose login can see more than one account:
{
"name": "example",
"account_id": "<account A>",
"d1_databases": [
{ "binding": "DB", "database_name": "example-db", "database_id": "<id>", "migrations_dir": "migrations" }
]
}
wrangler d1 migrations list example-db --remote # in a non-interactive shell
Describe the Bug
wrangler d1 migrations list --remote ignores account_id from the config file. With more than one account on the login, it fails in a non-interactive shell (or prompts in an interactive one) even though the config names the account.
The handler authenticates with an empty config instead of the loaded one:
if (remote) {
await requireAuth({});
}
getActiveAccountId() only reads config.account_id, so passing {} means the account from wrangler.jsonc is never considered. wrangler d1 migrations apply --remote on the same project works, as do other commands that pass config. Passing config here (await requireAuth(config);) should fix it.
Expected: the command uses account_id from the config, as apply does.
Workaround: set CLOUDFLARE_ACCOUNT_ID.
Please provide any relevant error logs
✘ [ERROR] More than one account available but unable to select one in non-interactive mode.
Please set the appropriate `account_id` in your Wrangler configuration file or assign it to the `CLOUDFLARE_ACCOUNT_ID` environment variable.
Available accounts are (`<name>`: `<account_id>`):
`<account A>`: `<id>`
`<account B>`: `<id>`
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 1.6k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 255
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/workers-sdk
-
bug feature:workers-assets package:deploy-helpers package:wrangler
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
cloudflare/workers-sdk#16713 · 1 comment ·
Maintainers usually reply within 1 day
-
bug error-messaging package:workers-utils product:containers
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/workers-sdk#16692 · 1 comment ·
Maintainers usually reply within 1 day
-
bug package:vite-plugin
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
cloudflare/workers-sdk#16605 · 2 comments ·
Maintainers usually reply within 1 day
-
`wrangler r2 object put` with ".." in the object key fails with an HTML "Attention Required!" page instead of a clear errorMay be free again @akhil9tiet claimed this 7 days ago, and no pull request is open. Openbug package:wrangler product:r2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
cloudflare/workers-sdk#16587 · 2 comments ·
Maintainers usually reply within 1 day
-
bug not-in-wrangler
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
cloudflare/workers-sdk#16416 · 1 comment ·
Maintainers usually reply within 1 day
All issues in cloudflare/workers-sdk
Similar issues
-
Navbar avatar and name stay stale after saving profile changesPossibly taken @alexechoi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
marmelab/atomic-crm#416 ·
Maintainers usually reply within 1 day
-
feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
bluesky-social/social-app#12343 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
lucide-icons/lucide#5165 ·
Maintainers usually reply within 1 day
-
[Feature] Preferences - Keep the theme selection popover open after selection for quick previewOpen
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
marktext/marktext#6033 · 1 comment ·
Maintainers usually reply within 1 day
-
area:desktop bug has repro platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
anthropics/claude-code#107903 ·