ECONNRESET from `fetch` still crashes netlify-cli
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- nodejs, typescript
- 领域
- cli
调研方向
未指定源文件或测试。使用提供的本地 reset server 重现 ECONNRESET 情况,然后跟踪 netlify-cli 的 fetch 错误处理,并为此故障添加覆盖;当 dev server 能够在不崩溃的情况下处理 reset 时即表示完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
I believe this is similar to #7747.
FetchError: request to http://localhost:8080/ failed, reason: connect ECONNRESET 127.0.0.1:8080
at ClientRequest.<anonymous> (/home/pierre/code/hello/node_modules/node-fetch/lib/index.js:1501:11)
at ClientRequest.emit (node:events:519:28)
at emitErrorEvent (node:_http_client:107:11)
at Socket.socketErrorListener (node:_http_client:574:5)
at Socket.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
System:
OS: Linux 6.17 Linux Mint 22.2 (Zara)
CPU: (8) x64 Intel(R) Xeon(R) E-2134 CPU @ 3.50GHz
Binaries:
Node: 22.21.1 - ~/.local/share/mise/installs/node/22.21.1/bin/node
Yarn: 1.22.22 - ~/.local/share/pnpm/yarn
npm: 10.9.4 - ~/.local/share/mise/installs/node/22.21.1/bin/npm
Steps to reproduce
Start a local server that will reset the connection:
python3 -c "import socket,struct; s=socket.socket(); s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1); s.bind(('0.0.0.0', 8080)); s.listen(1);
while True: c,_=s.accept(); c.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack('ii', 1, 0)); c.close()"
Test:
$ curl localhost:8080
curl: (56) Recv failure: Connection reset by peer
Have this function:
function handler(event, context, callback) {
fetch('http://localhost:8080')
.then(reponse => response.json())
.then(json => callback(null, {statusCode: 200, body: JSON.stringify({hello: 'world'}))
}
Then start the dev server with netlify-cli and get the error.
Configuration
No response
Environment
$ npx envinfo --system --binaries --npmPackages netlify-cli --npmGlobalPackages netlify-cli
sh: 1: envinfo: not found
$ npx netlify-cli --version
netlify-cli/23.15.1 linux-x64 node-v22.21.1
$ node --version
v22.21.1
- 主要语言
- TypeScript
- 星标
- 1.9k
- 派生
- 480
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 66
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
netlify/cli 的其他 Issue
-
db-status.test fails if the database is disabled可能已有人在做 @paulleephp 于 2 天前认领。 未关闭type: bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
`client-ip` is not an IP address when `x-forwarded-for` holds a list or a port可能已有人在做 @Dev-next-gen 于 23 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
`netlify dev` with `--cwd` from outside the project: every function 500s with "module is not defined in ES module scope" (`detectZisiBuilder` passes a string to `readPackageUp`)可能已有人在做 @bsplatt92 于 64 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
area: command: deploy area: docs type: feature
难度 1/5 1 小时以内 新手友好度 88/100
netlify/cli#1984 · 19 条评论 · 3 个 reaction ·
维护者通常 1 天内回复
-
type: bug
难度 4/5 3-5 天 新手友好度 20/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
diegosouzapw/OmniRoute#17386 ·
维护者通常 1 天内回复
-
ready-for-agent
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
area/dashboard kind/bug kind/bug-qa QA/dev-automation
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
vybestack/llxprt-code#3917 · 1 条评论 ·
维护者通常 1 天内回复
-
api-parity
难度 2/5 1-3 小时 新手友好度 76/100
IBM/carbon-components-ember#1157 ·
维护者通常 1 天内回复