DBAtlas · Database operations atlas

ERR Error compiling script (new function): Error compiling Lua script

Redis

What does it mean?

The Lua script sent with EVAL could not be compiled by Redis's embedded Lua interpreter. It was rejected before execution started because the script contains a syntax error.

Why does it happen?

Syntax errors in the Lua script: unclosed parentheses/quotes, misspelled keywords, a missing 'end', invalid operators or an unsupported Lua construct. Incorrect concatenation/escaping of the script on the client side can also trigger it.

How to fix it

Fix the Lua syntax using the line/character information in the error message (check matching parentheses, quotes and 'end'). Validate the script by compiling it in a separate Lua environment. Make sure the client builds the script correctly (no escaping/concatenation errors). Preload validated scripts with SCRIPT LOAD and call them with EVALSHA.

Open in DBAtlas →

More from this engine