cloudflare / cloudflare/developer-platform

Wrangler D1 import — succeeds as expected locally but fails on remote with useless error

Đang mở
#46 5 bình luận 1 reaction 2 người được giao Được @vy-ton nhận Xem trên GitHub
product:d1
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
1
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### What versions & operating system are you using?

Wrangler 4.19.1, macOS 15.5, node 22.14.0

### Please provide a link to a minimal reproduction

_No response_

### Describe the Bug

This is a fresh D1 database. I have a .sql file that executed just fine locally, but remotely it fails. Here's an example of back to back local and remote executions:

Image

More, the error it fails with is inconsistent. See these 3 back to back executions:

Image

### Please provide any relevant error logs

```
--- 2025-06-06T04:25:25.456Z debug
🪵 Writing logs to "/Users/arimendelow/Library/Preferences/.wrangler/logs/wrangler-2025-06-06_04-25-25_394.log"
---

--- 2025-06-06T04:25:25.456Z debug
Metrics dispatcher: Posting data {"deviceId":"4c6de644-c2d0-4592-b2d8-e65a5345e950","event":"wrangler command started","timestamp":1749183925456,"properties":{"amplitude_session_id":1749183925455,"amplitude_event_id":0,"wranglerVersion":"4.19.1","osPlatform":"Mac OS","osVersion":"Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:25 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6020","nodeVersion":22,"packageManager":"npm","isFirstUsage":false,"configFileType":"jsonc","isCI":false,"isPagesCI":false,"isWorkersCI":false,"isInteractive":true,"hasAssets":false,"argsUsed":["file","remote"],"argsCombination":"file, remote","command":"wrangler d1 execute","args":{"remote":true,"file":"","xJsonConfig":true,"j":true,"json":false,"preview":false,"database":""}}}
---

--- 2025-06-06T04:25:25.460Z debug
.env file not found at ".env". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/
---

--- 2025-06-06T04:25:25.483Z log

⛅️ wrangler 4.19.1
───────────────────
---

--- 2025-06-06T04:25:27.143Z debug
Retrieving cached values for account from node_modules/.cache/wrangler
---

--- 2025-06-06T04:25:27.143Z log
🌀 Executing on remote database mendelow-cooking (9afa5859-2d8b-4ad6-88b4-b1b676fbd305):
---

--- 2025-06-06T04:25:27.143Z log
🌀 To execute on your local development database, remove the --remote flag from your wrangler command.
---

--- 2025-06-06T04:25:27.149Z log
Note: if the execution fails to complete, your DB will return to its original state and you can safely retry.
---

--- 2025-06-06T04:25:27.150Z debug
-- START CF API REQUEST: POST https://api.cloudflare.com/client/v4/accounts/4b157323bc7b08c0f6b0dc9c23b1e2b1/d1/database/9afa5859-2d8b-4ad6-88b4-b1b676fbd305/import
---

--- 2025-06-06T04:25:27.150Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-06-06T04:25:27.150Z debug
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-06-06T04:25:27.150Z debug
-- END CF API REQUEST
---

--- 2025-06-06T04:25:28.125Z debug
-- START CF API RESPONSE: OK 200
---

--- 2025-06-06T04:25:28.126Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-06-06T04:25:28.126Z debug
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-06-06T04:25:28.126Z debug
-- END CF API RESPONSE
---

--- 2025-06-06T04:25:28.126Z log
🌀 File already uploaded. Processing.
---

--- 2025-06-06T04:25:28.128Z log

---

--- 2025-06-06T04:25:28.167Z error
✘ [ERROR] {"D1_RESET_DO":true}

---

--- 2025-06-06T04:25:28.168Z debug
Error: {"D1_RESET_DO":true}
at pollUntilComplete (/Users/arimendelow/.npm/_npx/df20c88e5822728c/node_modules/wrangler/wrangler-dist/cli.js:78258:11)
at executeRemotely (/Users/arimendelow/.npm/_npx/df20c88e5822728c/node_modules/wrangler/wrangler-dist/cli.js:78170:33)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async executeSql (/Users/arimendelow/.npm/_npx/df20c88e5822728c/node_modules/wrangler/wrangler-dist/cli.js:78022:38)
at async Object.handler (/Users/arimendelow/.npm/_npx/df20c88e5822728c/node_modules/wrangler/wrangler-dist/cli.js:78437:28)
at async Object.handler (/Users/arimendelow/.npm/_npx/df20c88e5822728c/node_modules/wrangler/wrangler-dist/cli.js:77684:7)
---

--- 2025-06-06T04:25:28.168Z log
If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose
---

--- 2025-06-06T04:25:34.358Z debug
Sentry: Capturing exception Error: {"D1_RESET_DO":true}
---

--- 2025-06-06T04:25:34.364Z debug
Metrics dispatcher: Posting data {"deviceId":"4c6de644-c2d0-4592-b2d8-e65a5345e950","event":"wrangler command errored","timestamp":1749183934364,"properties":{"amplitude_session_id":1749183925455,"amplitude_event_id":1,"wranglerVersion":"4.19.1","osPlatform":"Mac OS","osVersion":"Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:25 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6020","nodeVersion":22,"packageManager":"npm","isFirstUsage":false,"configFileType":"jsonc","isCI":false,"isPagesCI":false,"isWorkersCI":false,"isInteractive":true,"hasAssets":false,"argsUsed":["file","remote"],"argsCombination":"file, remote","command":"wrangler d1 execute","args":{"remote":true,"file":"","xJsonConfig":true,"j":true,"json":false,"preview":false,"database":""},"durationMs":8916,"durationSeconds":8.916,"durationMinutes":0.1486,"errorType":"Error"}}
---
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.