Skip to content

Error when passing a buffer as a value using HSET in redis@4.0.0 #1738

@metawrap-dev

Description

@metawrap-dev

Environment:

  • Node.js Version: v16.13.0
  • Redis Server Version: Redis server v=6.2.6 sha=00000000:0 malloc=libc bits=64 build=ffd424e92d4892ad
  • Node Redis Version: redis@4.0.0
  • Platform: MacOS 11.6.1 (20G224)

I was able to do this previously using HMSET.

With 4.0.0 I get the following error.

received error: TypeError: Cannot read properties of undefined (reading 'toString')
      at encodeCommand (node_modules/@node-redis/client/dist/lib/commander.js:72:30)
      at encodeCommand.next (<anonymous>)
      at RedisSocket.writeCommand (node_modules/@node-redis/client/dist/lib/client/socket.js:56:20)
      at Commander._RedisClient_tick (node_modules/@node-redis/client/dist/lib/client/index.js:415:64)
      at Commander._RedisClient_sendCommand (node_modules/@node-redis/client/dist/lib/client/index.js:396:82)
      at Commander.commandsExecutor (node_modules/@node-redis/client/dist/lib/client/index.js:160:154)
      at Commander.BaseClass.<computed> [as hSet] (node_modules/@node-redis/client/dist/lib/commander.js:8:29)

I am calling

 await this.Redis.Client.hSet(key, args);

Where

key

bucket/1de1360a284668060d4c176986cbe068361365816e01cfb2a0f5803f1c977ecb/file/c993e3051cb8335096020ed3dd8bf69c82078e37784b65097ae0247a92313b7a

args

[["Version",1],["Path","bff83a6a615624f255317e1c1dd229ae9fade249ac918779b0ca10253bc7e84a/575199deb9a8cffb9d2ff0153668eeca6c31d89892ab42a9c658f5e095b7e08e/17f78c12-be47-4d99-b128-d49a3c996499/dc66cc33e8e2f05c8427596eb05a44957decdc84420b20ce62bbbe62573f77e3.csf"],["Size",1024],["ContentType","application/binary"],["Data",{"type":"Buffer","data":[251,28,128,172,55,85,125,23,183,167,100,2,75,191,74,40,26,125,168,168,130,29,16,24,189,222,7,93,136,230,221,76,206,198,204,129,121,221,106,157,12,39,53,111,4,48,231,44,1,138,28,223,214,134,6,101,139,228,81,175,57,18,37,88,211,17,181,70,106,44,136,125,67,195,204,223,243,135,32,91,31,98,199,241,110,215,243,215,213,147,64,153,193,173,182,41,204,166,7,1,220,114,11,161,7,106,165,171,40,153,195,240,141,10,66,183,169,177,153,187,140,167,147,70,15,239,159,228,212,192,34,26,147,66,11,200,29,71,217,164,224,242,127,150,214,33,113,11,108,191,76,77,67,70,0,128,118,149,63,167,143,32,27,154,2,157,162,95,230,72,112,1,100,187,244,88,4,34,211,237,55,148,56,254,87,97,179,171,111,159,225,53,67,39,153,187,93,204,139,135,200,86,75,245,246,143,177,101,56,224,174,232,154,42,192,134,188,118,13,52,42,214,145,21,3,156,229,220,112,115,10,224,214,234,153,217,94,9,142,204,46,238,80,150,168,12,75,43,225,163,156,180,18,49,57,7,191,161,235,173,84,255,86,121,98,137,76,24,239,42,133,25,39,130,226,4,116,76,102,237,50,42,239,18,55,158,183,56,219,224,56,49,112,208,234,219,24,113,7,131,204,142,144,85,126,50,194,184,234,213,216,77,2,105,133,170,137,79,123,129,24,204,172,94,20,173,173,130,20,91,112,221,110,110,151,218,150,53,234,4,242,105,176,63,25,18,75,68,193,155,107,139,105,59,113,70,148,232,65,246,171,140,183,131,52,186,73,117,189,44,192,101,147,11,55,214,234,216,89,17,81,239,251,244,70,39,152,242,173,23,142,77,22,70,103,217,8,175,97,43,46,88,254,200,170,242,224,149,129,82,220,190,124,248,199,231,251,211,45,49,178,85,58,119,69,60,211,73,183,184,45,6,253,200,229,178,254,57,189,74,156,150,154,173,103,16,130,49,230,157,43,72,87,46,200,242,117,168,158,146,134,217,140,103,95,184,9,115,195,237,249,151,214,15,96,248,34,162,20,69,187,115,214,11,75,229,80,221,27,168,93,174,192,148,229,44,182,43,147,91,215,12,112,145,0,231,135,39,239,42,205,35,73,63,123,65,144,250,74,168,88,84,167,5,249,159,48,119,161,156,160,133,129,14,186,146,250,47,210,196,173,176,45,97,195,124,32,133,129,76,188,168,171,170,214,75,151,86,78,94,177,134,235,110,116,223,195,8,107,15,25,96,93,155,177,4,111,41,174,121,213,49,69,224,255,45,202,126,59,10,99,53,113,211,8,141,106,111,82,222,6,33,94,137,164,161,113,136,150,44,24,108,8,152,93,104,239,34,35,238,134,248,246,124,94,77,229,69,249,69,232,44,164,58,78,38,84,172,88,158,34,51,162,133,193,120,34,10,103,78,239,228,239,194,214,126,94,8,167,40,37,193,9,17,251,155,195,52,204,106,244,24,173,206,129,15,128,211,221,134,202,3,226,123,47,103,104,37,109,59,252,222,143,137,128,33,209,192,20,227,215,248,154,22,67,191,106,57,235,151,250,63,165,242,202,68,170,8,228,213,123,194,156,214,83,222,107,74,209,129,233,33,228,11,182,230,32,1,73,228,20,165,232,200,211,88,108,113,11,250,107,173,24,136,233,129,254,72,212,100,194,102,20,27,21,232,94,220,109,26,224,238,95,88,45,144,190,177,207,226,194,220,26,44,164,85,18,204,144,16,32,119,96,53,247,217,93,16,177,129,116,224,53,171,55,96,86,92,232,230,177,75,208,144,177,3,107,229,254,99,51,104,133,17,169,159,246,241,5,80,90,176,164,191,33,152,198,231,48,63,176,16,240,70,206,81,229,45,234,239,54,164,214,209,107,24,156,140,6,207,187,114,95,21,74,198,119,210,227,235,150,216,50,195,213,175,153,91,178,56,188,135,110,47,169,197,233,1,112,30,199,63,9,189,134,162,103,205,25,181,168,128,55,8,56,166,126,25,166,121,2,202,21,206,168,16,33,235,97,58,240,99,48,176,91,216,8,34,11,157,105,1,157,242,35,8,213,116,11,243,243,229,1,138,183,34,2,206,196,62,195,12,180,155,43,51,67,24,56,245,60,224,45,57,151,167,158,75,1,229,12,253,13,183,173,225,129,51,249,224,182,248,92,50,217,233,248,189,19,9,189,49,95,166,91,222,41,143,12,158,59,131,154,215,133,15,168,158,250,36,181,61,223,199,124,88,186,24,29,240,24,17,132,210]}]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions