ERR value is not an integer or out of range: ERR value is not an integer or out of range(值不是整数或超出范围)
Redis含义
需要整数的命令(如 INCR、EXPIRE、LPOP count)收到了非数字或超出范围的值。Redis 无法将该值解释为整数。
原因
INCR/DECR 针对的键持有文本(非整数)值、参数以文本而非数字形式给出、数字相对范围过大/过小,或在不允许的地方使用了负值。
解决方法
检查键的值:GET mykey 和 TYPE mykey。对于数值操作,确保键持有整数值。确认参数是在正确范围内的有效整数。必要时重置该值(SET mykey 0)或以正确类型重新创建。
同一数据库的其他条目
- NOSCRIPTNOSCRIPT No matching script. Please use EVAL(没有匹配的脚本。请使用 EVAL)
- EXECABORTEXECABORT Transaction discarded because of previous errors(由于之前的错误,事务已被丢弃)
- NOPERMNOPERM this user has no permissions to run the command or access one of the keys(该用户无权运行此命令或访问其中某个键)
- ERR value is not a valid floatERR value is not a valid float(值不是有效的浮点数)
- ERR increment or decrement would overflowERR increment or decrement would overflow(递增或递减将导致溢出)
- ERR max number of clients reachedERR max number of clients reached(已达到最大客户端数)
- BUSYKEYBUSYKEY Target key name already exists(目标键名已存在)