I'm running a application with node js (more specifically express js) and I save some datas with a mysql client.
It perfectly works for some time with no issue but then all of suddden I get these erros:
Trace: Cannot enqueue Quit after fatal error.
at Protocol._validateEnqueue (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\protocol\Protocol.js:218:11)
at Protocol._enqueue (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\protocol\Protocol.js:135:13)
at Protocol.quit (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\protocol\Protocol.js:88:23)
at PoolConnection.end (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\Connection.js:255:18)
at Pool._purgeConnection (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\Pool.js:259:16)
at PoolConnection._removeFromPool (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\PoolConnection.js:70:8)
at PoolConnection. (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\PoolConnection.js:29:12)
at emitOne (events.js:77:13)
at PoolConnection.emit (events.js:169:7)
at PoolConnection.Connection._handleProtocolError (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\Connection.js:439:8)
Trace: Cannot enqueue Query after fatal error.
at Protocol._validateEnqueue (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\protocol\Protocol.js:218:11)
at Protocol._enqueue (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\protocol\Protocol.js:135:13)
at PoolConnection.query (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\Connection.js:214:25)
at Object.fetchDatas (C:\nodejs\twelve-coiffure\public\javascripts\twelvebase.js:94:12)
at C:\nodejs\twelve-coiffure\routes\index.js:7:7
at Layer.handle [as handle_request] (C:\nodejs\twelve-coiffure\node_modules\express\lib\router\layer.js:95:5)
at next (C:\nodejs\twelve-coiffure\node_modules\express\lib\router\route.js:131:13)
at Route.dispatch (C:\nodejs\twelve-coiffure\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (C:\nodejs\twelve-coiffure\node_modules\express\lib\router\layer.js:95:5)
at C:\nodejs\twelve-coiffure\node_modules\express\lib\router\index.js:277:22
C:\nodejs\twelve-coiffure\public\javascripts\twelvebase.js:26
throw(message);
^
Error: Cannot enqueue Query after fatal error.
at Protocol._validateEnqueue (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\protocol\Protocol.js:199:16)
at Protocol._enqueue (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\protocol\Protocol.js:135:13)
at PoolConnection.query (C:\nodejs\twelve-coiffure\node_modules\mysql\lib\Connection.js:214:25)
at Object.fetchDatas (C:\nodejs\twelve-coiffure\public\javascripts\twelvebase.js:94:12)
at C:\nodejs\twelve-coiffure\routes\index.js:7:7
at Layer.handle [as handle_request] (C:\nodejs\twelve-coiffure\node_modules\express\lib\router\layer.js:95:5)
at next (C:\nodejs\twelve-coiffure\node_modules\express\lib\router\route.js:131:13)
at Route.dispatch (C:\nodejs\twelve-coiffure\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (C:\nodejs\twelve-coiffure\node_modules\express\lib\router\layer.js:95:5)
at C:\nodejs\twelve-coiffure\node_modules\express\lib\router\index.js:277:22
The problem is that I really can't find where the issue comes from in my code, and I don't even know why sometimes in works and sometimes not.
Here is my code to start the database:
Of course I'm calling fetchDatas() from another file to get all the datas to display.
I'm really lost and have been looking for a solution for more than 4 hours on every existing forum.. Please help me and thank you by advance.