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

QueryFailedError: read ECONNRESET #10872

Closed
1 of 18 tasks
asijoumi opened this issue May 2, 2024 · 7 comments
Closed
1 of 18 tasks

QueryFailedError: read ECONNRESET #10872

asijoumi opened this issue May 2, 2024 · 7 comments

Comments

@asijoumi
Copy link

asijoumi commented May 2, 2024

Issue description

The communication between the server and mysql is reseting

Expected Behavior

Hi !

I have a very strange issue. Sometimes, my connections are reseting. I don't really now if its an typeorm issue or something missing on mysql.

Actual Behavior

QueryFailedError: read ECONNRESET
    at Query.onResult (/usr/src/app/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js:165:37)
    at PoolConnection._notifyError (/usr/src/app/node_modules/mysql2/lib/connection.js:228:21)
    at PoolConnection._handleFatalError (/usr/src/app/node_modules/mysql2/lib/connection.js:183:10)
    at PoolConnection._handleNetworkError (/usr/src/app/node_modules/mysql2/lib/connection.js:196:10)
    at Socket.emit (node:events:517:28)
    at Socket.emit (node:domain:489:12)
    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)

Steps to reproduce

Don't know

My Environment

Dependency Version
Operating System
Node.js version 18.20.2
Typescript version 5.1.3
TypeORM version 0.3.20

Additional Context

No response

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, and I know how to start.

@Ginden
Copy link
Collaborator

Ginden commented May 6, 2024

As you can see in stack trace, it's likely a MySQL issue, not TypeORM one.

I can see few relatively new issues on mysql2 repo, regarding ECONNRESET - sidorares/node-mysql2#2599

Are you using version 3.3.2 or newer of mysql2?

@asijoumi
Copy link
Author

asijoumi commented May 6, 2024

Hi @Ginden,

Yes, I searched and I saw that from mysql2.

I'm currently with the version 3.9.5 of mysql.

Maybe should I downgrade it ?

@niels-van-den-broeck
Copy link

@asijoumi I created the issue on mysql2, would be nice if you could check if version 3.3.1 of mysql2 still has this issue so we can get some traction over there.

@asijoumi
Copy link
Author

asijoumi commented May 6, 2024

@niels-van-den-broeck, I will test it on my dev environment. I will keep you informed as soon as possible.

PS : I don't have this issue for my local environment, only for my dev/staging/prod ...

@asijoumi
Copy link
Author

asijoumi commented May 7, 2024

Hi @Ginden, @niels-van-den-broeck,

I have downgraded themysql2 package to version 3.3.1. Since then, over the last 24 hours, I have not encountered the previous error.

Thank you for your help 👍

@niels-van-den-broeck
Copy link

Could you comment on the mysql2 issue that you are facing the same issue perhaps? Could help identify the issue

@asijoumi
Copy link
Author

asijoumi commented May 8, 2024

Done !

Thank you, I close this issue 👍

@asijoumi asijoumi closed this as completed May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants