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

Can't create a redis Client under Node v7.7+ #1210

Closed
BarryCarlyon opened this issue Mar 14, 2017 · 7 comments
Closed

Can't create a redis Client under Node v7.7+ #1210

BarryCarlyon opened this issue Mar 14, 2017 · 7 comments

Comments

@BarryCarlyon
Copy link

BarryCarlyon commented Mar 14, 2017

Repro:

redis_client = redis.createClient();

Output:

4|5003 Shi | TypeError: "listener" argument must be a function
4|5003 Shi |     at Socket.once (events.js:307:11)
4|5003 Shi |     at Socket.connect (net.js:943:10)
4|5003 Shi |     at Socket.connect (/usr/lib/node_modules/pm2/node_modules/async-listener/index.js:76:27)
4|5003 Shi |     at Object.exports.connect.exports.createConnection (net.js:76:35)
4|5003 Shi |     at RedisClient.create_stream (/home/fredaldo/white_screens/5003_shipnet/shipnet/node_modules/redis/index.js:251:31)
4|5003 Shi |     at new RedisClient (/home/fredaldo/white_screens/5003_shipnet/shipnet/node_modules/redis/index.js:159:10)
4|5003 Shi |     at Object.exports.createClient (/home/fredaldo/white_screens/5003_shipnet/shipnet/node_modules/redis/index.js:1084:12)
4|5003 Shi |     at Object.magento.redis (/home/fredaldo/white_screens/5003_shipnet/shipnet/interface/modules/magento.js:177:26)
4|5003 Shi |     at module.exports (/home/fredaldo/white_screens/5003_shipnet/shipnet/interface/modules/magento.js:264:13)
4|5003 Shi |     at Object.<anonymous> (/home/fredaldo/white_screens/5003_shipnet/shipnet/interface/server.js:461:43)
@BarryCarlyon
Copy link
Author

Running without PM2 I get a error elsewhere:

node .
[2017-03-14 09:52:19.713] [INFO] [default] - Booting a Redis connection (well and the shipping loop)
[2017-03-14 09:52:19.750] [INFO] [default] - listening on *:5003
events.js:307
    throw new TypeError('"listener" argument must be a function');
    ^

TypeError: "listener" argument must be a function
    at Socket.once (events.js:307:11)
    at Socket.connect (net.js:943:10)
    at Connection.connectOnPort (/home/fredaldo/white_screens/5003_shipnet/shipnet/node_modules/tedious/lib/connection.js:429:19)
    at /home/fredaldo/white_screens/5003_shipnet/shipnet/node_modules/tedious/lib/connection.js:411:27
    at Socket.onMessage (/home/fredaldo/white_screens/5003_shipnet/shipnet/node_modules/tedious/lib/instance-lookup.js:28:14)
    at emitTwo (events.js:106:13)
    at Socket.emit (events.js:194:7)
    at UDP.onMessage [as onmessage] (dgram.js:546:8)

So I'm still digging

@BarryCarlyon
Copy link
Author

BarryCarlyon commented Mar 14, 2017

Looks like something has changed in node 7.7, tested in 7.7.0 and 7.7.2 same issue.
Works fine under node 7.6

Running via node instead of a pm2 start call just means that another module trips before redis does I think?

I wonder if related to https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V7.md#7.7.1

"Node.js 7.7.0 contains a bug that will prevent all native modules from building, this patch should fix the issue. Apologies to everyone who was affected by 7.7.0."

@BarryCarlyon BarryCarlyon changed the title Can't create a redis Client Can't create a redis Client under Node v7.7+ Mar 14, 2017
@BarryCarlyon
Copy link
Author

Cross linking - tediousjs/tedious#532
Should be fixed in node 7.7.3 nodejs/node#11762

@BridgeAR
Copy link
Contributor

That is a Node.js bug.

Please always check the stack traces to determine the original of the error.

@BarryCarlyon
Copy link
Author

BarryCarlyon commented Mar 14, 2017

No argument there, I just opened the issue, whilst I was working through the problem and didn't self close to leave a trace issue for others until Node 7.7.3 drops

(As of course, the issue occurred on production and YAY live debugging)

@BarryCarlyon
Copy link
Author

Tediuous made this change: tediousjs/tedious@ba01a85 to combat the node bug.

Is it worth making the same/similar socket fix in case this a is node deprecation possibility in the future @BridgeAR

@BridgeAR
Copy link
Contributor

@BarryCarlyon thanks for the hint. I do not have any time to look into this right now. If you find a way to have a work around for the bug, please feel free to open a pull request for it :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants