anvilresearch / connect

A modern authorization server built to authenticate your users and protect your APIs
http://anvil.io
MIT License
361 stars 85 forks source link

connect-redis - ERR wrong number of arguments for 'set' command #298

Closed ikb42 closed 8 years ago

ikb42 commented 8 years ago

connect-redis version 3.0.1 appears to break anvil-connect when moving from successful user signin to authorize

{ [ReplyError: ERR wrong number of arguments for 'set' command] name: 'ReplyError', message: 'ERR wrong number of arguments for \'set\' command', command: { name: 'set', args: [ 'sess:xxxxxxxxxxxxx', '{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"},"amr":["pwd"],"user":"yyyyyyyyyyyyy","opbs":"zzzzzzzzzzz"}', 'EX', '86400' ] } } 

'ReplyError: ERR wrong number of arguments for \'set\' command\n at ReplyParser._parseResult 

(\\connect\\node_modules\\anvil-connect\\node_modules\\ioredis\\lib\\parsers\\ja vascript.js:39:14)\n at ReplyParser.execute (\\connect\\node_modules\\anvil-connect\\node_modules\\ioredis\\lib\\parsers\\javascript.js:139:20)\n at Socket.<anonymous> (\\project\\connect\\node_modules\\anvil-connect\\node_modules\\ioredis\\lib\\redis\\event_handler.js:90:22)\n at emitOne (events.js:77:13)\n at Socket.emit (events.js:169:7)\n at readableAddChunk (_stream_readable.js:146: 16)\n at Socket.Readable.push (_stream_readable.js:110:10)\n at TCP.onread (net.js:523:20)'
christiansmith commented 8 years ago

@ikb42 thanks so much for helping find the problem and filing the issue.

Unfortunately, this isn't the first time a dependency has disregarded semantic versioning rules and sent us off on a bug hunt. Perhaps we should consider shrinkwrapping releases from now on.

luin commented 8 years ago

Is it related with https://github.com/tj/connect-redis/issues/164?

christiansmith commented 8 years ago

@ikb42 which version of Redis are you running this against?

christiansmith commented 8 years ago

@luin thanks for pointing out this possibility :)

ikb42 commented 8 years ago

redis_version:2.4.6

EternalDeiwos commented 8 years ago

@ikb42 would you be able to upgrade your server and see if that fixes the problem? @luin mentioned that redis servers older than 2.6.12 don't allow certain options on the SET command which seems to be the problem.

ikb42 commented 8 years ago

Yes, done and all ok on: redis_version:2.8.2104 and

  "name": "connect-redis",
  "description": "Redis session store for Connect",
  "version": "3.0.1",
EternalDeiwos commented 8 years ago

Fantastic

hardikmodi1 commented 5 years ago

This get me out of the problem.