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

looking for advice -- error connecting: Error: Handshake inactivity timeout #1239

Closed
bennettatoms opened this issue Oct 13, 2015 · 14 comments
Closed
Assignees
Labels

Comments

@bennettatoms
Copy link

Hi,

I have been using node-mysql for development purposes for the past few months, and it's been great. Thus far I have been connecting to the same Amazon RDS instance from my local machine, but we recently deployed our app code to an Amazon VPC, and now I'm getting the above error when the app tries to connect to the same MySQL database we were developing off of.

The full error stack trace is:

error connecting: Error: Handshake inactivity timeout
   at Handshake.<anonymous> (/var/app/current/node_modules/mysql/lib/protocol/Protocol.js:154:17)
   at Handshake.emit (events.js:104:17)
   at Handshake._onTimeout         (/var/app/current/node_modules/mysql/lib/protocol/sequences/Sequence.js:116:8)
   at Timer.listOnTimeout (timers.js:119:15)
   --------------------
   at Protocol._enqueue (/var/app/current/node_modules/mysql/lib/protocol/Protocol.js:135:48)
   at Protocol.handshake (/var/app/current/node_modules/mysql/lib/protocol/Protocol.js:52:41)
   at PoolConnection.connect (/var/app/current/node_modules/mysql/lib/Connection.js:123:18)
   at Pool.getConnection (/var/app/current/node_modules/mysql/lib/Pool.js:45:23)
   at execQuery.mysql (/var/app/current/api/utilities/connection.js:90:12)
   at exports.runQuery (/var/app/current/api/utilities/connection.js:223:3)
   at _fulfilled (/var/app/current/node_modules/q/q.js:834:54)
   at self.promiseDispatch.done (/var/app/current/node_modules/q/q.js:863:30)
   at Promise.promise.promiseDispatch (/var/app/current/node_modules/q/q.js:796:13)
   at /var/app/current/node_modules/q/q.js:556:49
   at runSingle (/var/app/current/node_modules/q/q.js:137:13)
   at flush (/var/app/current/node_modules/q/q.js:125:13)
   at process._tickDomainCallback (node.js:381:11)

Exactly what's happening on the attempt to connect is a little opaque. I'm guessing it's probably not an issue with the node-mysql module, but if anyone has experienced something similar and might be able to offer advice on how to connect successfully, I would greatly appreciate it.

@GoNode5
Copy link

GoNode5 commented Oct 13, 2015

Same here, ubuntu 14.04 after update / upgrade... after error did upgrade to node 4.2.1 and mysql latest... to be sure. No solution. Never happened in 2.5 year Nodejs/Mysql updates/upgrades it always worked/stable.

@bramvandervoet
Copy link

reboot with Node 4.2.1 solved my problem thnx. I saw my problem is an duplicate, please dont solve and close to quick :-)

@dougwilson
Copy link
Member

Hi @bennettatoms can you provide the following information:

  1. Version of Node.js
  2. Version of this module
  3. Version of your MySQL server.

@dougwilson dougwilson self-assigned this Oct 13, 2015
@Fatalityap
Copy link

I had this problem also but Node 4.2.1 solved my problem too... :) I see that many people have this problem on Node 4.2.0 ))))

@bennettatoms
Copy link
Author

I should mention that the app is running on node v0.12.4, node-mysql v2.9.0, and MySQL v5.6.23. Was hesitant to upgrade to node > 4.0 as we began deployment the same week 4.0 was released. I can still connect via localhost without problem.

@hezedu
Copy link

hezedu commented Oct 14, 2015

I have this problem too!
node: 4.2.0
this module: ^2.9.0
MySQL server: 5.1.73

update node to 4.2.1 is OK!

@gquemener
Copy link

Upgrading node to 4.2.1 solved the problem for me too 👍

@bennettatoms
Copy link
Author

I made a mistake on the node version. My local version, where everything is still working without issue, is 0.12.4, but the AWS EC2 instance is running 0.12.6, which is apparently the latest version they support.

@rasensio
Copy link

Updated with brew to 4.2.1 and problem solved.

@raffi-minassian
Copy link

Saw the same problem just connecting to a local mysql like ...

var con = mysql.createConnection({
  database: "mydb",
  host: "localhost,
  user: "admin",
  password: "nonononono"
});

Would give when trying con.query( etc... ) ...

{ [Error: Handshake inactivity timeout]
  code: 'PROTOCOL_SEQUENCE_TIMEOUT',
  fatal: true,
  timeout: undefined }

Just updating to Node.js v4.2.1 fixed the issue!!.
:)

@s992
Copy link

s992 commented Oct 16, 2015

Just wanted to chime in and note that I was experiencing the same issue with the sails-mysql adapter, which uses node-mysql behind the scenes. Upgrading to Node 4.2.1 fixed it for me as well.

@dougwilson
Copy link
Member

@bennettatoms werre you able to resolve the issue? We test this module with 0.12, though looking at Travis CI, the current version is 0.12.7. I don't remember having having an issue with 0.12.6, though, and I ran against 0.12.6 locally and all the tests passed, so I'm not really sure what else to really suggest :(

@bennettatoms
Copy link
Author

@dougwilson, I'm so sorry for not posting this earlier. Thank you for looking into it, but the problem, as I suspected but (unfortunately) took about a week to confirm, was on the AWS side, the way the permissions were configured on our outbound servers. It was all unfamiliar terrain for me. It is good to know, though, that this became a known and resolved issue with the upgrade to node 4.2.1.

@salfredogonzalez
Copy link

Yes, upgrading node version do the fix

@mysqljs mysqljs locked and limited conversation to collaborators Nov 27, 2015
nwoltman pushed a commit to nwoltman/node-mysql that referenced this issue Jun 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests