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
Some error occuered after update 3.0.0 #172
Comments
Yes, we switched to Are you able to reproduce consistently? |
Yes, It happened repeatedly and even now.
|
Are you using some external emitter (like socket.io-emitter or socket.io-php-emitter), that could publish packets that msgpack-lite would be unable to decode? Or with several nodes, some that are using Related: #169 |
Yes of course. I use
and there is no usage |
@DingGGu may I ask what your setup is?
I'd like to make sure that this issue is really related to |
I'm getting the same error with my setup: Redis Server:
npm versions:
code example: var redisSub = redis.createClient(redis.port, redis.host, { detect_buffers: true, auth_pass: redis.pass});
redisSub.on("message", function(channel, message)
{
console.log(channel, message);
});
var redisPub = redis.createClient(redis.port, redis.host, {auth_pass: redis.pass});
redisPub.publish("discord", JSON.stringify({type: "status", data: {uuid: id, status: status}}));
var socketio = require("socket.io");
var io = socketio.listen(server.server);
var ioredis = require("socket.io-redis");
var adapter = ioredis({
pubClient: redisPub,
subClient: redisSub
});
io.adapter( adapter ); data being received:
stack trace:
|
@mavrick |
I just downgraded version, |
Redis connect with socket.io-redis let Adapter = adapter({host: config.redis.host, port: config.redis.port});
io.adapter(Adapter); According to source of |
@darrachequesne doesn't msgpack get called inside the publish method? I don't think I should have to call msgpack myself, or do I? What version did you rollback to @DingGGu ? I may have to do the same at this stage. |
@mavrick I may be missing something here, but if you want to publish some packets, why aren't you using the var io = require('socket.io-emitter')({ host: '127.0.0.1', port: 6379 });
io.emit("discord", JSON.stringify({type: "status", data: {uuid: id, status: status}}));
// msgpack.encode gets indeed called |
@darrachequesne i can't argue with that logic. I'll give it a go this evening and see what results I get. Cheers |
@mavrick Here is my versions.
I guess maybe |
After using |
@darrachequesne Yes, |
I get the same error i dived into socket.io-redis and found that i can encode and decode my payload gets correctly encoded with a length of 85 characters but when the message get's received is the encoded message 84 characters long. The payload:
|
msgpack is the problem. I think that the encoded message is somewhere parsed through .toString() this results that in the encoded message sometimes data gets lost. Below did i included the same message with the second one after encoding parsed through .toString(). You see that \u0002 disappears. Not parsed Parsed A simple but maybe dirty and temporarily fix is to replace msgpack with JSON (stringify | parse) this resolves the problem. |
The behaviour you are describing looks really weird.
The problem with that fix is that JSON.stringify/parse does not handle binary message, we could rollback to using |
Yes that is maybe not a bad idea but i found that in |
Redis Version: I have also experienced this exact issue with the message:
|
👍 |
Downgrading "socket.io-redis" to "^2.0.1" solved this same issue for us as well. |
Closed by #218. |
I update socket.io-redis 3.0.0 right now,
But few Unknown error occured from error logs.
Maybe It caused by
"msgpack-lite": "0.1.26"
The text was updated successfully, but these errors were encountered: