Error in connecting to DB: Error: Handshake inactivity timeout - mysql

I am running a node.js server which is using mysql DB. I was working fine but suddenly it has started throwing following error.
Below is the stacktrace of the error:
Error in connecting to DB: Error: Handshake inactivity timeout
at Handshake.<anonymous> (/home/ubuntu/backend/node_modules/mysql/lib/protocol/Protocol.js:164:17)
at emitNone (events.js:86:13)
at Handshake.emit (events.js:185:7)
at Handshake._onTimeout (/home/ubuntu/backend/node_modules/mysql/lib/protocol/sequences/Sequence.js:129:8)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
--------------------
at Protocol._enqueue (/home/ubuntu/backend/node_modules/mysql/lib/protocol/Protocol.js:145:48)
at Protocol.handshake (/home/ubuntu/backend/node_modules/mysql/lib/protocol/Protocol.js:52:23)
at PoolConnection.connect (/home/ubuntu/backend/node_modules/mysql/lib/Connection.js:130:18)
at Pool.getConnection (/home/ubuntu/backend/node_modules/mysql/lib/Pool.js:48:16)
at /home/ubuntu/backend/followcopserver.js:232:11
at Layer.handle [as handle_request] (/home/ubuntu/backend/node_modules/express/lib/router/layer.js:95:5)
at next (/home/ubuntu/backend/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/ubuntu/backend/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/ubuntu/backend/node_modules/express/lib/router/layer.js:95:5)
at
Any help is really appreciated.

Related

Connecting to MySQL from NodeJS (Express App) throws error

edit:
Solved my problem. After removing the line
connection.connect(function(err) {
if (err) throw err;
});
I got the raw MySQL error message saying that the login credentials for MySQL are wrong. I already checked my passwort, but din't noticed the wrong username. Very sorry fr my dumb question.
I have a NodeJS / Express app. It was already working fine but know I dont'get a connection any more to MySQL (MariaDB). Always I try to start the app (with pm2) the start failed, because a exception is thrown.
I have already checked if MySQL is running and I also restarted MySQL and NodeJS app and pdated node-mysql. This is my code for connecting to mysql:
//local mysql db connection
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
password : 'xxx',
database : 'lizenzverwaltung'
});
connection.connect(function(err) {
if (err) throw err;
});
module.exports = connection;
The error message on startup is:
0|www | at Socket.<anonymous> (/var/www/html/lizenzverwaltung/node_modules/mysql/lib/Connection.js:525:10)
0|www | at Socket.emit (events.js:182:13)
0|www | at Socket.EventEmitter.emit (domain.js:442:20)
0|www | --------------------
0|www | at Protocol._enqueue (/var/www/html/lizenzverwaltung/node_modules/mysql/lib/protocol/Protocol.js:144:48)
0|www | at Protocol.handshake (/var/www/html/lizenzverwaltung/node_modules/mysql/lib/protocol/Protocol.js:51:23)
0|www | at Connection.connect (/var/www/html/lizenzverwaltung/node_modules/mysql/lib/Connection.js:119:18)
0|www | at Object.<anonymous> (/var/www/html/lizenzverwaltung/models/db.js:11:12)
0|www | at Module._compile (internal/modules/cjs/loader.js:702:30)
0|www | at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
0|www | at Module.load (internal/modules/cjs/loader.js:612:32)
0|www | at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
0|www | at Function.Module._load (internal/modules/cjs/loader.js:543:3)
0|www | at Module.require (internal/modules/cjs/loader.js:650:17)
If I comment out the line
if (err) throw err;
I can start the NodeJS app, but get the following error, as soon, as I try to run a SQL query:
0|www | at Protocol._validateEnqueue (/var/www/html/lizenzverwaltung/node_modules/mysql/lib/protocol/Protocol.js:212:16)
0|www | at Protocol._enqueue (/var/www/html/lizenzverwaltung/node_modules/mysql/lib/protocol/Protocol.js:138:13)
0|www | at Connection.query (/var/www/html/lizenzverwaltung/node_modules/mysql/lib/Connection.js:201:25)
0|www | at Function.verifyLicense [as verify] (/var/www/html/lizenzverwaltung/models/licenseModel.js:29:9)
0|www | at Function.LicenseController.veryLicense (/var/www/html/lizenzverwaltung/controllers/licenseController.js:51:18)
0|www | at /var/www/html/lizenzverwaltung/routes/license.js:33:21
0|www | at Layer.handle [as handle_request] (/var/www/html/lizenzverwaltung/node_modules/express/lib/router/layer.js:95:5)
0|www | at next (/var/www/html/lizenzverwaltung/node_modules/express/lib/router/route.js:137:13)
0|www | at Route.dispatch (/var/www/html/lizenzverwaltung/node_modules/express/lib/router/route.js:112:3)
0|www | at Layer.handle [as handle_request] (/var/www/html/lizenzverwaltung/node_modules/express/lib/router/layer.js:95:5) code: 'PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR', fatal: false }
0|www | error { Error: Cannot enqueue Query after fatal error.
0|www | at Protocol._validateEnqueue (/var/www/html/lizenzverwaltung/node_modules/mysql/lib/protocol/Protocol.js:212:16)
0|www | at Protocol._enqueue (/var/www/html/lizenzverwaltung/node_modules/mysql/lib/protocol/Protocol.js:138:13)
0|www | at Connection.query (/var/www/html/lizenzverwaltung/node_modules/mysql/lib/Connection.js:201:25)
0|www | at Function.verifyLicense [as verify] (/var/www/html/lizenzverwaltung/models/licenseModel.js:29:9)
0|www | at Function.LicenseController.veryLicense (/var/www/html/lizenzverwaltung/controllers/licenseController.js:51:18)
0|www | at /var/www/html/lizenzverwaltung/routes/license.js:33:21
0|www | at Layer.handle [as handle_request] (/var/www/html/lizenzverwaltung/node_modules/express/lib/router/layer.js:95:5)
0|www | at next (/var/www/html/lizenzverwaltung/node_modules/express/lib/router/route.js:137:13)
0|www | at Route.dispatch (/var/www/html/lizenzverwaltung/node_modules/express/lib/router/route.js:112:3)
0|www | at Layer.handle [as handle_request] (/var/www/html/lizenzverwaltung/node_modules/express/lib/router/layer.js:95:5) code: 'PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR', fatal: false } result null
0|www | POST /v1/license/verify/ 200 19.128 ms - 16
I already searched but didn't found a solution. Do you have any tips? My MySQL server should working fine, PHPMyAdmin and my Wordpress sites are running fine.
Thanks,
Klaus
Solved my problem. After removing the line
connection.connect(function(err) {
if (err) throw err;
});
I got the raw MySQL error message saying that the login credentials for MySQL are wrong. I already checked my passwort, but din't noticed the wrong username. Very sorry for my dumb question.

Bad handshake or ECONNRESET Azure Mysql Nodejs

Similar issues have been reported, but I can't work around with there solutions.
I have an express.js app using KNEX to connect to a mysql database hosted in Azure.
I can connect to the DB perfectly from console command or mysql workbench.
However, no way to achieve the same from my node app.
My connection object is the same though:
config.knex = require('knex')({
client: 'mysql',
connection: {
host: 'wineserver.mysql.database.azure.com',
user: 'BurgerAndGreenBeans#wineserver',
password: 'FromageDeChevre',
database: 'gdpr',
insecureAuth: true
},
pool: {
min: 0
},
debug: ['ComQueryPacket']
});
Everytime I start the app, I get alternatively either one error or another one:
#1
Unhandled rejection Error: read ECONNRESET
at exports._errnoException (util.js:1050:11)
at TCP.onread (net.js:582:26)
--------------------
at Protocol._enqueue (C:\Projects\gdpr\node_modules\mysql\lib\protocol\Protocol.js:141:48)
at Protocol.handshake (C:\Projects\gdpr\node_modules\mysql\lib\protocol\Protocol.js:52:41)
at Connection.connect (C:\Projects\gdpr\node_modules\mysql\lib\Connection.js:130:18)
at C:\Projects\gdpr\node_modules\knex\lib\dialects\mysql\index.js:106:18
at Promise._execute (C:\Projects\gdpr\node_modules\bluebird\js\release\debuggability.js:300:9)
at Promise._resolveFromExecutor (C:\Projects\gdpr\node_modules\bluebird\js\release\promise.js:483:18)
at new Promise (C:\Projects\gdpr\node_modules\bluebird\js\release\promise.js:79:10)
at Client_MySQL.acquireRawConnection (C:\Projects\gdpr\node_modules\knex\lib\dialects\mysql\index.js:104:12)
at Object.create (C:\Projects\gdpr\node_modules\knex\lib\client.js:239:16)
at Pool._createResource (C:\Projects\gdpr\node_modules\generic-pool\lib\generic-pool.js:354:17)
at Pool.dispense [as _dispense] (C:\Projects\gdpr\node_modules\generic-pool\lib\generic-pool.js:314:10)
at Pool.acquire (C:\Projects\gdpr\node_modules\generic-pool\lib\generic-pool.js:436:8)
at C:\Projects\gdpr\node_modules\knex\lib\client.js:289:19
at Promise._execute (C:\Projects\gdpr\node_modules\bluebird\js\release\debuggability.js:300:9)
at Promise._resolveFromExecutor (C:\Projects\gdpr\node_modules\bluebird\js\release\promise.js:483:18)
at new Promise (C:\Projects\gdpr\node_modules\bluebird\js\release\promise.js:79:10)
Process finished with exit code 0
or
#2
Unhandled rejection Error: ER_HANDSHAKE_ERROR: Bad handshake
at Handshake.Sequence._packetToError (C:\Projects\gdpr\node_modules\mysql\lib\protocol\sequences\Sequence.js:52:14)
at Handshake.ErrorPacket (C:\Projects\gdpr\node_modules\mysql\lib\protocol\sequences\Handshake.js:103:18)
at Protocol._parsePacket (C:\Projects\gdpr\node_modules\mysql\lib\protocol\Protocol.js:280:23)
at Parser.write (C:\Projects\gdpr\node_modules\mysql\lib\protocol\Parser.js:75:12)
at Protocol.write (C:\Projects\gdpr\node_modules\mysql\lib\protocol\Protocol.js:39:16)
at Socket.<anonymous> (C:\Projects\gdpr\node_modules\mysql\lib\Connection.js:103:28)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at Socket.Readable.push (_stream_readable.js:136:10)
at TCP.onread (net.js:561:20)
--------------------
at Protocol._enqueue (C:\Projects\gdpr\node_modules\mysql\lib\protocol\Protocol.js:141:48)
at Protocol.handshake (C:\Projects\gdpr\node_modules\mysql\lib\protocol\Protocol.js:52:41)
at Connection.connect (C:\Projects\gdpr\node_modules\mysql\lib\Connection.js:130:18)
at C:\Projects\gdpr\node_modules\knex\lib\dialects\mysql\index.js:106:18
at Promise._execute (C:\Projects\gdpr\node_modules\bluebird\js\release\debuggability.js:300:9)
at Promise._resolveFromExecutor (C:\Projects\gdpr\node_modules\bluebird\js\release\promise.js:483:18)
at new Promise (C:\Projects\gdpr\node_modules\bluebird\js\release\promise.js:79:10)
at Client_MySQL.acquireRawConnection (C:\Projects\gdpr\node_modules\knex\lib\dialects\mysql\index.js:104:12)
at Object.create (C:\Projects\gdpr\node_modules\knex\lib\client.js:239:16)
at Pool._createResource (C:\Projects\gdpr\node_modules\generic-pool\lib\generic-pool.js:354:17)
at Pool.dispense [as _dispense] (C:\Projects\gdpr\node_modules\generic-pool\lib\generic-pool.js:314:10)
at Pool.acquire (C:\Projects\gdpr\node_modules\generic-pool\lib\generic-pool.js:436:8)
at C:\Projects\gdpr\node_modules\knex\lib\client.js:289:19
at Promise._execute (C:\Projects\gdpr\node_modules\bluebird\js\release\debuggability.js:300:9)
at Promise._resolveFromExecutor (C:\Projects\gdpr\node_modules\bluebird\js\release\promise.js:483:18)
at new Promise (C:\Projects\gdpr\node_modules\bluebird\js\release\promise.js:79:10)
Process finished with exit code 0
It seems to be a kind of incompatibility between Node and Azure's mysql server.
Did anyone experienced the same ?
The similar question: Connecting to Azure Database for MySQL in npm/mysql. As #Gary Liu pointed out, you may use pull 1730 for a workaround.
Please modify the package.json as:
"dependencies": {
"knex": "^0.13.0",
"mysql": "git://github.com/mysqljs/mysql#e3e123e9af7c0829a6c1417d911572a75b4a5f95"
}
then, run npm install to install this version.

PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR on node.js server using mysql DB running on Ubuntu machine

I am running a server on AWS EC2 instance on ubuntu using node.js and MYSQL.It was working fine for 3 days, suddenly it stopped working.
On Googling i found that was due to lost connection in MYSQL DB. But could not find the exact cause of the fatal.
I am using following code for MYSQL connection
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
password : process.env.DB_PASSWORD
});
connection.query('USE MY_DB');
And for querying like this
app.get('/user', function(req, res){
connection.query('SELECT * FROM movie', function(err, rows){
var users = {"users" : rows};
res.send(users);
});
});
And log for the fatal:
2017-01-20T00:22:23.721Z - [31merror[39m: GET /users : Error: ER_SERVER_SHUTDOWN: Server shutdown in progress
at Query.Sequence._packetToError (/home/ubuntu/myserver/node_modules/mysql/lib/protocol/sequences/Sequence.js:52:14)
at Query.ErrorPacket (/home/ubuntu/myserver/node_modules/mysql/lib/protocol/sequences/Query.js:83:18)
at Protocol._parsePacket (/home/ubuntu/myserver/node_modules/mysql/lib/protocol/Protocol.js:280:23)
at Parser.write (/home/ubuntu/myserver/node_modules/mysql/lib/protocol/Parser.js:74:12)
at Protocol.write (/home/ubuntu/myserver/node_modules/mysql/lib/protocol/Protocol.js:39:16)
at Socket.<anonymous> (/home/ubuntu/myserver/node_modules/mysql/lib/Connection.js:109:28)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
--------------------
at Protocol._enqueue (/home/ubuntu/myserver/node_modules/mysql/lib/protocol/Protocol.js:141:48)
at Connection.query (/home/ubuntu/myserver/node_modules/mysql/lib/Connection.js:214:25)
at /home/ubuntu/myserver/myserver.js:125:14
at Layer.handle [as handle_request] (/home/ubuntu/myserver/node_modules/express/lib/router/layer.js:95:5)
at next (/home/ubuntu/myserver/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/home/ubuntu/myserver/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/ubuntu/myserver/node_modules/express/lib/router/layer.js:95:5)
at /home/ubuntu/myserver/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/home/ubuntu/myserver/node_modules/express/lib/router/index.js:330:12)
at next (/home/ubuntu/myserver/node_modules/express/lib/router/index.js:271:10)
one more log:
2017-01-20T00:22:24.189Z - [31merror[39m: deleteRecords : Error: connect ECONNREFUSED 127.0.0.1:3306
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)
--------------------
at Protocol._enqueue (/home/ubuntu/myserver/node_modules/mysql/lib/protocol/Protocol.js:141:48)
at Protocol.handshake (/home/ubuntu/myserver/node_modules/mysql/lib/protocol/Protocol.js:52:41)
at Connection.connect (/home/ubuntu/myserver/node_modules/mysql/lib/Connection.js:136:18)
at Connection._implyConnect (/home/ubuntu/myserver/node_modules/mysql/lib/Connection.js:467:10)
at Connection.query (/home/ubuntu/myserver/node_modules/mysql/lib/Connection.js:212:8)
at Object.<anonymous> (/home/ubuntu/myserver/myserver.js:21:12)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
2017-01-20T00:22:28.135Z - [31merror[39m: GET /users : Error: Cannot enqueue Query after fatal error.
at Protocol._validateEnqueue (/home/ubuntu/myserver/node_modules/mysql/lib/protocol/Protocol.js:199:16)
at Protocol._enqueue (/home/ubuntu/myserver/node_modules/mysql/lib/protocol/Protocol.js:135:13)
at Connection.query (/home/ubuntu/myserver/node_modules/mysql/lib/Connection.js:214:25)
at /home/ubuntu/myserver/myserver.js:125:14
at Layer.handle [as handle_request] (/home/ubuntu/myserver/node_modules/express/lib/router/layer.js:95:5)
at next (/home/ubuntu/myserver/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/home/ubuntu/myserver/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/ubuntu/myserver/node_modules/express/lib/router/layer.js:95:5)
at /home/ubuntu/myserver/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/home/ubuntu/myserver/node_modules/express/lib/router/index.js:330:12)
I want to know the exact issue and the solution. Any help is appreciated.

Error while performing the database query: Error: Handshake inactivity timeout

I am using mysql in Node.js 6.7.0 to get data from database
connection.query('SELECT * FROM table', function(err, results){
if(err){
console.log('Error while performing the database query:', err);
return;
}else{
console.log('Query results:', results);
}
});
I was normally opening the page (which was previously working) when I got an error:
Error while performing the database query: Error: Handshake inactivity
timeout
The server didn't stop running, I refreshed the page and everything is ok...
It never happened before, what does this mean?
This is the full error that I got in the log:
Error while performing the database query: { Error: Handshake inactivity timeout
at Handshake.<anonymous> (/Users/johndoe/myproject/node_modules/mysql/lib/protocol/Protocol.js:160:17)
at emitNone (events.js:86:13)
at Handshake.emit (events.js:185:7)
at Handshake._onTimeout (/Users/johndoe/myproject/node_modules/mysql/lib/protocol/sequences/Sequence.js:127:8)
at tryOnTimeout (timers.js:232:11)
at Timer.listOnTimeout (timers.js:202:5)
--------------------
at Protocol._enqueue (/Users/johndoe/myproject/node_modules/mysql/lib/protocol/Protocol.js:141:48)
at Protocol.handshake (/Users/johndoe/myproject/node_modules/mysql/lib/protocol/Protocol.js:52:41)
at PoolConnection.connect (/Users/johndoe/myproject/node_modules/mysql/lib/Connection.js:136:18)
at Pool.getConnection (/Users/johndoe/myproject/node_modules/mysql/lib/Pool.js:48:16)
at Pool.query (/Users/johndoe/myproject/node_modules/mysql/lib/Pool.js:200:8)
at /Users/johndoe/myproject/myscript.js:92:13
at Layer.handle [as handle_request] (/Users/johndoe/myproject/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/johndoe/myproject/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/Users/johndoe/myproject/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/johndoe/myproject/node_modules/express/lib/router/layer.js:95:5)
code: 'PROTOCOL_SEQUENCE_TIMEOUT',
fatal: true,
timeout: 10000 }

Connecting remote mysql via local machine : node expressjs

I am trying to connect to remote mysql(hosted on digitalocean server) and using the db for code in local machine.
When I start the node server and request for data, I get the following error.
{"ERRORMSG":"Something went wrong.{\"code\":\"ENOTFOUND\",\"errno\":\"ENOTFOUND\",\"syscall\":\"getaddrinfo\",\"hostname\":\"http://ip.of.remote.server/\",\"host\":\"http://ip.of.remote.server/\",\"port\":3306,\"fatal\":true}"}
After the first attempt, if I refresh again I get different error
{\"code\":\"PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR\",\"fatal\":false}
Connection is made like this:
connection = mysql.createConnection({
connectionLimit: 10000, //important
host: 'http://ip.of.remote.server/',
user: 'user',
password: 'password',
database: 'db',
multipleStatements: true,
connectionLimit : 100,
waitForConnections : true,
queueLimit :0,
debug : true,
wait_timeout : 28800,
connect_timeout :10
});
Call is made like this
app.get('/WSgetdata', function (req, res) {
var q = "CALL sp_get_data();"
var obj = {};
connection.connect();
connection.query(q, function (err, rows) {
if (err) {
obj.ERRORMSG = JSON.stringify(err);
}
else if((rows[rows.length-1])[0].ERRORSTATUS == 0){
//do something
}
res.end(JSON.stringify(obj))
});
});
What is wrong. It works fine when code and db are on same machine.
Also I have grant access to db from desired IP.
TRACE
Trace
at Query._callback (d:/project/config\webservice.js:397:25)
at Query.Sequence.end (d:/project/node_modules\mysql\lib\protocol\sequences\Sequence.js:96:24)
at d:/project/node_modules\mysql\lib\protocol\Protocol.js:390:18
at Array.forEach (native)
at d:/project/node_modules\mysql\lib\protocol\Protocol.js:389:13
at doNTCallback0 (node.js:407:9)
at process._tickCallback (node.js:336:13)
{ [Error: getaddrinfo ENOTFOUND http://ip.of.remote.server/ http://ip.of.remote.server/:3306]
code: 'ENOTFOUND',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'http://ip.of.remote.server/',
host: 'http://ip.of.remote.server/',
port: 3306,
fatal: true }
Error: getaddrinfo ENOTFOUND http://ip.of.remote.server/ http://ip.of.remote.server/:3306
at errnoException (dns.js:25:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
--------------------
at Protocol._enqueue (d:/project/node_modules\mysql\lib\protocol\Protocol.js:135:48)
at Protocol.handshake (d:/project/node_modules\mysql\lib\protocol\Protocol.js:52:41)
at Connection.connect (d:/project/node_modules\mysql\lib\Connection.js:119:18)
at d:/project/config\webservice.js:387:20
at Layer.handle [as handle_request] (d:/project/node_modules\express\lib\router\layer.js:82:5)
at next (d:/project/node_modules\express\lib\router\route.js:110:13)
at Route.dispatch (d:/project/node_modules\express\lib\router\route.js:91:3)
at Layer.handle [as handle_request] (d:/project/node_modules\express\lib\router\layer.js:82:5)
at d:/project/node_modules\express\lib\router\index.js:267:22
at Function.proto.process_params (d:/project/node_modules\express\lib\router\index.js:321:12)
Trace
at Query._callback (d:/project/config\webservice.js:397:25)
at Query.Sequence.end (d:/project/node_modules\mysql\lib\protocol\sequences\Sequence.js:96:24)
at Protocol._validateEnqueue (d:/project/node_modules\mysql\lib\protocol\Protocol.js:218:6)
at Protocol._enqueue (d:/project/node_modules\mysql\lib\protocol\Protocol.js:129:13)
at Connection.query (d:/project/node_modules\mysql\lib\Connection.js:197:25)
at d:/project/config\webservice.js:388:20
at Layer.handle [as handle_request] (d:/project/node_modules\express\lib\router\layer.js:82:5)
at next (d:/project/node_modules\express\lib\router\route.js:110:13)
at Route.dispatch (d:/project/node_modules\express\lib\router\route.js:91:3)
at Layer.handle [as handle_request] (d:/project/node_modules\express\lib\router\layer.js:82:5)
{ [Error: Cannot enqueue Query after fatal error.] code: 'PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR', fatal: false }
Error: Cannot enqueue Query after fatal error.
at Protocol._validateEnqueue (d:/project/node_modules\mysql\lib\protocol\Protocol.js:193:16)
at Protocol._enqueue (d:/project/node_modules\mysql\lib\protocol\Protocol.js:129:13)
at Connection.query (d:/project/node_modules\mysql\lib\Connection.js:197:25)
at d:/project/config\webservice.js:388:20
at Layer.handle [as handle_request] (d:/project/node_modules\express\lib\router\layer.js:82:5)
at next (d:/project/node_modules\express\lib\router\route.js:110:13)
at Route.dispatch (d:/project/node_modules\express\lib\router\route.js:91:3)
at Layer.handle [as handle_request] (d:/project/node_modules\express\lib\router\layer.js:82:5)
at d:/project/node_modules\express\lib\router\index.js:267:22
at Function.proto.process_params (d:/project/node_modules\express\lib\router\index.js:321:12)
Replace
host: 'http://ip.of.remote.server/',
with
host: 'ip.of.remote.server',