ERR DEBUG command not allowed: DEBUG command not allowed(不允许使用 DEBUG 命令)
Redis含义
您试图运行 DEBUG 命令,但服务器不允许。DEBUG 是底层的危险诊断命令;出于安全原因,较新的 Redis 版本默认禁用或限制该命令。
原因
在 Redis 7+ 中,未设置 enable-debug-command 时 DEBUG 子命令无法运行;托管云 Redis 服务通常完全禁用该命令;或该命令被 ACL 拒绝。测试/诊断脚本(例如 DEBUG SLEEP、DEBUG OBJECT)经常遇到此错误。
解决方法
避免在生产环境中使用 DEBUG。如果在本地/测试环境中确实需要,在配置中启用:在 redis.conf 中设置 enable-debug-command yes(或 'local')。在云服务上通常根本无法启用该命令;使用 MEMORY USAGE、OBJECT ENCODING 和 INFO 等安全命令获取等效信息。如果存在 ACL 限制,请检查权限。
同一数据库的其他条目
- ERR This instance has cluster support disabledERR This instance has cluster support disabled(此实例已禁用集群支持)
- ERR unknown subcommandERR unknown subcommand or wrong number of arguments(未知子命令或参数数量错误)
- ERR Client sent AUTH, but no password is setERR AUTH <password> called without any password configured for the default user (Redis 6+) / ERR Client sent AUTH, but no password is set (Redis <6)(调用了 AUTH,但服务器未配置密码)
- ERR Can't save in background: fork failedBackground save failed: fork failed(后台保存失败:fork 失败)
- NOPROTO unsupported protocol versionUnsupported RESP protocol version(不支持的 RESP 协议版本)
- ERR Unknown option or number of arguments for CONFIG SETUnknown option or number of arguments for CONFIG SET (older versions: Unsupported CONFIG parameter)(CONFIG SET 的选项未知或参数数量错误)
- ERR MULTI calls can not be nestedMULTI calls can not be nested(MULTI 调用不能嵌套)