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

PROTOCOL_SEQUENCE_TIMEOUT in Node v4.2 #1236

Closed
TooBug opened this issue Oct 13, 2015 · 20 comments
Closed

PROTOCOL_SEQUENCE_TIMEOUT in Node v4.2 #1236

TooBug opened this issue Oct 13, 2015 · 20 comments
Assignees
Labels

Comments

@TooBug
Copy link

TooBug commented Oct 13, 2015

[Error: Query inactivity timeout]
PROTOCOL_SEQUENCE_TIMEOUT

I'm using this image https://hub.docker.com/r/mhart/alpine-node/, so not so sure if it's node-mysql's problem. Need confirm.

@kerihenare
Copy link

Definitely seems to be an issue between node-mysql and Node 4.2.0. The following script works fine in 4.1.2 but gets a connection timeout in 4.2.0.

var mysql      = require('mysql');

var connection = mysql.createConnection({
    host:           'localhost',
    user:           'user',
    password:       'password',
    database:       'database'
});

connection.connect();

connection.query('SELECT 1 + 1 AS solution', (error, rows, fields) => {
    if (error) {
        return console.log(error);
    }

    console.log('The solution is: ', rows[0].solution);
});

connection.end();

@dougwilson
Copy link
Member

By definition, 4.1.0 to 4.2.0 should be backwards-compatible. Please file a bug against Node.js for this so we can track here.

@dougwilson
Copy link
Member

Seems likely to be the bug nodejs/node#3331

@dougwilson
Copy link
Member

I'll try to investigate the regression from Node.js 4.2 that is causing this sometime this week unless someone gets to it first :)

@fengmk2
Copy link
Member

fengmk2 commented Oct 13, 2015

nodejs/node@63644dd introduced this bug.

Workaround: set Sequence._idleTimeout = -1 instead of undefined https://github.com/felixge/node-mysql/blob/master/lib/protocol/sequences/Sequence.js#L30

@dougwilson
Copy link
Member

Looks like there is going to be a 4.2.1 tomorrow (nodejs/node#3337), so it should be quick enough we don't need to introduce some kind of work-around for the bug.

@fengmk2
Copy link
Member

fengmk2 commented Oct 13, 2015

@dougwilson indeed.

@RobinQu
Copy link

RobinQu commented Oct 13, 2015

I should google before debugging this exception.......

@nurrony
Copy link

nurrony commented Oct 13, 2015

@RobinQu I am also a victim of this.. Want to be updated as soon as this issue is closed

@Meekohi
Copy link

Meekohi commented Oct 13, 2015

Thanks, "everyone's favourite JavaScript feature". Having this issue also.

@clintfenton
Copy link

+1

@clintfenton
Copy link

Temporary fix from @fengmk2 worked for me to get things going again. Looking forward to the repaired release.

@Jaykah
Copy link

Jaykah commented Oct 13, 2015

nodejs/node#3337 has been merged

@dougwilson
Copy link
Member

Yes, and 4.2.1 has been released: https://nodejs.org/en/blog/release/v4.2.1/

@Wikunia
Copy link

Wikunia commented Oct 14, 2015

I have the same error in v4.2.1 and I had to change _idleTimeout to -1 to make it work.

@AdriVanHoudt
Copy link

it should work on undefined see https://github.com/nodejs/node/pull/3331/files

@Wikunia
Copy link

Wikunia commented Oct 14, 2015

Thanks, not sure why this happens but well there is a fix, so it's okay for me.

@AdriVanHoudt
Copy link

yeah it landed in 4.2.1 so it should work

@Meekohi
Copy link

Meekohi commented Oct 14, 2015

I can confirm v4.2.1 fixed this for me.

@dougwilson
Copy link
Member

Hi everyone, if you are getting this only in Node.js 4.2.0, it's because that version had a regression in timer code. You have to either downgrade to 4.1.0 or upgrade to 4.2.1.

@mysqljs mysqljs locked and limited conversation to collaborators Oct 14, 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