loopbackio / loopbackio/loopback-connector-mysql

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

Open
#614 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
126
Forks
181
Avg merge
4d 7h
Merged PRs (30d)
12

Description

## 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/authentication-jwt@0.15.1
+-- @loopback/authentication@11.0.1
+-- @loopback/authorization@0.15.1
+-- @loopback/boot@7.0.1
+-- @loopback/core@6.0.1
+-- @loopback/repository@7.0.1
+-- @loopback/rest-explorer@7.0.1
+-- @loopback/rest@14.0.1
+-- @loopback/service-proxy@7.0.1
+-- loopback-connector-mysql@7.0.13

## Related Issues

_See [Reporting Issues](http://loopback.io/doc/en/contrib/Reporting-issues.html) for more tips on writing good issues_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the loopback4 app request to GET /settings with loopback-connector-mysql 7.0.13 after the reported idle period, using Node 18.20.4 on Linux x64. Compare the connector behavior around the ECONNRESET and retries; done means the endpoint continues returning database data without a 500 response after extended runtime.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mysql, nodejs
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.