StackExchange / StackExchange/StackExchange.Redis

Invalid Lua script evaluation

Open
#2,273 6 comments 2 reactions 1 assignee View on GitHub

@mgravell is already working on this.

Since Oct 28, 2025.

⚙️ area:lua ❔ question
Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Hi, i'm calling this simple Lua script passing Redis key to get string value, but key is passed to the ARGV collection.
Also i've noticed that my key passed twice, first as an argument and then as a key. Profiler log provided below

var script = "return redis.call('get', @settingIdKey)");
var preparedScript = LuaScript.Prepare(script);

var redisResult = await database.ScriptEvaluateAsync(preparedScript, new
{
    settingIdKey = (RedisKey)"my key",
});

Profiler log:

"SCRIPT" "LOAD" "return redis.call('get', ARGV[1])"
"EVAL" "return redis.call('get', ARGV[1])" "1" "my key" "my key"
[0 lua] "get" "my key"

Based on the documentation it should treat it as a key

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.