ioredis throws an error that i cannot catch and make p3x-redis-server (p3x-redis-ui) crash
See original GitHub issuehello!
what happening is that if a user configure a redis settings wrong, there is an error, that i cannot catch. the error is like this:
[P3XRS] [PID: 018665] Trace
at parseType (/home/patrikx3/Projects/patrikx3/redis-ui-workspace/redis-ui-server/node_modules/redis-parser/lib/parser.js:302:17)
at JavascriptRedisParser.execute (/home/patrikx3/Projects/patrikx3/redis-ui-workspace/redis-ui-server/node_modules/redis-parser/lib/parser.js:534:24)
at Socket.<anonymous> (/home/patrikx3/Projects/patrikx3/redis-ui-workspace/redis-ui-server/node_modules/ioredis/built/DataHandler.js:25:20)
at Socket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at Socket.Readable.push (internal/streams/readable.js:223:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
at TCP.callbackTrampoline (internal/async_hooks.js:131:14)
[P3XRS] [PID: 018665] 3/27/2021, 6:19:33 AM unhandledRejection ReplyError: ERR SELECT is not allowed in cluster mode
at parseError (/home/patrikx3/Projects/patrikx3/redis-ui-workspace/redis-ui-server/node_modules/redis-parser/lib/parser.js:179:12)
at parseType (/home/patrikx3/Projects/patrikx3/redis-ui-workspace/redis-ui-server/node_modules/redis-parser/lib/parser.js:303:14) {
command: { name: 'select', args: [ '1' ] }
} Promise {
<rejected> ReplyError: ERR SELECT is not allowed in cluster mode
at parseError (/home/patrikx3/Projects/patrikx3/redis-ui-workspace/redis-ui-server/node_modules/redis-parser/lib/parser.js:179:12)
at parseType (/home/patrikx3/Projects/patrikx3/redis-ui-workspace/redis-ui-server/node_modules/redis-parser/lib/parser.js:303:14) {
command: { name: 'select', args: [Array] }
}
}
so if the user creates a setting for a non cluster that is actually a cluster this error happening and there is no way to catch, so my app crashes.
please let me know how i can disable this automatic select 1
command, when you are connecting to a clustered redis instance but with wrong connection, without enabling cluster mode.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Redis (ioredis) - Unable to catch connection error in order to ...
By "crash", I mean the current process is terminated from redis when the connection cannot be created, I'd like to catch that error...
Read more >ioredis - npm
A robust, performance-focused and full-featured Redis client for Node.js.. Latest version: 5.2.4, last published: 2 months ago.
Read more >Redis with Node.js (ioredis) | Redis Documentation Center
This example shows how to configure ioredis to make a connection to Redis using TLS: const Redis = require('ioredis'); ...
Read more >README - ioredis - Read the Docs
A robust, performance-focused and full-featured Redis client for Node and io.js. Supports Redis >= 2.6.12 and (Node.js >= 0.10.16 or io.js).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
🎉 This issue has been resolved in version 4.24.5 🎉
The release is available on:
Your semantic-release bot 📦🚀
thanks very much!