René's URL Explorer Experiment


Title: ERR_STREAM_PREMATURE_CLOSE after a complete chunked response when a keep-alive socket is destroyed (regression, 24.9–24.17 and 26.x) · Issue #64098 · nodejs/node · GitHub

Open Graph Title: ERR_STREAM_PREMATURE_CLOSE after a complete chunked response when a keep-alive socket is destroyed (regression, 24.9–24.17 and 26.x) · Issue #64098 · nodejs/node

X Title: ERR_STREAM_PREMATURE_CLOSE after a complete chunked response when a keep-alive socket is destroyed (regression, 24.9–24.17 and 26.x) · Issue #64098 · nodejs/node

Description: When an HTTP/1.1 server sends a complete response over a keep-alive connection and then abruptly destroys/resets the socket (instead of a graceful FIN), readers that wrap the response body in a stream-completion check (e.g. node-fetch@2)...

Open Graph Description: When an HTTP/1.1 server sends a complete response over a keep-alive connection and then abruptly destroys/resets the socket (instead of a graceful FIN), readers that wrap the response body in a str...

X Description: When an HTTP/1.1 server sends a complete response over a keep-alive connection and then abruptly destroys/resets the socket (instead of a graceful FIN), readers that wrap the response body in a str...

Opengraph URL: https://github.com/nodejs/node/issues/64098

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ERR_STREAM_PREMATURE_CLOSE after a complete chunked response when a keep-alive socket is destroyed (regression, 24.9–24.17 and 26.x)","articleBody":"When an HTTP/1.1 server sends a **complete** response over a keep-alive connection\nand then **abruptly destroys/resets the socket** (instead of a graceful FIN), readers\nthat wrap the response body in a stream-completion check (e.g. `node-fetch@2`) now\nreceive `ERR_STREAM_PREMATURE_CLOSE` — even though the full body was already delivered.\n\nThis is a regression that toggles across releases:\n\n| Node | result |\n|------|--------|\n| 24.0.0, 24.4.0, 24.8.0 | OK |\n| 24.17.0 (latest 24 LTS) | **ERR_STREAM_PREMATURE_CLOSE** |\n| 25.9.0 | OK (fixed on the 25 line) |\n| 26.3.1 (current) | **ERR_STREAM_PREMATURE_CLOSE** (re-regressed) |\n\nThe fix on the 25 line was apparently not backported to 24 LTS and has regressed in 26.\n\nIt reproduces in any environment (bare metal, plain Docker, `--network none` if deps are\npre-installed) — it is purely loopback (`127.0.0.1`), no external services involved.\n\n# Repro\n\nSee also [gist](https://gist.github.com/instilled/f9025ed03dc158a93028a593aa87b970).\n\n```js\n// repro.mjs  —  npm i node-fetch@2 && node repro.mjs\nimport net from \"node:net\";\nimport fetch from \"node-fetch\";\nimport { Agent } from \"node:http\";\n\nconst payload = JSON.stringify({ ok: true });\nconst hex = Buffer.byteLength(payload).toString(16);\n\nconst server = net.createServer((sock) => {\n  sock.on(\"error\", () => {});\n  sock.once(\"data\", () => {\n    // Complete chunked response (terminating 0-chunk present)...\n    sock.write(\n      `HTTP/1.1 200 OK\\r\\nContent-Type: application/json\\r\\n` +\n      `Transfer-Encoding: chunked\\r\\nConnection: keep-alive\\r\\n\\r\\n` +\n      `${hex}\\r\\n${payload}\\r\\n0\\r\\n\\r\\n`\n    );\n    // ...then abruptly destroy the keep-alive socket (as some front-ends do).\n    sock.destroy();\n  });\n});\n\nserver.listen(0, async () => {\n  const { port } = server.address();\n  const agent = new Agent({ keepAlive: true });\n  try {\n    const r = await fetch(`http://127.0.0.1:${port}/`, { method: \"POST\", body: \"x\", agent });\n    console.log(\"OK\", r.status, await r.text());\n  } catch (e) {\n    console.log(\"ERR\", e.code || e.message); // ERR_STREAM_PREMATURE_CLOSE on affected versions\n  } finally {\n    agent.destroy();\n    server.close();\n  }\n});\n```\n\nRun across versions, e.g.:\n\n```\nfor v in 24.8.0 24.17.0 25.9.0 26.3.1; do\n  echo \"== node:$v ==\"\n  docker run --rm node:$v-slim bash -c \\\n    'cd /tmp && npm init -y >/dev/null && npm i node-fetch@2 >/dev/null && node -e \"...\"'  # or copy repro.mjs in\ndone\n```\n\n# Expected\n\nA response whose body is fully and correctly framed (complete chunked encoding with the\nterminating `0\\r\\n\\r\\n`) should resolve successfully. A subsequent abrupt socket close on a\nkeep-alive connection — after the response is complete — must not surface as a premature\nclose of the (already finished) body stream.\n\n# Actual\n\n`ERR_STREAM_PREMATURE_CLOSE` is raised on Node 24.9–24.17 and 26.x. The same code works on\n24.0–24.8 and 25.9.\n\n# Notes\n\n- `keepAlive: false` (or a graceful FIN via `socket.end()`) avoids it.\n- `node-fetch@2` is in maintenance, but it is unchanged across these runs — only the Node\n  version differs — so the behavior change is on the Node side.\n","author":{"url":"https://github.com/instilled","@type":"Person","name":"instilled"},"datePublished":"2026-06-23T18:35:25Z","url":"https://github.com/nodejs/node/issues/64098"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:04ab01be-9e0f-d297-5eac-359da840433a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDC58:1ADDB0:2B22CF5:36A186E:6B037132
html-safe-nonce82b4fea5ed5430d68c80c6a63e2bbd6f51fe83ce1ee8567c267bff07b0b9aae3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzU4OjFBRERCMDoyQjIyQ0Y1OjM2QTE4NkU6NkIwMzcxMzIiLCJ2aXNpdG9yX2lkIjoiNjQ4NDg0MTI3MjI3OTUyNzczMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8b6afd38608618798ad78d4d89642334743f87f25f1d7e59c7e644a7ef87f30d
hovercard-subject-tagissue:4728549003
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/64098/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8d5d4d7a85eb9e641b961c2411e2a953f49d55187c660d9ff8b5661ec9825f6e/nodejs/node/issues/64098
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8d5d4d7a85eb9e641b961c2411e2a953f49d55187c660d9ff8b5661ec9825f6e/nodejs/node/issues/64098
og:image:altWhen an HTTP/1.1 server sends a complete response over a keep-alive connection and then abruptly destroys/resets the socket (instead of a graceful FIN), readers that wrap the response body in a str...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameinstilled
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/64098#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F64098
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F64098
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/64098
Reloadhttps://github.com/nodejs/node/issues/64098
Reloadhttps://github.com/nodejs/node/issues/64098
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues639 (639)https://github.com/nodejs/node/issues
Pull requests667 (667)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/insights
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/64098
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/64098
ERR_STREAM_PREMATURE_CLOSE after a complete chunked response when a keep-alive socket is destroyed (regression, 24.9–24.17 and 26.x)https://github.com/nodejs/node/issues/64098#top
https://github.com/instilled
instilledhttps://github.com/instilled
on Jun 23, 2026https://github.com/nodejs/node/issues/64098#issue-4728549003
gisthttps://gist.github.com/instilled/f9025ed03dc158a93028a593aa87b970
https://github.com/etiennechabert
etiennechaberthttps://github.com/etiennechabert
on Jun 23, 2026https://github.com/nodejs/node/issues/64098#issuecomment-4782483033
#63989https://github.com/nodejs/node/issues/63989
https://github.com/Renegade334
Renegade334https://github.com/Renegade334
on Jun 23, 2026https://github.com/nodejs/node/issues/64098#issuecomment-4782697275
Renegade334https://github.com/Renegade334
duplicatehttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Aduplicate
http: node-fetch throws ERR_STREAM_PREMATURE_CLOSE on keep-alive socket closures after latest security releases #63989https://github.com/nodejs/node/issues/63989
on Jun 23, 2026https://github.com/nodejs/node/issues/64098#event-27110845596
https://github.com/instilled
instilledhttps://github.com/instilled
on Jun 23, 2026https://github.com/nodejs/node/issues/64098#issuecomment-4782952843
#63989https://github.com/nodejs/node/issues/63989
charlesBochethttps://github.com/charlesBochet
on Jul 8, 2026https://github.com/nodejs/node/issues/64098#event-27723917473
fix(docker): bump node base to 24.18.0 (all 24.17.0 CVE fixes + http.…https://github.com/twentyhq/twenty/commit/89b6037db2d58a7bf377596488883bac64846741
89b6037https://github.com/twentyhq/twenty/commit/89b6037db2d58a7bf377596488883bac64846741
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/64098
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/64098
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.