Skip to content

404 only in CLI mode #464

Description

@hakuoku

Describe the bug
In player mode everything goes well, yet in CLI (especially a while after using the player) every attempt to play something or access playback fails. Similar problem exists in spotify-player but spotify-tui didin't show such problem.

To Reproduce
Steps to reproduce the behavior:

  1. Install with winget
  2. Complete authentication
  3. Run spotatui and exit
  4. After a while, run spotatui playback command
  5. See error

Expected behavior
want to use CLI mode not only just after running the player but also anytime.

Screenshots

PS C:\Users\Y****\Desktop> spotatui list --devices
Logging to: /tmp/spotatui_logs/spotatuilog12600
57% DESKTOP-R******
PS C:\Users\Y****\Desktop> spotatui playback --toggle --device DESKTOP-R******
Logging to: /tmp/spotatui_logs/spotatuilog16792
Error: Spotify API 404 Not Found failed: {
  "error" : {
    "status" : 404,
    "message" : "Player command failed: No active device found",
    "reason" : "NO_ACTIVE_DEVICE"
  }
}
PS C:\Users\Y****\Desktop> spotatui playback --toggle --device spotatui
Logging to: /tmp/spotatui_logs/spotatuilog19244
Error: Spotify API 404 Not Found failed: {
  "error" : {
    "status" : 404,
    "message" : "Player command failed: No active device found",
    "reason" : "NO_ACTIVE_DEVICE"
  }
}

spotatuilog12600

[2026-08-14][23:02:20][spotatui::runtime][INFO] spotatui 0.40.3 starting up
[2026-08-14][23:02:20][spotatui::runtime][INFO] audio backend initialized
[2026-08-14][23:02:20][spotatui::runtime][INFO] panic hook configured
[2026-08-14][23:02:20][spotatui::runtime][INFO] user config loaded successfully
[2026-08-14][23:02:20][spotatui::runtime][INFO] client authentication config loaded
[2026-08-14][23:02:20][spotatui::core::auth][INFO] authentication token loaded from cache
[2026-08-14][23:02:20][rspotify_http::reqwest][INFO] Making request RequestBuilder { method: POST, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("accounts.spotify.com")), port: None, path: "/api/token", query: None, fragment: None }, headers: {"content-type": "application/x-www-form-urlencoded"} }
[2026-08-14][23:02:20][spotatui::core::auth][INFO] token cached to C:\Users\Y****\.config\spotatui\.spotify_token_cache_d420a117.json
[2026-08-14][23:02:20][rspotify::clients::base][INFO] Token cache write ignored (not configured)
[2026-08-14][23:02:20][spotatui::core::auth][INFO] refreshed token cached to C:\Users\Y****\.config\spotatui\.spotify_token_cache_d420a117.json
[2026-08-14][23:02:20][rspotify_http::reqwest][INFO] Making request RequestBuilder { method: GET, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.spotify.com")), port: None, path: "/v1/me/", query: None, fragment: None }, headers: {"authorization": "Bearer ******"} }
[2026-08-14][23:02:21][spotatui::core::auth][INFO] Using ncspot shared client ID. If it breaks in the future, configure fallback_client_id in client.yml.
[2026-08-14][23:02:21][spotatui::runtime][WARN] Spotify signed in with the shared ncspot client ID. Your own app (3edb62aa…) is set as the fallback, so it is only used if the shared one stops working.
[2026-08-14][23:02:21][spotatui::core::auth][INFO] token cached to C:\Users\Y****\.config\spotatui\.spotify_token_cache_d420a117.json
[2026-08-14][23:02:21][spotatui::runtime][INFO] app state initialized
[2026-08-14][23:02:21][spotatui::tui::cover_art][INFO] cover art rendered detected a Sixel backend
[2026-08-14][23:02:21][spotatui::runtime][INFO] running in cli mode with command: list
[2026-08-14][23:02:21][spotatui::core::app][INFO] navigating to SelectedDevice

spotatuilog16792

[2026-08-14][23:03:03][spotatui::runtime][INFO] spotatui 0.40.3 starting up
[2026-08-14][23:03:03][spotatui::runtime][INFO] audio backend initialized
[2026-08-14][23:03:03][spotatui::runtime][INFO] panic hook configured
[2026-08-14][23:03:03][spotatui::runtime][INFO] user config loaded successfully
[2026-08-14][23:03:03][spotatui::runtime][INFO] client authentication config loaded
[2026-08-14][23:03:03][spotatui::core::auth][INFO] authentication token loaded from cache
[2026-08-14][23:03:03][rspotify_http::reqwest][INFO] Making request RequestBuilder { method: GET, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.spotify.com")), port: None, path: "/v1/me/", query: None, fragment: None }, headers: {"authorization": "Bearer ******"} }
[2026-08-14][23:03:04][spotatui::core::auth][INFO] Using ncspot shared client ID. If it breaks in the future, configure fallback_client_id in client.yml.
[2026-08-14][23:03:04][spotatui::runtime][WARN] Spotify signed in with the shared ncspot client ID. Your own app (3edb62aa…) is set as the fallback, so it is only used if the shared one stops working.
[2026-08-14][23:03:04][spotatui::core::auth][INFO] token cached to C:\Users\Y****\.config\spotatui\.spotify_token_cache_d420a117.json
[2026-08-14][23:03:04][spotatui::runtime][INFO] app state initialized
[2026-08-14][23:03:04][spotatui::tui::cover_art][INFO] cover art rendered detected a Sixel backend
[2026-08-14][23:03:04][spotatui::runtime][INFO] running in cli mode with command: playback
[2026-08-14][23:03:04][spotatui::core::app][INFO] navigating to SelectedDevice
[2026-08-14][23:03:04][spotatui::infra::network::requests][WARN] Spotify API PUT /v1/me/player/play -> 404 Not Found (attempt 1/4, token age 43s): {
  "error" : {
    "status" : 404,
    "message" : "Player command failed: No active device found",
    "reason" : "NO_ACTIVE_DEVICE"
  }
}
[2026-08-14][23:03:04][spotatui::core::app][INFO] error occurred: Spotify API 404 Not Found failed: {
  "error" : {
    "status" : 404,
    "message" : "Player command failed: No active device found",
    "reason" : "NO_ACTIVE_DEVICE"
  }
}
[2026-08-14][23:03:04][spotatui::core::app][INFO] navigating to Error

spotatuilog19244

[2026-08-14][23:03:15][spotatui::runtime][INFO] spotatui 0.40.3 starting up
[2026-08-14][23:03:15][spotatui::runtime][INFO] audio backend initialized
[2026-08-14][23:03:15][spotatui::runtime][INFO] panic hook configured
[2026-08-14][23:03:15][spotatui::runtime][INFO] user config loaded successfully
[2026-08-14][23:03:15][spotatui::runtime][INFO] client authentication config loaded
[2026-08-14][23:03:15][spotatui::core::auth][INFO] authentication token loaded from cache
[2026-08-14][23:03:15][rspotify_http::reqwest][INFO] Making request RequestBuilder { method: GET, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.spotify.com")), port: None, path: "/v1/me/", query: None, fragment: None }, headers: {"authorization": "Bearer ******"} }
[2026-08-14][23:03:15][spotatui::core::auth][INFO] Using ncspot shared client ID. If it breaks in the future, configure fallback_client_id in client.yml.
[2026-08-14][23:03:15][spotatui::runtime][WARN] Spotify signed in with the shared ncspot client ID. Your own app (3edb62aa…) is set as the fallback, so it is only used if the shared one stops working.
[2026-08-14][23:03:15][spotatui::core::auth][INFO] token cached to C:\Users\Y****\.config\spotatui\.spotify_token_cache_d420a117.json
[2026-08-14][23:03:15][spotatui::runtime][INFO] app state initialized
[2026-08-14][23:03:15][spotatui::tui::cover_art][INFO] cover art rendered detected a Sixel backend
[2026-08-14][23:03:15][spotatui::runtime][INFO] running in cli mode with command: playback
[2026-08-14][23:03:16][spotatui::core::app][INFO] navigating to SelectedDevice
[2026-08-14][23:03:16][spotatui::infra::network::requests][WARN] Spotify API PUT /v1/me/player/play -> 404 Not Found (attempt 1/4, token age 55s): {
  "error" : {
    "status" : 404,
    "message" : "Player command failed: No active device found",
    "reason" : "NO_ACTIVE_DEVICE"
  }
}
[2026-08-14][23:03:16][spotatui::core::app][INFO] error occurred: Spotify API 404 Not Found failed: {
  "error" : {
    "status" : 404,
    "message" : "Player command failed: No active device found",
    "reason" : "NO_ACTIVE_DEVICE"
  }
}
[2026-08-14][23:03:16][spotatui::core::app][INFO] navigating to Error

Desktop (please complete the following information):

  • OS: Windows 11 Pro 25H2 26200.9168
  • Terminal PowerShell 7.6.3
  • Version spotatui 0.40.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions