WRONGTYPE Node.js Origin: Application & API OSI layer 7 · Application Last updated 15 Oct 2026

WRONGTYPE Operation against a key holding the wrong kind of value

A Redis command was used on a key of a different type (e.g. HGET on a string key).

Exact message you may see WRONGTYPE Operation against a key holding the wrong kind of value
Seen on: Node.js

Meaning

Each Redis key has one type (string, hash, list, set, zset). Reusing key names across features or changing data shape causes it.

Common causes

  • Same key name used for different data types
  • Data migrated without clearing old keys
  • Bug writing the wrong type

⚡ Quick fix

  1. Check the key type: TYPE key
  2. Use namespaced key names (user:42:profile)
  3. Delete/migrate the old key

Detailed fix by platform

Linux

  1. redis-cli TYPE session:42

How to diagnose

  1. Key — Which key and command?
  2. Type — TYPE key result

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

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 (Redis)BullMQ: Missing lock …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 (Redis)BUSY Redis is busy ru…Celery with Redis: tasks run twice (visibility_timeout) — Celery: Task executed twice / Restoring unacked messages — Redis broker visibility_timeout shorter than task ETA (Redis)Celery with Redis: ta…CROSSSLOT Keys in request don't hash to the same slot — Redis Cluster: (error) CROSSSLOT Keys in request don't hash to the same slot (Redis)CROSSSLOT Keys in req…DEP0005 — DeprecationWarning: Buffer() is deprecated due to security and usability issues (DEP0005) (Node.js)DEP0005DEP0040 — DeprecationWarning: The `punycode` module is deprecated (DEP0040) (Node.js)DEP0040EADDRINUSE — Error: listen EADDRINUSE: address already in use :::3000 (Node.js)EADDRINUSEERR value is not an integer or out of range — Redis: (error) ERR value is not an integer or out of range (Redis)ERR value is not an i…WRONGTYPE

Explore the map of this error Full error map →

🧠 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.