Redis: (error) ERR wrong number of arguments for 'set' command / ERR syntax error
The command was malformed: missing/extra arguments or an unsupported option for your Redis version.
ERR wrong number of arguments for 'set' command(error) ERR syntax errorReplyError: ERR wrong number of arguments for 'hset' commandERR unknown commandERR Unknown subcommand or wrong number of arguments for 'x' Meaning
Check the command's syntax with COMMAND DOCS set (Redis 7) or the docs. Client libraries may build commands incorrectly when a value is undefined (skipped) or when options (EX, NX, GT) aren't supported by the server version (e.g. SET ... GET needs 6.2, GT/LT for EXPIRE 7.0).
Common causes
- Missing argument (undefined variable skipped)
- Option not supported by old server
- Wrong order of options
- Spaces unquoted in redis-cli
- Client/server version mismatch
⚡ Quick fix
- Run the command manually in
redis-cli - Check
INFO serverversion vs the command's "since" version - Quote values with spaces
Detailed fix by platform
Linux
redis-cli COMMAND DOCS set | head; redis-cli INFO server | grep redis_version
How to diagnose
- Command — Syntax per docs?
- Version — Supported?
- Args — All present?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- BullMQ: Missing lock for job / job stalled more than allowable limit BullMQ: Error: Missing lock for job 42. moveToFinished / job stalled more than allowable limit
- BUSY Redis is busy running a script Redis: (error) BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE
- Celery with Redis: tasks run twice (visibility_timeout) Celery: Task executed twice / Restoring unacked messages — Redis broker visibility_timeout shorter than task ETA
Most viewed in Redis
- READONLY You can't write against a read only replica Redis: READONLY You can't write against a read only replica
- MISCONF Redis: MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk
- OOM command not allowed Redis: OOM command not allowed when used memory > 'maxmemory'
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026