Skip to content

ERR syntax error when using set #1269

@dotSlashLu

Description

@dotSlashLu
  • Version:
    node_redis: ^2.8.0
    redis-server: Redis server v=4.0.1 sha=00000000:0 malloc=libc bits=64 build=f37081b32886670b

  • Platform:
    Node.js v8.3.0
    Darwin 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

  • Description:
    set will result in ERR syntax error:

const redis = require('redis'),
      Promise = require('bluebird'),
      conf = require(__root_dir + '/conf/conf')

// Promise.promisifyAll(redis.RedisClient.prototype)
// Promise.promisifyAll(redis.Multi.prototype)
const client = redis.createClient(
    conf.redis.port,
    conf.redis.host)

const key = 'sess-test'
const uid = 1
const ttl = 60 * 60 * 24 * 30
client.set(key, uid, ttl)

will generate

Send localhost:6379 id 0: *4
$3
set
$9
sess-test
$1
1
$7
2592000

Net read localhost:6379 id 0
Error ReplyError: ERR syntax error

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