Skip to content

🐛 BUG: d1 reserved key words fail on export but not migrations #8377

Open
@jiangsi

Description

@jiangsi

Which Cloudflare product(s) does this pertain to?

D1

What versions are you using?

3.113.0

What operating system and version are you using?

ubuntu

Please provide a link to a minimal reproduction

No response

Describe the Bug

If the data table has reserved words such as group and order, there was no problem when I created the application to d1 before, but an error would be reported when exporting, and the db would be loaded in the console all the time, and other operations could not be performed.

wrangler d1 export mydb --remote --output ./backup/20250306.sql

⛅️ wrangler 3.112.0 (update available 3.113.0)

🌀 Executing on remote database mydb (1bad90ef-990b-4ad1-908b-4bddd1f3ffd9):

✘ [ERROR] near "group": syntax error at offset 74: SQLITE_ERROR

If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose
Note that there is a newer version of Wrangler available (3.113.0). Consider checking whether upgrading resolves this error.
✖ Would you like to report this error to Cloudflare? Wrangler's output and the error details will be shared with the Wrangler team to help us diagnose and fix the issue. … yes

Please provide any relevant error logs

--- 2025-03-06T14:21:55.124Z debug
🪵 Writing logs to "/root/.wrangler/logs/wrangler-2025-03-06_14-21-54_939.log"

--- 2025-03-06T14:21:55.124Z debug
Metrics dispatcher: Dispatching disabled - would have sent {"deviceId":"d44bd0f4-5a37-4f7c-bd6a-c98b02150bdd","event":"wrangler command started","timestamp":1741270915123,"properties":{"amplitude_session_id":1741270915121,"amplitude_event_id":0,"wranglerVersion":"3.112.0","osPlatform":"Linux","osVersion":"#45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024","nodeVersion":22,"isFirstUsage":false,"configFileType":"toml","isCI":false,"isPagesCI":false,"isWorkersCI":false,"isInteractive":true,"hasAssets":true,"argsUsed":["output","remote"],"argsCombination":"output, remote","command":"wrangler d1 export","args":{"remote":true,"output":"","xJsonConfig":true,"j":true,"schema":true,"data":true,"name":""}}}.

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

--- 2025-03-06T14:21:56.010Z log

⛅️ wrangler 3.112.0 (update available �[32m3.113.0�[39m)
�[38;2;255;136;0m---------------------------------------------------------�[39m


--- 2025-03-06T14:21:56.016Z debug
No experimental flag store instantiated

--- 2025-03-06T14:21:56.016Z debug
Attempted to use flag "RESOURCES_PROVISION" which has not been instantiated

--- 2025-03-06T14:21:56.016Z debug
No experimental flag store instantiated

--- 2025-03-06T14:21:56.016Z debug
Attempted to use flag "RESOURCES_PROVISION" which has not been instantiated

--- 2025-03-06T14:21:56.016Z debug
No experimental flag store instantiated

--- 2025-03-06T14:21:56.017Z debug
Attempted to use flag "RESOURCES_PROVISION" which has not been instantiated

--- 2025-03-06T14:21:56.017Z debug
No experimental flag store instantiated

--- 2025-03-06T14:21:56.017Z debug
Attempted to use flag "RESOURCES_PROVISION" which has not been instantiated

--- 2025-03-06T14:21:56.017Z debug
No experimental flag store instantiated

--- 2025-03-06T14:21:56.017Z debug
Attempted to use flag "RESOURCES_PROVISION" which has not been instantiated

--- 2025-03-06T14:21:56.020Z debug
Checking if domain has Access enabled: dash.cloudflare.com

--- 2025-03-06T14:21:56.020Z debug
Access switch not cached for: dash.cloudflare.com

--- 2025-03-06T14:21:56.112Z debug
Caching access switch for: dash.cloudflare.com

--- 2025-03-06T14:21:56.273Z debug
Retrieving cached values for account from node_modules/.cache/wrangler

--- 2025-03-06T14:21:56.273Z log
🌀 Executing on remote database mydb (1bad90ef-990b-4ad1-908b-4bddd1f3ffd9):

--- 2025-03-06T14:21:56.274Z debug
-- START CF API REQUEST: POST https://api.cloudflare.com/client/v4/accounts/8863216c46bc0b22436dac7ad793a08f/d1/database/1bad90ef-990b-4ad1-908b-4bddd1f3ffd9/export

--- 2025-03-06T14:21:56.275Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data

--- 2025-03-06T14:21:56.275Z debug
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data

--- 2025-03-06T14:21:56.275Z debug
-- END CF API REQUEST

--- 2025-03-06T14:21:59.246Z debug
-- START CF API RESPONSE: OK 200

--- 2025-03-06T14:21:59.247Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data

--- 2025-03-06T14:21:59.247Z debug
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data

--- 2025-03-06T14:21:59.247Z debug
-- END CF API RESPONSE

--- 2025-03-06T14:21:59.250Z log


--- 2025-03-06T14:21:59.309Z error
�[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mnear "group": syntax error at offset 74: SQLITE_ERROR�[0m


--- 2025-03-06T14:21:59.310Z debug
Error: near "group": syntax error at offset 74: SQLITE_ERROR
at pollExport (/root/.local/share/fnm/node-versions/v22.7.0/installation/lib/node_modules/wrangler/wrangler-dist/cli.js:118438:11)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async spinnerWhile (/root/.local/share/fnm/node-versions/v22.7.0/installation/lib/node_modules/wrangler/wrangler-dist/cli.js:90155:20)
at async exportRemotely (/root/.local/share/fnm/node-versions/v22.7.0/installation/lib/node_modules/wrangler/wrangler-dist/cli.js:118393:25)
at async Object.Handler [as handler] (/root/.local/share/fnm/node-versions/v22.7.0/installation/lib/node_modules/wrangler/wrangler-dist/cli.js:118337:12)

--- 2025-03-06T14:21:59.310Z log
�[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose�[0m

--- 2025-03-06T14:21:59.310Z log
Note that there is a newer version of Wrangler available (3.113.0). Consider checking whether upgrading resolves this error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting reporter responseNeeds clarification or followup from OPbugSomething that isn't workingd1Relating to D1

    Type

    No type

    Projects

    • Status

      Untriaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions