Comments (14)
You use the newest parser version? And do you have any more information about what exactly you did?
from node-redis-parser.
- redis: v3.0.7
- node: v4.2.3
- node-redis: v2.6.2
- node-redis-parser: v2.0.3
On our production environment we see the same error, a couple of times per day.
Protocol error, got "0" as reply type byte. Please report this.
From our application logs, it appears this error this thrown directly after reconnecting when the connection to Redis was lost.
14:00:23.000 Redis connection to redis-1 lost for 0ms (retrycount: 1)
14:00:24.000 Redis connections are healthy.
14:00:24.000 uncaughtException: Protocol error, got "0" as reply type byte. Please report this.
From the examples of node_redis I see that it's preferable to wait for the ready
event of the client before sending any commands. We don't (yet) do that. Could that be part of the issue?
from node-redis-parser.
@arjenvanderende the ready
event should not be of any concern in this case. Would you be so kind and activate the debug_mode? That way I might have at least some basic information to start debugging this as I have no starting point currently. And please update the parser to v.2.0.4 as 2.0.3 might return corrupted multi byte characters from time to time.
from node-redis-parser.
@BridgeAR I'm hesitant to enable debug mode on our production environment. The docs discourage using debug mode in production because of the performance penalty. There's also no indication of how long we'd need to have debug mode enabled, because on some days the protocol error happens around 20 times, while on other days it doesn't happen at all.
A point of interest is that we have three application in production, but we're only seeing the protocol error in one them. We haven't seen the problem in any of the others, even though all applications a similar amount of load. The setup for our connections to Redis is in a shared codebase.
The only difference I can think of is that the application with the protocol error makes use of a pattern subscription. Something along the lines of this:
var redis = require('redis');
function connect(port, host) {
var client = redis.createClient(port, host);
client.psubscribe('PREFIX:*:*');
client.on('pmessage', onMessageReceived);
return client;
}
I think existing subscriptions are reestablished after a disconnect. Maybe usable as starting point?
from node-redis-parser.
I have the same problem on node-redis-parser: v2.0.4
events.js:141
throw er; // Unhandled 'error' event
^
ReplyError: Protocol error, got "1" as reply type byte. Please report this.
at parseType (/var/app/current/node_modules/fw_pubsub/node_modules/redis/node_modules/redis-parser/lib/parser.js:226:34)
Always "1" as reply type byte by the way
from node-redis-parser.
If you run into this with v.2.1.0 please provide all error properties. I extended the errors so it'll likely be possible to debug this afterwards.
from node-redis-parser.
@tal-beja @arjenvanderende @tjsail33 did anyone of you run into the issue again?
from node-redis-parser.
I had this same issue and it appeared that there was a function that was re-broadcasting the message each time it was received, with 4 servers. It caused a memory increase then errors then crash. Since the code has been fixed, everything works well.
from node-redis-parser.
As no one replied anymore I guess the issue was somewhere else / is already fixed.
If anyone runs into this again, please let me know and or reopen the issue.
from node-redis-parser.
Hey @BridgeAR I have ReplyError: Protocol error, got \"9\" as reply type byte. Please report this.\n at parseType (/opt/cloudcoreo/webapp/node_modules/redis-parser/lib/parser.js:293:17)
from node-redis-parser.
@manasovdan please try to reproduce and provide all error information. I need at least the buffer and better also the offset attribute from the thrown error.
What operations do you use btw and do you know what commands were executed while running into that error?
from node-redis-parser.
@BridgeAR I'll try to reproduce that but the error is only on production. We use redis for caching and scaling websocket commands (simple PUB/SUB).
The full error message
{"level":"error","message":"ReplyError: Protocol error, got \"9\" as reply type byte. Please report this.\n at parseType (/opt/cloudcoreo/webapp/node_modules/redis-parser/lib/parser.js:293:17)\n at JavascriptRedisParser.execute (/opt/cloudcoreo/webapp/node_modules/redis-parser/lib/parser.js:549:20)\n at Socket.<anonymous> (/opt/cloudcoreo/webapp/node_modules/redis/index.js:267:27)\n at emitOne (events.js:96:13)\n at Socket.emit (events.js:188:7)\n at readableAddChunk (_stream_readable.js:172:18)\n at Socket.Readable.push (_stream_readable.js:130:10)\n at TCP.onread (net.js:542:20)","timestamp":"2017-03-05T20:46:51.999Z"}
from node-redis-parser.
@manasovdan I just published a new version that should help with debugging by more prominently show the buffer and offset data in the error. If you again run into the error, please provide that information :-)
I'm going to reopen the issue but it's really difficult to know what happened without any further information.
from node-redis-parser.
As there's no new feedback, I'll close this again. If you have any further information, please let me know.
from node-redis-parser.
Related Issues (20)
- SyntaxError: Use of const in strict mode. HOT 1
- Node engine needs to be updated HOT 4
- Error: Must have start <= end HOT 4
- Big chunked arrays are slow
- New Release to include PRs #19 and #24 for Node v0.10 support HOT 1
- Error: [email protected] install: `node-gyp rebuild` HOT 3
- An in-range update of mocha is breaking the build 🚨
- redis-parser referring null values. HOT 5
- Reply Error: MOVED HOT 2
- Publish 3.0.0? HOT 4
- Socket.io adapter emitted error event: { ParserError: Protocol error, got "a" as reply type byte. Please report this. HOT 2
- Large array lengths can cause an unhandled RangeError HOT 6
- RedisError is undefined HOT 2
- hiredis is not compiling in nodejs 12 HOT 7
- TypeError: Cannot read property 'length' of null HOT 1
- Add support for RESP3 HOT 1
- hiredis still listed as dependency in the NPM package [email protected] HOT 3
- ERR wrong number of arguments for 'get' command
- ERR invalid expire time in set HOT 1
- ParserError: Protocol error, got "\r" as reply type byte. Please report this. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-redis-parser.