NOPERM error
The user is authenticated but isn't allowed to run the command or use the key.
Redis returns this error when you're authenticated, but your user's access control list (ACL) rules don't allow what you asked for. The message says what was refused, a command or a key:
NOPERM User app has no permissions to run the 'set' command
NOPERM No permissions to access a key
In redis-py, this error is NoPermissionError, followed by the message without the NOPERM prefix.
Example
The user app can only run GET, and only on keys that start with allowed::
> ACL SETUSER app on ><password> +get ~allowed:*
OK
> AUTH app <password>
OK
> SET allowed:1 "x"
(error) NOPERM User app has no permissions to run the 'set' command
> GET other
(error) NOPERM No permissions to access a key
How to fix it
- Find out what was refused. As an administrator, run
ACL LOG. Each entry shows the user, thereason, such ascommandorkey, and theobject, which is the command or key name. - Check which user your app is connected as with
ACL WHOAMI. - Connect as a user that has the permission, or change the user's rules with
ACL SETUSER. For example,ACL SETUSER app +setlets the user runSET, andACL SETUSER app ~otherlets it use the keyother.
See ACL rules and Key permissions.