You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get an ECONNRESET error message when trying to run any of the examples in txwrapper-core.
More specifically while having a local node running, I go in packages/txwrapper-examples folder and I run :
yarn run polkadot
or yarn run multisig
and I get the error
FetchError: request to http://0.0.0.0:9933/ failed, reason: read ECONNRESET
at ClientRequest.<anonymous> (/Volumes/T7/Parity/txwrapper-core/node_modules/node-fetch/lib/index.js:1491:11)
at ClientRequest.emit (node:events:512:28)
at Socket.socketErrorListener (node:_http_client:496:9)
at Socket.emit (node:events:512:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: 'system',
errno: 'ECONNRESET',
code: 'ECONNRESET'
}
I did quite some research to check if it is related to nodejs or node-fetch or http but I could not find something that solved my problem.
I run with NODE_DEBUG=net so I can get more details on what is happening. So I run NODE_DEBUG=net yarn run polkadot and the result was
NET 14398: createConnection [
[Object: null prototype] {
protocol: 'http:',
slashes: true,
auth: null,
host: '0.0.0.0',
port: '9933',
hostname: '0.0.0.0',
hash: null,
search: null,
query: null,
pathname: '/',
path: null,
href: 'http://0.0.0.0:9933/',
method: 'POST',
headers: [Object: null prototype] {
'Content-Type': [Array],
Accept: [Array],
'Content-Length': [Array],
'User-Agent': [Array],
'Accept-Encoding': [Array],
Connection: [Array]
},
agent: undefined,
keepAlive: true,
scheduling: 'lifo',
timeout: 5000,
noDelay: true,
servername: '',
_agentKey: '0.0.0.0:9933:',
encoding: null,
keepAliveInitialDelay: 1000
},
[Function (anonymous)],
[Symbol(normalizedArgs)]: true
]
NET 14398: pipe false null
NET 14398: _read
NET 14398: _read wait for connection
NET 14398: afterConnect
NET 14398: _read
NET 14398: Socket._handle.readStart
NET 14398: _read
NET 14398: destroy
NET 14398: close
NET 14398: close handle
FetchError: request to http://0.0.0.0:9933/ failed, reason: read ECONNRESET
at ClientRequest.<anonymous> (/Volumes/T7/Parity/txwrapper-core/node_modules/node-fetch/lib/index.js:1491:11)
at ClientRequest.emit (node:events:512:28)
at Socket.socketErrorListener (node:_http_client:496:9)
at Socket.emit (node:events:512:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: 'system',
errno: 'ECONNRESET',
code: 'ECONNRESET'
}
While trying to debug and fix my issue I run into different posts the mention that ECONNRESET errors are related to :
socket hang up errors
when a socket was closed but did not receive any response
ECONNRESET (Connection reset by peer): A connection was forcibly closed by a peer. This normally results from a loss of the connection on the remote socket due to a timeout or reboot. Commonly encountered via the http and net modules.
in the headers in the util.ts I did not get any ECONNRESET errors and all the examples worked smoothly.
The text was updated successfully, but these errors were encountered:
Imod7
changed the title
Adding connection keep-alive solved ECONNRESET error
Getting ECONNRESET errors while trying to run the examples
Feb 23, 2023
Imod7
changed the title
Getting ECONNRESET errors while trying to run the examples
Getting an ECONNRESET error while trying to run the examples
Feb 23, 2023
I get an
ECONNRESET
error message when trying to run any of the examples in txwrapper-core.More specifically while having a local node running, I go in
packages/txwrapper-examples
folder and I run :yarn run polkadot
or
yarn run multisig
and I get the error
I did quite some research to check if it is related to
nodejs
ornode-fetch
orhttp
but I could not find something that solved my problem.I run with
NODE_DEBUG=net
so I can get more details on what is happening. So I runNODE_DEBUG=net yarn run polkadot
and the result wasWhile trying to debug and fix my issue I run into different posts the mention that
ECONNRESET
errors are related to :keepAliveTimeout
settingBased on some of the resources I found :
I started looking on how to keep the connection open when doing the request through
fetch
and I found this exampleSolution
So as soon as I added the line
in the headers in the util.ts I did not get any
ECONNRESET
errors and all the examples worked smoothly.The text was updated successfully, but these errors were encountered: