Cyan
Cyan3w ago

Error sending request too quick to npm

I'm trying to make create a mirror for about 2000 packages in npm. For each package, it fetches https://registry.npmjs.org/<package> and the downloads (https://api.npmjs.org/downloads/point/last-month/<package>) with Promise.all() But there is a few errors while fetching.
Error: connection error received: not a result of an error
at mainFetch (ext:deno_fetch/26_fetch.js:182:43)
at eventLoopTick (ext:core/01_core.js:164:35)
at async fetch (ext:deno_fetch/26_fetch.js:392:7)
Error: connection error received: not a result of an error
at mainFetch (ext:deno_fetch/26_fetch.js:182:43)
at eventLoopTick (ext:core/01_core.js:164:35)
at async fetch (ext:deno_fetch/26_fetch.js:392:7)
TypeError: error sending request from ***.***.***.***:38254 for https://api.npmjs.org/downloads/point/last-month/koishi-plugin-qsign (104.16.0.35:443): client error (SendRequest): http2 error: connection error received: not a result of an error
at mainFetch (ext:deno_fetch/26_fetch.js:182:11)
at eventLoopTick (ext:core/01_core.js:164:35)
at async fetch (ext:deno_fetch/26_fetch.js:392:7)
TypeError: error sending request from ***.***.***.***:38254 for https://api.npmjs.org/downloads/point/last-month/koishi-plugin-qsign (104.16.0.35:443): client error (SendRequest): http2 error: connection error received: not a result of an error
at mainFetch (ext:deno_fetch/26_fetch.js:182:11)
at eventLoopTick (ext:core/01_core.js:164:35)
at async fetch (ext:deno_fetch/26_fetch.js:392:7)
4 Replies
Leokuma
Leokuma3w ago
Maybe 2k requests in paralell is too much for Deno to handle? You could try to fetch 100 at a time Anyway, the error msg you're getting could be more clear
Cyan
CyanOP3w ago
I already limited that only 30 requests can be made in 1 second.
Cyan
CyanOP7d ago
GitHub
not a result of an error when fetching same site fast · Issue #2733...
Version: Deno 2.1.2 I'm trying to make create a mirror for about 2000 packages in npm. For each package, it fetches https://registry.npmjs.org/<package> and the downloads (https://api.npm...
Cyan
CyanOP7d ago
GitHub
fix(ext/fetch): retry some http/2 errors (#27417) · denoland/deno@b...
This brings some of the HTTP/2 retry behavior from reqwest to ext/fetch. It will retry very specific HTTP/2 errors once, if the body is able to be used again. Closes #27332

Did you find this page helpful?