This error occurs when a Redis command is blocked by authentication, ACL permissions, or replica mode restrictions. It typically happens when credentials are missing, user permissions are insufficient, or you're trying to write to a read-only replica.
Redis returns this error when the requested operation is not allowed under the current security configuration. The most common cause is missing or invalid authentication, but it can also indicate insufficient user permissions in Redis 6.0+ ACL (Access Control List) settings, or an attempt to write to a read-only replica instance.
Connect to Redis and check if authentication is required:
redis-cli
> COMMANDIf you get "ERR operation not permitted" or see a "requirepass" in config, you need to authenticate first:
redis-cli
> AUTH your_password
OK
> PING
PONGIf using a client library, ensure you pass the password in the connection options.
If you're using Redis 6.0 or newer with ACL enabled, check your current user:
redis-cli
> AUTH username password
OK
> ACL WHOAMI
"username"
> ACL LISTReview the output to see what commands your user is allowed to execute. Look for lines starting with your username showing permissions like +@read, +@write, or +@all.
If your user is missing permissions, log in as an admin (or the default user) and grant them:
# For specific commands
ACL SETUSER myuser +get +set +del
# For command categories
ACL SETUSER myuser +@read +@write
# For all commands
ACL SETUSER myuser +@all
# For key patterns
ACL SETUSER myuser ~myprefix:*
# Save changes
ACL SAVEThen reconnect with the updated credentials.
Some client libraries may not re-send the AUTH command after a network timeout. If you see intermittent "operation not permitted" errors:
Node.js (redis):
const client = redis.createClient({
host: "localhost",
port: 6379,
password: "your_password",
// Ensure auth is re-sent on reconnect
});Python (redis-py):
import redis
r = redis.Redis(
host="localhost",
port=6379,
password="your_password",
decode_responses=True
)Update to the latest version of your Redis client library.
If write operations fail but reads succeed, you may be connected to a replica:
redis-cli
> INFO replication
# Replication
role:slaveIf this shows role:slave, you're on a replica. Write operations are not permitted on replicas. Connect to the master instead:
redis-cli -h master_hostname -p 6379
> AUTH password
> SET key value
OKFor applications, ensure your write operations target the master host.
If running Redis in Docker, permission errors may occur when persisting data:
# Ensure data directory exists with correct permissions
sudo mkdir -p ~/redis/data
sudo chown -R 999:999 ~/redis/data
sudo chmod -R 700 ~/redis/data
# Run container with proper volume mount
docker run -d \
-v ~/redis/data:/data \
-p 6379:6379 \
redis:latestThe 999:999 UID/GID is the default Redis user in official images. Verify with:
docker exec <container_id> idACL Best Practices: For production environments, create dedicated users with minimal required permissions rather than using the default user. Use key patterns to scope access (e.g., ~app:* restricts to keys prefixed with app:). Check ACL logs for unauthorized attempts: ACL LOG. Replication Setup: If using Redis replication, always write to the master and read from replicas. Some client libraries support read replicas automatically (like redis-py). TLS/mTLS: If Redis uses TLS certificates, ensure your client is configured for TLS connections as well. Legacy requirepass: Older Redis versions use requirepass in redis.conf instead of ACLs. Both mechanisms can cause this error if misconfigured.
ERR fsync error
How to fix "ERR fsync error" in Redis
CLUSTERDOWN The cluster is down
How to fix 'CLUSTERDOWN The cluster is down' in Redis
ERR Job for redis-server.service failed because a timeout was exceeded
Job for redis-server.service failed because a timeout was exceeded
ERR Unbalanced XREAD list of streams
How to fix "ERR Unbalanced XREAD list" in Redis
ERR syntax error
How to fix "ERR syntax error" in Redis