question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ioredis throws an error that i cannot catch and make p3x-redis-server (p3x-redis-ui) crash

See original GitHub issue

hello!

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:closed
  • Created 2 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ioredis-robotcommented, Mar 27, 2021

🎉 This issue has been resolved in version 4.24.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

1reaction
p3x-robotcommented, Mar 29, 2021

thanks very much!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found