MySql Error Resolution in React/NodeJS App
Budget: ₹600 – ₹2,000 INR
I'm in need of some technical assistance with a MySql error that has occurred within my React/NodeJS application. The error is:
Error: Can't add new command when connection is in closed state
at PromiseConnection.execute (/var/www/html/backend/node_modules/mysql2/promise.js:112:22)
at /var/www/html/backend/apiRoutes.js:410:39
at Layer.handle [as handle_request] (/var/www/html/backend/node_modules/express/lib/router/layer.js:95:5)
at next (/var/www/html/backend/node_modules/express/lib/router/route.js:144:13)
at complete (/var/www/html/backend/node_modules/passport/lib/middleware/authenticate.js:280:13)
at /var/www/html/backend/node_modules/passport/lib/middleware/authenticate.js:287:15
at pass (/var/www/html/backend/node_modules/passport/lib/authenticator.js:446:14)
at Authenticator.transformAuthInfo (/var/www/html/backend/node_modules/passport/lib/authenticator.js:468:5)
at /var/www/html/backend/node_modules/passport/lib/middleware/authenticate.js:284:22
at req.login.req.logIn (/var/www/html/backend/node_modules/passport/lib/http/request.js:44:13) {
code: undefined,
errno: undefined,
sql: undefined,
sqlState: undefined,
sqlMessage: undefined
}
The connection keeps closing after running for several hours.
Error: Can't add new command when connection is in closed state
at PromiseConnection.execute (/var/www/html/backend/node_modules/mysql2/promise.js:112:22)
at /var/www/html/backend/apiRoutes.js:410:39
at Layer.handle [as handle_request] (/var/www/html/backend/node_modules/express/lib/router/layer.js:95:5)
at next (/var/www/html/backend/node_modules/express/lib/router/route.js:144:13)
at complete (/var/www/html/backend/node_modules/passport/lib/middleware/authenticate.js:280:13)
at /var/www/html/backend/node_modules/passport/lib/middleware/authenticate.js:287:15
at pass (/var/www/html/backend/node_modules/passport/lib/authenticator.js:446:14)
at Authenticator.transformAuthInfo (/var/www/html/backend/node_modules/passport/lib/authenticator.js:468:5)
at /var/www/html/backend/node_modules/passport/lib/middleware/authenticate.js:284:22
at req.login.req.logIn (/var/www/html/backend/node_modules/passport/lib/http/request.js:44:13) {
code: undefined,
errno: undefined,
sql: undefined,
sqlState: undefined,
sqlMessage: undefined
}
The connection keeps closing after running for several hours.