Documentation Index
Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Symptom
You are trying to connect to your Upstash Redis database using a read-only token via a TCP client (such asredis-cli, ioredis, or redis-py), but you receive an authentication error similar to:
Diagnosis
When you enable the Read-Only Token toggle in the Upstash Console, the TCP connection strings update the username fromdefault to default_ro. This change can be easy to miss.
If you copied the read-only password but are still connecting with the default username (or omitting the username entirely), authentication will fail because the read-only password is associated with the default_ro user.
Solution 1: Use the default_ro Username
The simplest approach is to use the built-in default_ro user. When you enable the Read-Only Token in the console, the connection strings automatically switch to use this user.
Make sure your connection includes both the default_ro username and the read-only password:
redis-cli:
Solution 2: Create a Custom Read-Only ACL User
If you need more control over permissions, you can create a custom user with read-only access using Redis ACL. 1. Connect with your admin credentials:on— enables the user>somesecurepassword— sets the password~*— allows access to all keys&*— allows access to all pub/sub channels+@read— grants all read commands-@dangerous— revokes dangerous commands (such asKEYS,SCAN)
~* with a pattern like ~cache:* to only allow reading keys that match that prefix.
3. Connect with the new user: