cloudflare / cloudflare/developer-platform
D1 Import API becomes unstable after toggling Read Replication
@vy-ton arbeitet bereits daran.
Seit 26.4.2026.
- Vorherrschende Sprache
- Keine Sprachdaten
- Sterne
- 1
- Forks
- 0
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Environment
- Wrangler: reproduced with
4.56.0,4.82.2, and4.85.0 - Node.js:
22 - OS: Linux
- D1 region: APAC
- Command path:
wrangler d1 execute <DB_NAME> --remote --file ./d1_file_select_probe.sql --yes
The SQL file is tiny, for example:
SELECT 5;
Bug
After enabling or disabling D1 Read Replication, wrangler d1 execute --remote --file becomes unstable even for tiny SQL files.
This command uses the D1 Import API (/import), not the normal query API (/query). The same database can still run small SQL through --command, which uses /query.
The failure appears to affect the new import/upload path. When the same file is retried and Wrangler prints:
File already uploaded. Processing.
that cached-etag path is not affected and still succeeds. Therefore, a successful retry with the same file does not prove that the fresh upload/init path has recovered.
Actual Results
| UTC time | DB | Import stage | Result |
|---|---|---|---|
| 2026-04-26T10:54:49Z | main DB | first /import request |
60s later: 504 / 7009 |
| 2026-04-26T11:08:12Z | main DB | first /import request |
60s later: 504 / 7009 |
| 2026-04-26T11:17:52Z | main DB | first /import returned 200, second /import timed out |
504 / 7009 |
| 2026-04-26T11:21:19Z | probe DB | two /import requests returned 200 |
Import API body error: Network connection lost. |
Example errors:
Upstream service unavailable [code: 7009]
✘ [ERROR] Network connection lost.
Expected
wrangler d1 execute --remote --file should reliably process tiny SQL files, or return a clear actionable error if D1 Import API is incompatible with recent Read Replication state changes.
Notes
This does not look like a SQL size/content issue. The failing files contain only SELECT N;.
I searched existing public issues/discussions and did not find the same Read Replication + D1 Import API report.
Could the D1 team confirm whether Import API has any known interaction with Read Replication enable/disable transitions?
I can provide private details if needed:
- account ID
- database IDs
- exact UTC timestamps
- sanitized Wrangler debug logs
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.