Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG:Sentry: Capturing exception TypeError: Cannot read properties of undefined (reading 'forEach') #7636

Open
lengsukq opened this issue Dec 27, 2024 · 0 comments
Labels
bug Something that isn't working

Comments

@lengsukq
Copy link

lengsukq commented Dec 27, 2024

Which Cloudflare product(s) does this pertain to?

D1

What versions are you using?

wrangler 3.60.3;nodejs v20.12.0

What operating system and version are you using?

win11

Please provide a link to a minimal reproduction

No response

Describe the Bug

执行下面的命令报错

npx wrangler d1 execute prod-d1-tutorial --remote --file=./schema.sql 

不知道为什么报错,sql语句也没问题,js代码也没错误
执行本地命令就可以,没有报错

npx wrangler d1 execute prod-d1-tutorial --local --file=./schema.sql
DROP TABLE IF EXISTS weblist;
DROP TABLE IF EXISTS GiftRecords;
DROP TABLE IF EXISTS Gifts;

CREATE TABLE weblist (
    web_id INTEGER PRIMARY KEY AUTOINCREMENT,
    update_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    ipv4_address TEXT,
    ipv6_address TEXT,
    web_name TEXT,
    web_key TEXT NOT NULL UNIQUE,
    web_image TEXT,
    cf_address TEXT,
    is_enabled BOOLEAN DEFAULT TRUE,
    is_admin BOOLEAN DEFAULT FALSE
);

CREATE TABLE GiftRecords (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    person TEXT NOT NULL,
    redPacket INTEGER NOT NULL,
    period TEXT NOT NULL,
    update_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE Gifts (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    recordId INTEGER NOT NULL,
    name TEXT NOT NULL,
    quantity INTEGER NOT NULL,
    FOREIGN KEY (recordId) REFERENCES GiftRecords(id) ON DELETE CASCADE
);

Please provide any relevant error logs

--- 2024-12-27T00:46:35.431Z debug
🪵 Writing logs to "C:\Users\lengsukq\AppData\Roaming\xdg.config.wrangler\logs\wrangler-2024-12-27_00-46-35_051.log"

--- 2024-12-27T00:46:35.431Z debug
Failed to load .env file ".env": Error: ENOENT: no such file or directory, open 'C:\Users\lengsukq\WebstormProjects\lengsukq\d1-tutorial.env'
at Object.openSync (node:fs:582:18)
at Object.readFileSync (node:fs:461:35)
at tryLoadDotEnv (C:\Users\lengsukq\WebstormProjects\lengsukq\d1-tutorial\node_modules\wrangler\wrangler-dist\cli.js:159136:72)
at loadDotEnv (C:\Users\lengsukq\WebstormProjects\lengsukq\d1-tutorial\node_modules\wrangler\wrangler-dist\cli.js:159145:12)
at C:\Users\lengsukq\WebstormProjects\lengsukq\d1-tutorial\node_modules\wrangler\wrangler-dist\cli.js:201298:20
at C:\Users\lengsukq\WebstormProjects\lengsukq\d1-tutorial\node_modules\wrangler\wrangler-dist\cli.js:166093:16
at maybeAsyncResult (C:\Users\lengsukq\WebstormProjects\lengsukq\d1-tutorial\node_modules\wrangler\wrangler-dist\cli.js:164314:44)
at C:\Users\lengsukq\WebstormProjects\lengsukq\d1-tutorial\node_modules\wrangler\wrangler-dist\cli.js:166092:14
at C:\Users\lengsukq\WebstormProjects\lengsukq\d1-tutorial\node_modules\wrangler\wrangler-dist\cli.js:164301:22
at Array.reduce () {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\Users\lengsukq\WebstormProjects\lengsukq\d1-tutorial\.env'
}

--- 2024-12-27T00:46:35.448Z log

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


--- 2024-12-27T00:46:51.668Z debug
Retrieving cached values for account from node_modules.cache\wrangler

--- 2024-12-27T00:46:51.668Z log
🌀 Executing on remote database prod-d1-tutorial (81a9fd4a-c4b0-4053-96d4-5105424ce3b2):

--- 2024-12-27T00:46:51.669Z log
🌀 To execute on your local development database, remove the --remote flag from your wrangler command.

--- 2024-12-27T00:46:51.685Z log
�[90mNote: if the execution fails to complete, your DB will return to its original state and you can safely retry.�[39m

--- 2024-12-27T00:46:51.688Z debug
-- START CF API REQUEST: POST https://api.cloudflare.com/client/v4/accounts/7294a6404030118e6c076f9046c341e4/d1/database/81a9fd4a-c4b0-4053-96d4-5105424ce3b2/import

--- 2024-12-27T00:46:51.689Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data

--- 2024-12-27T00:46:51.689Z debug
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data

--- 2024-12-27T00:46:51.689Z debug
-- END CF API REQUEST

--- 2024-12-27T00:46:53.839Z debug
-- START CF API RESPONSE: OK 200

--- 2024-12-27T00:46:53.840Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data

--- 2024-12-27T00:46:53.840Z debug
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data

--- 2024-12-27T00:46:53.840Z debug
-- END CF API RESPONSE

--- 2024-12-27T00:46:53.841Z log
🌀 File already uploaded. Processing.

--- 2024-12-27T00:46:53.843Z log


--- 2024-12-27T00:46:54.085Z error
�[31mX �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCannot read properties of undefined (reading 'forEach')�[0m


--- 2024-12-27T00:46:54.086Z log
�[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose�[0m

--- 2024-12-27T00:46:54.086Z log
Note that there is a newer version of Wrangler available (3.99.0). Consider checking whether upgrading resolves this error.

--- 2024-12-27T00:48:52.975Z debug
Sentry: Capturing exception TypeError: Cannot read properties of undefined (reading 'forEach')

@lengsukq lengsukq added the bug Something that isn't working label Dec 27, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Status: Untriaged
Development

No branches or pull requests

1 participant