**TL;DR:** Rotate Upstash tokens by resetting the database password, then redistribute. Audit every place the old token lived. Generate the new credential: reset the database password in the console. Update secret stores first, then redeploy or restart every consumer.

## The fix

1. A standard token appeared anywhere client side or in a log.

2. Team member with access leaves.

3. Periodic hygiene, at whatever cadence your policy sets.

4. Inventory every place the token lives: env vars, secret managers, CI secrets, wrangler secrets, local env files, hardcoded fallbacks (fix those separately).

5. Generate the new credential: reset the database password in the console. This revokes both the standard and read-only tokens at once.

6. Update secret stores first, then redeploy or restart every consumer. Keep the rollout tight: between reset and redeploy, old tokens fail closed.

7. For ACL setups, re-mint per-user tokens with ACL RESTTOKEN after the reset.

8. One database per environment (dev, staging, prod) so a rotation never touches prod while you practice on dev.

9. Read-only tokens for anything client facing: they cannot write, so a leak is contained.

10. Per-user ACL tokens for humans and services instead of sharing the standard token.

## When to use this

- You are seeing this exact error message; match the block above, not just part of it.
- The failing call matches the scenario in the title: Rotating Upstash tokens.
- You want the fastest verified fix before digging through logs.

## When not to use this

- Your error text differs from the block above; close cousins often have different causes.
- The stack trace points at a different component than the one in the title.
- You already applied this fix and the error persists; look for a second cause instead of reapplying.

## Compatibility

- Not pinned to a specific version; follows current Rotating behavior.