cloudflare / cloudflare/developer-platform

D1 Import API becomes unstable after toggling Read Replication

Offen
#56 2 Kommentare 0 Reaktionen 2 zugewiesene Personen Auf GitHub ansehen

@vy-ton arbeitet bereits daran.

Seit 26.4.2026.

product:d1
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, and 4.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

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.