Common Issues
Authentication Problems
Error: Not authenticated. Run 'sentry auth login' first.
Error: Not authenticated. Run 'sentry auth login' first.
-
Log in with OAuth:
-
Use an environment variable:
-
Use a token file (for CI/CD):
SENTRY_AUTH_TOKEN takes precedence over SENTRY_TOKEN and stored OAuth tokens.Error: Authentication expired. Run 'sentry auth login' to re-authenticate.
Error: Authentication expired. Run 'sentry auth login' to re-authenticate.
-
Re-authenticate:
-
Check token expiration:
-
Use a non-expiring token (for automation):
- Go to Sentry → Settings → Account → Auth Tokens
- Create a new auth token
- Set
SENTRY_AUTH_TOKENenvironment variable
Error: Session expired and no refresh token available.
Error: Session expired and no refresh token available.
- You manually edited the database
- The OAuth flow was interrupted
- The token was created before refresh token support was added
Context Resolution
Error: Organization is required.
Error: Organization is required.
-
Specify explicitly:
-
Set default organization:
-
Use DSN detection:
- Add a Sentry DSN to
.envin your project: - Or add it to your code (JavaScript example):
- Add a Sentry DSN to
-
Store a default:
Error: Organization and project are required.
Error: Organization and project are required.
-
Specify explicitly:
-
Set environment variables:
- Use DSN detection (see above)
-
Store defaults:
Database Errors
Error: attempt to write a readonly database
Error: attempt to write a readonly database
-
Check file permissions:
-
Check directory permissions:
-
Check if filesystem is read-only:
-
Use a custom config directory:
Error: no such table: [table_name]
Error: no such table: [table_name]
-
Let auto-repair fix it (default behavior):
- The CLI automatically detects and repairs schema issues
- Check the logs for “Auto-repaired database” messages
-
Manual repair:
-
Reset the database (last resort):
SENTRY_CLI_NO_AUTO_REPAIR=1 (not recommended).Error: no such column: [column_name]
Error: no such column: [column_name]
-
Upgrade to the latest CLI version:
- Let auto-repair add the column (automatic in most cases)
-
Reset the database:
API Errors
Error: Request failed with status 401
Error: Request failed with status 401
-
Check token validity:
-
Re-authenticate:
-
Verify token permissions (for auth tokens):
- Go to Sentry → Settings → Auth Tokens
- Ensure the token has the required scopes
- Check if the token is enabled and not expired
Error: Request failed with status 403
Error: Request failed with status 403
-
Check organization/project access:
- Verify you’re a member of the organization
- Check your role (some commands require admin/owner)
-
Verify auth token scopes:
- Org auth tokens may have limited scopes
- Use a user auth token or re-create the org token with broader scopes
-
Check if the resource exists:
Error: Request failed with status 404
Error: Request failed with status 404
-
Verify the resource exists:
-
Check spelling:
- Slugs are case-sensitive
- Use the exact slug from the Sentry web UI
-
Verify you have access:
- You may not be a member of the organization
- The project may be in a different organization
Self-Hosted Sentry
Error: OAuth requires SENTRY_CLIENT_ID for self-hosted instances
Error: OAuth requires SENTRY_CLIENT_ID for self-hosted instances
-
Create an OAuth application:
- Go to your Sentry instance → Settings → Developer Settings
- Click “Create New Application”
- Select “Public” application type
- Copy the client ID
-
Set the environment variables:
-
Log in:
Debugging Techniques
Enable Debug Logging
Get detailed information about what the CLI is doing:error: Only errorswarn: Errors and warningsinfo: Normal output (default)debug: Detailed debugging informationtrace: Very verbose (includes HTTP requests/responses)
Inspect the Database
Query the SQLite database directly:Test DSN Detection
Check if the CLI can detect your project’s DSN:Check Network Connectivity
Verify you can reach the Sentry API:Verify Token Format
Sentry auth tokens have specific formats:- User auth tokens: Start with
sntryu_ - Org auth tokens: Start with
sntrys_ - OAuth access tokens: Random alphanumeric (40+ characters)
Error Message Reference
CliError
Base class for all CLI errors. Generic format:ApiError
API request failures. Format:400: Bad request (invalid parameters)401: Unauthorized (authentication failed)403: Forbidden (insufficient permissions)404: Not found429: Rate limited500: Internal server error
AuthError
Authentication failures. Reasons:not_authenticated: No valid token foundexpired: Token has expiredinvalid: Token is malformed or rejected
ConfigError
Configuration issues. Format:ContextError
Missing required context (org/project). Format:ResolutionError
Failed to resolve a resource. Format:ValidationError
Invalid input. Format:DeviceFlowError
OAuth device flow failures. Common codes:authorization_pending: User hasn’t authorized yetslow_down: Polling too fastexpired_token: Device code expiredaccess_denied: User denied authorization
SeerError
Seer AI feature errors. Reasons:not_enabled: Seer not enabled for the organizationno_budget: Requires a paid planai_disabled: AI features disabled in organization settings
UpgradeError
CLI upgrade failures. Reasons:unknown_method: Cannot detect installation methodunsupported_operation: Operation not supported for this install methodnetwork_error: Failed to fetch version infoexecution_failed: Upgrade command failedversion_not_found: Specified version doesn’t exist
Performance Issues
Slow command execution
Slow command execution
- Network latency to Sentry API
- Large result sets (e.g., listing thousands of issues)
- Slow DSN detection (scanning many files)
-
Use pagination:
-
Skip DSN detection:
-
Use regional endpoints (automatic for SaaS):
- The CLI automatically detects and uses regional APIs
- Check
org_regionstable for cached regions
-
Check network latency:
High memory usage
High memory usage
- Large API responses
- Caching many projects
-
Clear caches:
-
Use streaming mode (for large result sets):
Getting Help
If you’re still experiencing issues:- Check the documentation:
-
Enable debug logging:
-
Report a bug:
- GitHub Issues: github.com/getsentry/sentry-cli
- Include:
- CLI version (
sentry --version) - Operating system
- Error message and full command
- Debug logs (with sensitive data redacted)
- CLI version (
-
Get community support:
- Sentry Discord: discord.gg/sentry
- Sentry Forum: forum.sentry.io