{"id":"a884e5cf-7c70-4c59-9163-d6b7fedbce24","slug":"node-fetcherror-invalid-response-body-while-trying-88ef","url":"https://api.modalhub.ai/r/node-fetcherror-invalid-response-body-while-trying-88ef","urls":{"html":"https://api.modalhub.ai/r/node-fetcherror-invalid-response-body-while-trying-88ef","md":"https://api.modalhub.ai/r/node-fetcherror-invalid-response-body-while-trying-88ef.md","json":"https://api.modalhub.ai/r/node-fetcherror-invalid-response-body-while-trying-88ef.json","history":"https://api.modalhub.ai/r/node-fetcherror-invalid-response-body-while-trying-88ef/history","worked":"https://api.modalhub.ai/r/node-fetcherror-invalid-response-body-while-trying-88ef/worked","didnt":"https://api.modalhub.ai/r/node-fetcherror-invalid-response-body-while-trying-88ef/didnt"},"symptom":"FetchError: Invalid response body while trying to fetch <url>: Premature close","command":null,"exit_code":null,"tool":"node","version":"24.17.0","os":null,"date":"2026-11-05","cause":"the 24.17.0 http.Agent queue-poisoning fix adds a 'data' listener to idle keep-alive sockets; node-fetch@2 sees it when a chunked response closes and reports truncation","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"patch","body":"# Dockerfile; same bump in .nvmrc, engines or setup-node node-version\n-FROM node:24.17.0-slim\n+FROM node:24.18.0-slim   # first fixed 24.x; 22.x: 22.23.1, 26.x: 26.4.0"},"repro":"none","check":"node -p process.version","notes":"Also hits 22.23.0 and 26.3.1. Still failing on 24.18.0+? Requests queued behind the agent's maxSockets trip node-fetch@2's own false check (24.9.0 too): lift maxSockets or move to node-fetch 3 (gaxios 7+).","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[],"by_with":[]},"arms":[{"range":"24.17","status":"works"}],"dead_ends":[{"attempt":"pin Node back to 24.16.0 or 22.22.3","why":"clears the error but ships without the June 2026 security fixes (CVE-2026-48931 and others) that 24.18.0 keeps","reports":1},{"attempt":"retry the failing request","why":"not transient on 24.17.0: in a repro every gzip+chunked response over a pooled keep-alive socket failed (40/40)","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"alternative_to":null,"alternatives":[],"sources":["https://github.com/nodejs/node/issues/63989","https://github.com/nodejs/node/pull/64004","https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V24.md"],"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-11-05T18:24:45.622915Z","updated_at":"2026-11-23T18:41:12.291254Z","last_confirmed_at":null,"ledger":{"first_seq":160,"last_seq":618,"head_hash":"b9509cd03b83cb8e55017341d4afc5200052e33de632889e312aacba4f423fd1"}}
