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

uncaughtException TypeError: Cannot read property 'command' of undefined #862

Closed
p3x-robot opened this issue May 10, 2019 · 3 comments · Fixed by #866
Closed

uncaughtException TypeError: Cannot read property 'command' of undefined #862

p3x-robot opened this issue May 10, 2019 · 3 comments · Fixed by #866

Comments

@p3x-robot
Copy link

Hello,
How are you?
I experience an error such as:

May 10 10:55:01 server p3xrs.js[21488]: [P3XRS] 2019/05/10 10:55:01.177 [ERROR]  [PID: 021488] 5/10/2019, 10:55:01 AM uncaughtException TypeError: Cannot read property 'command' of undefined
May 10 10:55:01 server p3xrs.js[21488]:     at Redis.exports.returnError (/var/p3x-redis-ui-server/node_modules/ioredis/built/redis/parser.js:36:20)
May 10 10:55:01 server p3xrs.js[21488]:     at JavascriptRedisParser.returnError (/var/p3x-redis-ui-server/node_modules/ioredis/built/redis/parser.js:20:19)
May 10 10:55:01 server p3xrs.js[21488]:     at JavascriptRedisParser.execute (/var/p3x-redis-ui-server/node_modules/redis-parser/lib/parser.js:542:14)
May 10 10:55:01 server p3xrs.js[21488]:     at Socket.<anonymous> (/var/p3x-redis-ui-server/node_modules/ioredis/built/redis/event_handler.js:107:26)
May 10 10:55:01 server p3xrs.js[21488]:     at Socket.emit (events.js:193:13)
May 10 10:55:01 server p3xrs.js[21488]:     at addChunk (_stream_readable.js:295:12)
May 10 10:55:01 server p3xrs.js[21488]:     at readableAddChunk (_stream_readable.js:276:11)
May 10 10:55:01 server p3xrs.js[21488]:     at Socket.Readable.push (_stream_readable.js:231:10)
May 10 10:55:01 server p3xrs.js[21488]:     at TCP.onStreamRead (internal/stream_base_commons.js:150:17)

patrikx3/redis-ui#14

@p3x-robot
Copy link
Author

p3x-robot commented May 10, 2019

I can reproduce it: áéűáű and I catch not it, that is weird.

try {
  let result = await redis.call('áéűáű', [])
} catch(e) {
  console.error(e)
}

We should catch it, but instead we get this error:

[P3XRS] 2019/05/10 18:47:38.061 [ERROR]  [PID: 015388] 5/10/2019, 6:47:38 PM uncaughtException TypeError: Cannot read property 'command' of undefined
    at Redis.exports.returnError (/home/patrikx3/Projects/patrikx3/redis-ui-workspace/redis-ui-server/node_modules/ioredis/built/redis/parser.js:36:20)
    at JavascriptRedisParser.returnError (/home/patrikx3/Projects/patrikx3/redis-ui-workspace/redis-ui-server/node_modules/ioredis/built/redis/parser.js:20:19)
    at JavascriptRedisParser.execute (/home/patrikx3/Projects/patrikx3/redis-ui-workspace/redis-ui-server/node_modules/redis-parser/lib/parser.js:542:14)
    at Socket.<anonymous> (/home/patrikx3/Projects/patrikx3/redis-ui-workspace/redis-ui-server/node_modules/ioredis/built/redis/event_handler.js:107:26)
    at Socket.emit (events.js:193:13)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:276:11)
    at Socket.Readable.push (_stream_readable.js:231:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:154:17)
[nodemon] app crashed - waiting for file changes before starting...

luin added a commit that referenced this issue May 13, 2019
This commit uses Buffer.byteLength() insteand of
String#length to handle non-utf8 command names.

Close #862
@luin luin closed this as completed in #866 May 13, 2019
luin added a commit that referenced this issue May 13, 2019
This commit uses Buffer.byteLength() insteand of
String#length to handle non-utf8 command names.

Close #862
ioredis-robot pushed a commit that referenced this issue May 13, 2019
## [4.9.4](v4.9.3...v4.9.4) (2019-05-13)

### Bug Fixes

* handle non-utf8 command name ([#866](#866)) ([9ddb58b](9ddb58b)), closes [#862](#862)
@ioredis-robot
Copy link
Collaborator

🎉 This issue has been resolved in version 4.9.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@p3x-robot
Copy link
Author

@luin thanks so much for the fix, although i patched it for myself, but this is awesome and it is better for everyone!

janus-dev87 added a commit to janus-dev87/ioredis-work that referenced this issue Mar 1, 2024
## [4.9.4](redis/ioredis@v4.9.3...v4.9.4) (2019-05-13)

### Bug Fixes

* handle non-utf8 command name ([#866](redis/ioredis#866)) ([9ddb58b](redis/ioredis@9ddb58b)), closes [#862](redis/ioredis#862)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants