#5049 `wrangler d1 migrations apply` fails silently with bad database ID
Bug no longer reproducible in wrangler 4.60.0 - now shows clear error "The database <uuid> could not be found [code: 7404]"
Close with comment explaining fix has been verified
Analysis Report
Issue Review: cloudflare/workers-sdk#5049
Summary
wrangler d1 migrations apply was failing silently with exit code 1 when an incorrect database ID was configured in wrangler.toml, with no error message explaining what went wrong.
Findings
- Created: 2024-02-17
- Updated: 2025-10-30
- Version: 3.28.3 → 4.60.0
- Component: D1 (wrangler)
- Labels: bug, d1
- Comments: 0
Key Evidence
- Reproduction attempted: Issue is no longer reproducible in wrangler 4.60.0
- When running
wrangler d1 migrations apply some-db --remotewith an invalid database ID:- Before (v3.28.3): Silent failure with
ELIFECYCLE Command failed with exit code 1 - Current (v4.60.0): Clear error message:
The database 00000000-0000-0000-0000-000000000000 could not be found [code: 7404]
- Before (v3.28.3): Silent failure with
- No specific PR found that explicitly fixes this issue, but the error handling has been improved through general API error propagation enhancements
- Related PR #11711 (merged 2025-12-19) fixed similar silent failures when no config file exists
Recommendation
Status: CLOSE
Reasoning: The issue has been resolved in the current version of wrangler. The API now properly returns a 7404 error code with a clear message when a database ID is not found, and wrangler correctly displays this error to the user.
Action: Close the issue with a comment explaining the fix.
Suggested Comment
This issue appears to have been fixed in a recent version of wrangler. When running
wrangler d1 migrations applywith an invalid database ID in the current version (4.60.0), you now receive a clear error message:The database <uuid> could not be found [code: 7404]If you're still experiencing silent failures, please upgrade to the latest version of wrangler. If the issue persists after upgrading, please let us know and we can reopen this issue.