Skip to content
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

I get Error: read ECONNRESET at TCP.onStreamRead after some running time #614

Open
nehemiekoffi opened this issue Sep 10, 2024 · 1 comment
Labels

Comments

@nehemiekoffi
Copy link

nehemiekoffi commented Sep 10, 2024

Steps to reproduce

  • Run loopback4 app using "loopback-connector-mysql": "7.0.13"
  • All endpoints work fine
  • After some time (e.g 2 hours), try to get data from an endpoint
  • I receive error 500
    Request GET /settings failed with status code 500. Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:217:20)
  • After 3 or 4 retry, then I get a good response from the server.

Current Behavior

  • I get error 500 after some running time (e.g 2 hours) with my loopback4 app
  • But I have a loopback3 (node 14) application connected to that same database that is using loopback-connector-mysql": "^5.4.3" and I do not have such error even after 24h on running

Expected Behavior

  • I should get the response from the database without error

Link to reproduction sandbox

N/A

Additional information

node -e 'console.log(process.platform, process.arch, process.versions.node)'
linux x64 18.20.4

npm ls --prod --depth 0 | grep loopback
+-- @loopback/[email protected]
+-- @loopback/[email protected]
+-- @loopback/[email protected]
+-- @loopback/[email protected]
+-- @loopback/[email protected]
+-- @loopback/[email protected]
+-- @loopback/[email protected]
+-- @loopback/[email protected]
+-- @loopback/[email protected]
+-- [email protected]

Related Issues

See Reporting Issues for more tips on writing good issues

@AdamSmid
Copy link

I can confirm, that we are investigating similar, maybe same, issue for a few months.
Up to this date we were tweaking database to fix this problem but without success.

After some up time we are seeing this error in logs:

Request GET /v2/auction/31 failed with status code 500. Error: write ECONNRESET
    at afterWriteDispatched (node:internal/stream_base_commons:160:15)
    at writeGeneric (node:internal/stream_base_commons:151:3)
    at Socket._writeGeneric (node:net:962:11)
    at Socket._write (node:net:974:8)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)
    at Writable.write (node:internal/streams/writable:337:10)
    at PoolConnection.write (/home/node/app/node_modules/mysql2/lib/connection.js:261:32)
    at PoolConnection.writePacket (/home/node/app/node_modules/mysql2/lib/connection.js:310:12)
    at Query.start (/home/node/app/node_modules/mysql2/lib/commands/query.js:60:16)
    at Query.execute (/home/node/app/node_modules/mysql2/lib/commands/command.js:45:22)
    at PoolConnection.handlePacket (/home/node/app/node_modules/mysql2/lib/connection.js:481:34)
    at PoolConnection.addCommand (/home/node/app/node_modules/mysql2/lib/connection.js:507:12)
    at PoolConnection.query (/home/node/app/node_modules/mysql2/lib/connection.js:575:17)
    at runQuery (/home/node/app/node_modules/loopback-connector-mysql/lib/mysql.js:224:16)
    at executeWithConnection (/home/node/app/node_modules/loopback-connector-mysql/lib/mysql.js:266:7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants