FG
🗄️ Databases

LUA eval not recognizing key slot

Freshalmost 11 years ago
Mar 14, 20260 views
Confidence Score86%
86%

Problem

I am using the cluster access capabilities of ioredis. Running scripts that SET data are working, but when trying to run a simple GET: "return redis.call('GET', 'foo')" the client is not able to recognize where the key "foo" is stored in the cluster. Is there a way to do this besides parsing CLUSTER SLOTS to find the keyslot for foo manually?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: LUA eval not recognizing key slot

Low Risk

you cant really do that, you need to supply keys amount to defineCommand, all the keys passed to LUA script must be on the same machine and this is the only way you can use lua scripts on the cluster, you cant make calls to other machines from lua scripts either, check the tutorial on the redis cluster

84

Trust Score

1 verification

100% success
  1. 1

    you cant really do that, you need to supply keys amount to defineCommand, all th

    you cant really do that, you need to supply keys amount to defineCommand, all the keys passed to LUA script must be on the same machine and this is the only way you can use lua scripts on the cluster, you cant make calls to other machines from lua scripts either, check the tutorial on the redis cluster

Validation

Resolved in redis/ioredis GitHub issue #62. Community reactions: 0 upvotes.

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

redisiorediscache