Skip to content

Misleading spotify: rate limited on v1/me error likely caused by stale/corrupted local Spotify cache state #184

@liujinb96

Description

@liujinb96

Description

I encountered a persistent Spotify loading failure in cliamp with the following error:

spotify: rate limited on v1/me

However, this does not appear to be an actual Spotify API rate-limit issue.

The error persisted for more than 6 hours, which suggests it was not a temporary 429 / retry-window condition.
The issue was resolved immediately after deleting the following files:

rm ~/.config/cliamp/spotify_credentials.json
rm ~/.config/cliamp/resume.json

After restarting cliamp and re-authenticating Spotify, Spotify integration worked normally again.

Why this seems misleading

A genuine Spotify rate-limit response should recover after the retry window expires and typically would not require deleting local cache/session files.

This behavior suggests the reported error may actually be triggered by stale/corrupted local Spotify auth or session state rather than a real rate-limit response.

Suspected Cause

Possible causes include:
• stale/invalid Spotify OAuth token cache
• corrupted refresh token state
• invalid Spotify playback/session restoration data in resume.json
• non-429 Spotify initialization failures being surfaced as a generic rate limited on v1/me error

Observed Behavior

The observed behavior are as follws:
1. Spotify integration had been working normally
2. exit and reopen cliamp suddenly began returning: spotify: rate limited on v1/me
3. Waiting several hours did not resolve the issue
4. Deleting the cache/session files above immediately restored functionality

Suggested Improvement

Consider improving Spotify error handling/logging to:
• distinguish actual HTTP 429 rate-limit responses from auth/cache/session failures
• surface more precise error messages for invalid local Spotify cache state
• optionally auto-detect and invalidate corrupted Spotify cache/session files

Environment

The environment information are:
• cliamp version: v1.35.1
• OS: macOS Tahoe 26.4.1
• Spotify account: Premium
• Spotify app type: Development Mode Web API app

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions