got: RequestError: read ECONNRESET in new version of got
Describe the bug
- Node.js version: v12.13.0
- OS & version: Linux
Actual behavior
Got throw a ReuestError in request in latest version.
GotError: read ECONNRESET
at onError (/home/fengkx/project/NodeRSSBot/node_modules/got/dist/source/request-as-event-emitter.js:138:29)
at handleRequest (/home/fengkx/project/NodeRSSBot/node_modules/got/dist/source/request-as-event-emitter.js:171:17)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at TLSWrap.onStreamRead (internal/stream_base_commons.js:201:27)
Expected behavior
request success and no throw happen
Code to reproduce
This error is thrown when I use got in NodeRSSBot. for example https://github.com/fengkx/NodeRSSBot/blob/master/middlewares/test-url.js#L17
I am sorry I cannot provide a simple code to reproduce the problem.
I try to extract out the logic to a simple script. But the error just disappear when I do this. But I can reproduce the problem every single time my bot try to make a request in both my laptop and VPS.
I am pretty sure I have read the release not of version 10 and made the migration to my code. And I try using const got = require('got')
directly rather than make my instance using got.extend
too.
Try to narrow down the problem
This problem didn’t show up in version 9.6.0
So I try to narrow down the problem a bit. I installed several versions of got from 9.6.0
to 10.0.3
. And find that the problem start to show up in version 10.0.0-beta.1
Then I try to compile got commit by commit and find the problem start to show up from 518f0f5
But I can’t figure out what’s going on. Any idea?
full err that I caught: https://paste.ubuntu.com/p/YxBxFpg7Bc/ Hope to help😓
Checklist
- I have read the documentation.
- I have tried my code with the latest version of Node.js and Got.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (8 by maintainers)
I have already pasted the full error I caught in ubuntu pastebin above. It is JSON serialized. The
console.log
version oferr.options
below. In fact my code is using the default instanceconst got = require('got')
and pass no optiongot.get(URL_STRING)