[GH-ISSUE #839] Error: CLI tool does not start up #1438

Open
opened 2026-03-14 14:56:43 +03:00 by kerem · 5 comments
Owner

Originally created by @ralph on GitHub (Sep 26, 2025).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/839

Describe the bug
The CLI tool does nothing when I start it, it just hangs until I hit CTRL-C.

To Reproduce
On MacOS:

  • Install via homebrew
  • Run spotify_player authenticate and allow to connect
  • Run spotify_player -> Nothing happens

Expected behaviour
I expect to see the TUI of spotify_player.

Log and backtrace
The log has just 1 line with the config:

2025-09-26T11:11:49.495115Z  INFO spotify_player: Configurations: Configs { app_config: AppConfig { theme: "dracula", client_id: None, client_id_command: None, client_port: 8080, login_redirect_uri: "http://127.0.0.1:8989/login", log_folder: Some("/Users/ralph/.cache/spotify-player"), player_event_hook_command: None, playback_format: …

Screenshots

Image

Environment

  • OS: MacOS 26.0
  • Application version: spotify_player 0.21.1
  • Application features: image, notify (See home-brew formula)

Additional context
I tried with and without using a client_id in the config. When using a client_id in the config, it was correctly picked up in the logs (client_id: Some("12345")), but spotify_player authenticate would still use the default token (65b7...).

All backtrace files were empty.

Am I doing anything wrong? 🤔

Originally created by @ralph on GitHub (Sep 26, 2025). Original GitHub issue: https://github.com/aome510/spotify-player/issues/839 **Describe the bug** The CLI tool does nothing when I start it, it just hangs until I hit CTRL-C. **To Reproduce** On MacOS: * Install via homebrew * Run `spotify_player authenticate` and allow to connect * Run `spotify_player` -> Nothing happens **Expected behaviour** I expect to see the TUI of spotify_player. **Log and backtrace** The log has just 1 line with the config: ``` 2025-09-26T11:11:49.495115Z INFO spotify_player: Configurations: Configs { app_config: AppConfig { theme: "dracula", client_id: None, client_id_command: None, client_port: 8080, login_redirect_uri: "http://127.0.0.1:8989/login", log_folder: Some("/Users/ralph/.cache/spotify-player"), player_event_hook_command: None, playback_format: … ``` **Screenshots** <img width="548" height="166" alt="Image" src="https://github.com/user-attachments/assets/b090a158-bfaf-407f-836f-ec8741607180" /> **Environment** - OS: MacOS 26.0 - Application version: `spotify_player 0.21.1` - Application features: image, notify (See [home-brew formula](https://github.com/Homebrew/homebrew-core/blob/dd4dbeae267d7299164125b7bf585ee4cd5f4753/Formula/s/spotify_player.rb#L32)) **Additional context** I tried with and without using a client_id in the config. When using a client_id in the config, it was correctly picked up in the logs (`client_id: Some("12345")`), but `spotify_player authenticate` would still use the default token (`65b7...`). All backtrace files were empty. Am I doing anything wrong? 🤔
Author
Owner

@James-Steve commented on GitHub (Sep 29, 2025):

I have the same exact issue, got it working temporally but has failed again

System

Fedora Linux 42
Installed Via: Cargo Install --locked
Audio: PipeWire - WirePlumber - PipeWirePulse

Note

Was working a month or two ago and now having this issue.
I suspect it has something to do with the Cache of Saved Songs

Steps Taken to fix

Uninstalled Via Cargo:

  • Reinstalled -> Same Issue
  • Reinstalled: --no-default-features --features pulseaudio-backend -> Same Issue, but doesn't spawn an audio client
  • Reinstalled: same as above but deleted config folder and cache folder -> Works (Took forever), breaks when restart

Logs

2025-09-29T08:19:03.735881Z INFO spotify_player::state::data: Loading Playlists data from /home/jim/.cache/spotify player/Playlists_cache.json... 2025-09-29T08:19:03.736233Z INFO spotify_player::state::data: Successfully loaded Playlists data! 2025-09-29T08:19:03.736267Z INFO spotify_player::state::data: Loading FollowedArtists data from /home/jim/.cache/spotify-player/FollowedArtists_cache.json... 2025-09-29T08:19:03.736496Z INFO spotify_player::state::data: Successfully loaded FollowedArtists data! 2025-09-29T08:19:03.736521Z INFO spotify_player::state::data: Loading SavedShows data from /home/jim/.cache/spotify-player/SavedShows_cache.json... 2025-09-29T08:19:03.736609Z INFO spotify_player::state::data: Successfully loaded SavedShows data! 2025-09-29T08:19:03.736630Z INFO spotify_player::state::data: Loading SavedAlbums data from /home/jim/.cache/spotify-player/SavedAlbums_cache.json... 2025-09-29T08:19:03.736675Z INFO spotify_player::state::data: Successfully loaded SavedAlbums data! 2025-09-29T08:19:03.736695Z INFO spotify_player::state::data: Loading SavedTracks data from /home/jim/.cache/spotify-player/SavedTracks_cache.json... 2025-09-29T08:19:03.748140Z INFO spotify_player::state::data: Successfully loaded SavedTracks data! 2025-09-29T08:19:03.822064Z INFO spotify_player::auth: Using cached credentials 2025-09-29T08:19:03.822116Z INFO spotify_player::streaming: Application's connect configurations: ConnectConfig { name: "spotify-player", device_type: Speaker, is_group: false, initial_volume: 45875, disable_volume: false, volume_steps: 64 } 2025-09-29T08:19:03.822180Z INFO librespot_playback::mixer::softmixer: Mixing with softvol and volume control: Log(60.0) 2025-09-29T08:19:03.822228Z INFO spotify_player::streaming: Initializing a new integrated player with device_id=13cc5ebd-467e-4a4f-b02b-6f4afddd301c 2025-09-29T08:19:03.822429Z INFO spotify_player::streaming: Starting an integrated Spotify player using librespot's spirc protocol 2025-09-29T08:19:03.822527Z INFO librespot_playback::convert: Converting with ditherer: tpdf 2025-09-29T08:19:03.822568Z INFO librespot_playback::audio_backend::pulseaudio: Using PulseAudioSink with format: S16 2025-09-29T08:19:04.617490Z INFO librespot_core::session: Connecting to AP "ap-gew1.spotify.com:4070"

<!-- gh-comment-id:3345425046 --> @James-Steve commented on GitHub (Sep 29, 2025): I have the same exact issue, got it working temporally but has failed again ### System Fedora Linux 42 Installed Via: Cargo Install --locked Audio: PipeWire - WirePlumber - PipeWirePulse ### Note Was working a month or two ago and now having this issue. I suspect it has something to do with the Cache of Saved Songs ### Steps Taken to fix Uninstalled Via Cargo: - Reinstalled -> Same Issue - Reinstalled: --no-default-features --features pulseaudio-backend -> Same Issue, but doesn't spawn an audio client - Reinstalled: same as above but deleted config folder and cache folder -> Works (Took forever), breaks when restart ### Logs `2025-09-29T08:19:03.735881Z INFO spotify_player::state::data: Loading Playlists data from /home/jim/.cache/spotify player/Playlists_cache.json... 2025-09-29T08:19:03.736233Z INFO spotify_player::state::data: Successfully loaded Playlists data! 2025-09-29T08:19:03.736267Z INFO spotify_player::state::data: Loading FollowedArtists data from /home/jim/.cache/spotify-player/FollowedArtists_cache.json... 2025-09-29T08:19:03.736496Z INFO spotify_player::state::data: Successfully loaded FollowedArtists data! 2025-09-29T08:19:03.736521Z INFO spotify_player::state::data: Loading SavedShows data from /home/jim/.cache/spotify-player/SavedShows_cache.json... 2025-09-29T08:19:03.736609Z INFO spotify_player::state::data: Successfully loaded SavedShows data! 2025-09-29T08:19:03.736630Z INFO spotify_player::state::data: Loading SavedAlbums data from /home/jim/.cache/spotify-player/SavedAlbums_cache.json... 2025-09-29T08:19:03.736675Z INFO spotify_player::state::data: Successfully loaded SavedAlbums data! 2025-09-29T08:19:03.736695Z INFO spotify_player::state::data: Loading SavedTracks data from /home/jim/.cache/spotify-player/SavedTracks_cache.json... 2025-09-29T08:19:03.748140Z INFO spotify_player::state::data: Successfully loaded SavedTracks data! 2025-09-29T08:19:03.822064Z INFO spotify_player::auth: Using cached credentials 2025-09-29T08:19:03.822116Z INFO spotify_player::streaming: Application's connect configurations: ConnectConfig { name: "spotify-player", device_type: Speaker, is_group: false, initial_volume: 45875, disable_volume: false, volume_steps: 64 } 2025-09-29T08:19:03.822180Z INFO librespot_playback::mixer::softmixer: Mixing with softvol and volume control: Log(60.0) 2025-09-29T08:19:03.822228Z INFO spotify_player::streaming: Initializing a new integrated player with device_id=13cc5ebd-467e-4a4f-b02b-6f4afddd301c 2025-09-29T08:19:03.822429Z INFO spotify_player::streaming: Starting an integrated Spotify player using librespot's spirc protocol 2025-09-29T08:19:03.822527Z INFO librespot_playback::convert: Converting with ditherer: tpdf 2025-09-29T08:19:03.822568Z INFO librespot_playback::audio_backend::pulseaudio: Using PulseAudioSink with format: S16 2025-09-29T08:19:04.617490Z INFO librespot_core::session: Connecting to AP "ap-gew1.spotify.com:4070"`
Author
Owner

@ralph commented on GitHub (Sep 29, 2025):

Thanks for chiming in! After reading your report, I tried again after deleting both ~/.cache/spotify-player and .config/spotify-player, but no success. :(

I also tried version 0.20.7, which does start up, but seems to fail to retrieve a proper token:

2025-09-29T13:55:45.719715Z  INFO spotify_player::token: Getting a new authentication token...
2025-09-29T13:55:45.739181Z ERROR librespot_core::mercury: error 403 for uri hm://keymaster/token/authenticated?scope=user-read-recently-played,user-top-read,user-read-playback-position,user-read-playback-state,user-modify-playback-state,user-read-currently-playing,streaming,playlist-read-private,playlist-modify-private,playlist-modify-public,playlist-read-collaborative,user-follow-read,user-follow-modify,user-library-read,user-library-modify&client_id=12345&device_id=56789
2025-09-29T13:55:45.739249Z ERROR spotify_player::client::spotify: Failed to get a new token: failed to get the token: Service unavailable { error handling Mercury response: MercuryResponse { uri: "hm://keymaster/token/authenticated?scope=user-read-recently-played,user-top-read,user-read-playback-position,user-read-playback-state,user-modify-playback-state,user-read-currently-playing,streaming,playlist-read-private,playlist-modify-private,playlist-modify-public,playlist-read-collaborative,user-follow-read,user-follow-modify,user-library-read,user-library-modify&client_id= 12345&device_id= 56789", status_code: 403, payload: [[123, 34, 99, 111, 100, 101, 34, 58, 52, 44, 34, 101, 114, 114, 111, 114, 68, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 34, 58, 34, 73, 110, 118, 97, 108, 105, 100, 32, 114, 101, 113, 117, 101, 115, 116, 34, 125]] } }
2025-09-29T13:55:45.739313Z  INFO spotify_player: Starting a client socket at 127.0.0.1:8080
2025-09-29T13:55:45.739399Z ERROR client_request{request=GetUserSavedShows}: spotify_player::client::handlers: Failed to handle client request: Token is not valid
2025-09-29T13:55:45.739400Z ERROR client_request{request=GetCurrentUser}: spotify_player::client::handlers: Failed to handle client request: Token is not valid
2025-09-29T13:55:45.739434Z ERROR client_request{request=GetUserFollowedArtists}: spotify_player::client::handlers: Failed to handle client request: Token is not valid
2025-09-29T13:55:45.739433Z ERROR client_request{request=GetUserSavedAlbums}: spotify_player::client::handlers: Failed to handle client request: Token is not valid
2025-09-29T13:55:45.739443Z ERROR client_request{request=GetUserSavedTracks}: spotify_player::client::handlers: Failed to handle client request: Token is not valid
2025-09-29T13:55:45.739398Z  INFO client_request{request=GetUserPlaylists}: spotify_player::token: Getting a new authentication token...

I guess this is what's fixed according to the release note in 0.21? Except at least for me, the app does not start any more.

<!-- gh-comment-id:3347164487 --> @ralph commented on GitHub (Sep 29, 2025): Thanks for chiming in! After reading your report, I tried again after deleting both `~/.cache/spotify-player` and `.config/spotify-player`, but no success. :( I also tried version 0.20.7, which does start up, but seems to fail to retrieve a proper token: ``` 2025-09-29T13:55:45.719715Z INFO spotify_player::token: Getting a new authentication token... 2025-09-29T13:55:45.739181Z ERROR librespot_core::mercury: error 403 for uri hm://keymaster/token/authenticated?scope=user-read-recently-played,user-top-read,user-read-playback-position,user-read-playback-state,user-modify-playback-state,user-read-currently-playing,streaming,playlist-read-private,playlist-modify-private,playlist-modify-public,playlist-read-collaborative,user-follow-read,user-follow-modify,user-library-read,user-library-modify&client_id=12345&device_id=56789 2025-09-29T13:55:45.739249Z ERROR spotify_player::client::spotify: Failed to get a new token: failed to get the token: Service unavailable { error handling Mercury response: MercuryResponse { uri: "hm://keymaster/token/authenticated?scope=user-read-recently-played,user-top-read,user-read-playback-position,user-read-playback-state,user-modify-playback-state,user-read-currently-playing,streaming,playlist-read-private,playlist-modify-private,playlist-modify-public,playlist-read-collaborative,user-follow-read,user-follow-modify,user-library-read,user-library-modify&client_id= 12345&device_id= 56789", status_code: 403, payload: [[123, 34, 99, 111, 100, 101, 34, 58, 52, 44, 34, 101, 114, 114, 111, 114, 68, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 34, 58, 34, 73, 110, 118, 97, 108, 105, 100, 32, 114, 101, 113, 117, 101, 115, 116, 34, 125]] } } 2025-09-29T13:55:45.739313Z INFO spotify_player: Starting a client socket at 127.0.0.1:8080 2025-09-29T13:55:45.739399Z ERROR client_request{request=GetUserSavedShows}: spotify_player::client::handlers: Failed to handle client request: Token is not valid 2025-09-29T13:55:45.739400Z ERROR client_request{request=GetCurrentUser}: spotify_player::client::handlers: Failed to handle client request: Token is not valid 2025-09-29T13:55:45.739434Z ERROR client_request{request=GetUserFollowedArtists}: spotify_player::client::handlers: Failed to handle client request: Token is not valid 2025-09-29T13:55:45.739433Z ERROR client_request{request=GetUserSavedAlbums}: spotify_player::client::handlers: Failed to handle client request: Token is not valid 2025-09-29T13:55:45.739443Z ERROR client_request{request=GetUserSavedTracks}: spotify_player::client::handlers: Failed to handle client request: Token is not valid 2025-09-29T13:55:45.739398Z INFO client_request{request=GetUserPlaylists}: spotify_player::token: Getting a new authentication token... ``` I guess this is what's fixed according to the release note in 0.21? Except at least for me, the app does not start any more.
Author
Owner

@tifandotme commented on GitHub (Oct 3, 2025):

This does the trick:
TERM=xterm-256color spotify_player

I am using ghostty

fyi spotify_player get key playback works without overriding TERM

<!-- gh-comment-id:3366108112 --> @tifandotme commented on GitHub (Oct 3, 2025): This does the trick: `TERM=xterm-256color spotify_player` I am using ghostty fyi `spotify_player get key playback` works without overriding TERM
Author
Owner

@ralph commented on GitHub (Oct 10, 2025):

@tifandotme Great, I can confirm this works 🥳

I'm using tmux inside Ghostty, if that matters. Wouldn't have thought so, though.

<!-- gh-comment-id:3389097469 --> @ralph commented on GitHub (Oct 10, 2025): @tifandotme Great, I can confirm this works 🥳 I'm using tmux inside Ghostty, if that matters. Wouldn't have thought so, though.
Author
Owner

@richardhapb commented on GitHub (Feb 24, 2026):

I sometimes had the same issue.

I think this is related to this. I fixed that, and I believe it should work fine when the new release of rspotify is integrated into Spotify-Player.

https://github.com/ramsayleung/rspotify/pull/553

<!-- gh-comment-id:3954403006 --> @richardhapb commented on GitHub (Feb 24, 2026): I sometimes had the same issue. I think this is related to [this](https://github.com/ramsayleung/rspotify/issues/552). I fixed that, and I believe it should work fine when the new release of `rspotify` is integrated into `Spotify-Player`. https://github.com/ramsayleung/rspotify/pull/553
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#1438
No description provided.