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

Exception error with msgpack #88

Closed
cong88 opened this issue Dec 18, 2015 · 4 comments
Closed

Exception error with msgpack #88

cong88 opened this issue Dec 18, 2015 · 4 comments

Comments

@cong88
Copy link

cong88 commented Dec 18, 2015

I had exception error when using "socket.io": "1.3.7", "socket.io-redis": "0.2.0", nodejsV4
My config:
var pub = redis(socket_redis.port, socket_redis.host);
var sub = redis(socket_redis.port, socket_redis.host, {
return_buffers: true
});

Error: 367 trailing bytes
at Object.decode (/var/www/api/node_modules/msgpack-js/msgpack.js:200:47)
at Redis.onmessage (/var/www/api/node_modules/socket.io-redis/index.js:93:24)
at emitTwo (events.js:87:13)
at RedisClient.emit (events.js:172:7)
at RedisClient.return_reply (/var/www/api/node_modules/redis/index.js:618:22)
at /var/www/ibooknail-api/node_modules/redis/index.js:309:18
at doNTCallback0 (node.js:419:9)
at process._tickDomainCallback (node.js:389:13)

@laukaichung
Copy link

Have you solved the problem? After upgrading node to 4.2, I'm getting similar errors. I have downgraded socket.io to 1.36, redis to 1.0.
I have followed the solutions suggested in #17, but they don't work.

Adding return_buffers: true to the instances doesn't do anything.

Tried changing the dependencies to msgpack-js-v5 suggested in the last post but that isn't working.

Error: 256 trailing bytes
    at Object.decode (/usr/apps/js/node_modules/msgpack-js/msgpack.js:200:47)
    at Redis.onmessage (/usr/apps/js/node_modules/socket.io-redis/index.js:93:24)
    at emitTwo (events.js:92:20)
    at RedisClient.emit (events.js:172:7)
    at RedisClient.return_reply (/usr/apps/js/node_modules/redis/index.js:676:22)
    at JavascriptReplyParser.reply_parser.send_reply (/usr/local/apps/js/node_modules/redis/index.js:332:14)
    at JavascriptReplyParser.run (/usr/apps/js/node_modules/redis/lib/parsers/javascript.js:132:18)
    at JavascriptReplyParser.execute (/usr/apps/js/node_modules/redis/lib/parsers/javascript.js:107:10)
    at Socket.<anonymous> (/usr/apps/js/node_modules/redis/index.js:131:27)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at Socket.Readable.push (_stream_readable.js:110:10)
    at TCP.onread (net.js:523:20)

@xyzlast
Copy link

xyzlast commented Feb 25, 2016

@stonecold123 ,

check #17 comments. change version is work fine.

@cong88
Copy link
Author

cong88 commented Feb 26, 2016

Not any error when I use default setting and make sure 2 node server had the same version
var io = require('socket.io')(3000);
var redis = require('socket.io-redis');
io.adapter(redis({ host: 'localhost', port: 6379 }));

ORr using version : "1.0.0" 👍

@cong88 cong88 closed this as completed Feb 26, 2016
@xyzlast
Copy link

xyzlast commented Feb 29, 2016

@cong88

I want to know the default setting value. I've set this versions in packages.js.
I've met the error when subClient and pubClient is used.

const server = require('http').createServer(app),
  io = require('socket.io')(server),
  adapter = require('socket.io-redis');
const pub = require('./app/utils/RedisUtil').createClient();
const sub = require('./app/utils/RedisUtil').createClient();
io.adapter(adapter({ pubClient: pub, subClient: sub }));
    Node: 5.6.0
    "socket.io": "^1.4.5",
    "socket.io-adapter": "^0.4.0",
    "socket.io-redis": "^1.0.0",

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

3 participants