-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request
error read ECONNRESET
#3750
Comments
request
error read ECONNRESET
Not much we can do without some sort of reproduction. ECONNRESET issues can happen for a variety of reasons. Since you mentioned it happens regardless of the client, I suspect it is something in your application code.
Are you able to reproduce by doing something like canceling a request while it is mid-execution? |
thanks for getting back to me. i would be happy is something in my application code, at least would mean is fixable :D can it be caused by the fact that functions are exported directly and not encapsulated in an class instance? maybe is something with resuing a closed connection? const result = await TruckyHubApiService.completeJobPost(
remote_job_id as number,
data
); export default {
...
cancelJobPost,
...
}; async function completeJobPost(
job_id: number,
job: Job
): Promise<CompleteJobResponse> {
return executeRequest(
`/v1/job/${job_id}/complete`,
'POST',
job,
true
) as Promise<CompleteJobResponse>;
} do you have any suggestion to simulate the request cancelling in mid-execution? Thanks again |
We will be able to help you better if you can isolate the problem as much as you can by providing an |
No, most likely this is not the issue.
Yes, if a connection is closed, and it is being reused directly then it would result in an ECONNRESET error. Undici guards against this. Are you doing some unique with the API? |
No, all stateless requests authenticated with authorization header, nothing fancy |
Bug Description
Probably this is not even a bug but is driving me crazy and i'm asking for help (or an hug)
Context is an Electron app based on Electron 22 and Node v16, sometimes POST or PATCH requests fail with
read ECONNRESET
errorat TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
Other requets work fine, this happens for some users, mostly - for what i've seen - connected to internet with a wireless connection that probably is not really stable, but the app works totally fine and is offline tolerant, the game they are playing on has a multiplayer module that needs to be connected to internet and don't lose the connection.
Axios or undici there is no difference, for same users, fails in the same way.
Among other things, the app sends a POST request in a certain moment - and it works - after a while, for other reasons, sends other POSTS requests and these fails for ECONNRESET.
I'm asking for help to understand how debug this, find a reliable reason or eventually fix it.
I've never reproduced this situation, considering the app has thousands concurrent users, this happens to a relatively small users portion, but still, it happens.
Posted data is pretty simple:
Is something with
keepAlive
? TLS protocols? IP resolution? mixed IPV6/IPV4 network?Thaks for your help and sorry if is not related.
Reproducible By
Expected Behavior
Logs & Screenshots
Environment
Electron 22
Node 16
Windows 11 or 10
Additional context
The text was updated successfully, but these errors were encountered: