ERR Error compiling script (new function): Error compiling Lua script
RedisWhat 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.
More from this engine
- ERR WAIT cannot be used with replica instancesWAIT cannot be used with replica instances
- ERR Background append only file rewriting already in progressAOF rewrite already in progress
- IOERR error or timeout reading from target instanceMIGRATE: I/O error or timeout to target
- ERR FAILOVER requires connected replicas.FAILOVER requires connected replicas
- ERR invalid expire time in 'set' commandinvalid expire time in SET