[GH-ISSUE #301] Spotify-Player only is able to connect once after restart #160

Closed
opened 2026-03-02 23:45:06 +03:00 by kerem · 5 comments
Owner

Originally created by @a-usr on GitHub (Nov 27, 2023).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/301

Describe the bug
As already Described in #296, The player only is able to connect to the web api once per OS restart. If i quit or the player fails to start, it is unable to connect once more unless i reboot. I suspect this is because the player doesn't close its connections properly, however as I dont have any knowledge of the inner workings of your program or am able to understand rust, i cant really tell for sure.

To Reproduce

  • Start your Windows machine and log in.
  • Start Spotify Player
  • Observe that it sucessfully connects
  • Try to restart Spotify Player
  • Observe that it throws an os error 10060 (remote server appears to not react to syn package)
  • OPTIONAL: Log out, Log back in and try again
  • OPTIONAL: Observe that nothing changed
  • Reboot Windows machine
  • Start Spotify Player
  • Observe that it works again
  • Restart Spotify Player
  • Observe that it fails for the same reason

Expected behavior
Spotify Player Succeeds to connect on every atttempt

Log and backtrace
Most recent Log:

2023-11-27T08:39:32.004089Z  INFO spotify_player: General configurations: AppConfig { theme: "dracula", client_id: "65b708073fc0480ea92a077233ca87bd", client_port: 8080, copy_command: Command { command: "clip", args: [] }, player_event_hook_command: None, playback_format: "{track} • {artists}\n{album}\n{metadata}", tracks_playback_limit: 50, proxy: None, ap_port: None, app_refresh_duration_in_ms: 32, playback_refresh_duration_in_ms: 0, page_size_in_rows: 20, play_icon: "▶", pause_icon: "▌▌", liked_icon: "♥", border_type: Plain, progress_bar_type: Rectangle, playback_window_position: Top, playback_window_width: 6, enable_media_control: true, enable_streaming: Always, enable_cover_image_cache: true, default_device: "spotify-player", device: DeviceConfig { name: "spotify-player", device_type: "speaker", volume: 70, bitrate: 320, audio_cache: false, normalization: false } }
2023-11-27T08:39:32.004273Z  INFO spotify_player: Theme configurations: ThemeConfig { themes: [Theme { name: "default", palette: Palette { background: None, foreground: None, black: Color { color: Black }, blue: Color { color: LightBlue }, cyan: Color { color: LightCyan }, green: Color { color: LightGreen }, magenta: Color { color: LightMagenta }, red: Color { color: LightRed }, white: Color { color: Gray }, yellow: Color { color: LightYellow }, bright_black: Color { color: DarkGray }, bright_white: Color { color: White }, bright_red: Color { color: Red }, bright_magenta: Color { color: Magenta }, bright_green: Color { color: Green }, bright_cyan: Color { color: Cyan }, bright_blue: Color { color: Blue }, bright_yellow: Color { color: Yellow } }, component_style: ComponentStyle { block_title: None, border: None, playback_track: None, playback_artists: None, playback_album: None, playback_metadata: None, playback_progress_bar: None, current_playing: None, page_desc: None, table_header: None, selection: None } }] }
2023-11-27T08:39:32.004319Z  INFO spotify_player: Keymap configurations: KeymapConfig { keymaps: [Keymap { key_sequence: KeySequence { keys: [None(Char('n'))] }, command: NextTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('p'))] }, command: PreviousTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('.'))] }, command: PlayRandom }, Keymap { key_sequence: KeySequence { keys: [None(Char(' '))] }, command: ResumePause }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('r'))] }, command: Repeat }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('s'))] }, command: Shuffle }, Keymap { key_sequence: KeySequence { keys: [None(Char('+'))] }, command: VolumeUp }, Keymap { key_sequence: KeySequence { keys: [None(Char('-'))] }, command: VolumeDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('_'))] }, command: Mute }, Keymap { key_sequence: KeySequence { keys: [None(Char('>'))] }, command: SeekForward }, Keymap { key_sequence: KeySequence { keys: [None(Char('<'))] }, command: SeekBackward }, Keymap { key_sequence: KeySequence { keys: [None(Enter)] }, command: ChooseSelected }, Keymap { key_sequence: KeySequence { keys: [None(Char('r'))] }, command: RefreshPlayback }, Keymap { key_sequence: KeySequence { keys: [None(Char('/'))] }, command: Search }, Keymap { key_sequence: KeySequence { keys: [None(Char('z'))] }, command: Queue }, Keymap { key_sequence: KeySequence { keys: [None(Char('Z'))] }, command: AddSelectedItemToQueue }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char(' '))] }, command: ShowActionsOnSelectedItem }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('a'))] }, command: ShowActionsOnSelectedItem }, Keymap { key_sequence: KeySequence { keys: [None(Char('a'))] }, command: ShowActionsOnCurrentTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('R'))] }, command: RestartIntegratedClient }, Keymap { key_sequence: KeySequence { keys: [None(Tab)] }, command: FocusNextWindow }, Keymap { key_sequence: KeySequence { keys: [None(BackTab)] }, command: FocusPreviousWindow }, Keymap { key_sequence: KeySequence { keys: [None(Char('T'))] }, command: SwitchTheme }, Keymap { key_sequence: KeySequence { keys: [None(Char('D'))] }, command: SwitchDevice }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('p'))] }, command: BrowseUserPlaylists }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('a'))] }, command: BrowseUserFollowedArtists }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('A'))] }, command: BrowseUserSavedAlbums }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char(' '))] }, command: CurrentlyPlayingContextPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('t'))] }, command: TopTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('r'))] }, command: RecentlyPlayedTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('y'))] }, command: LikedTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('l'))] }, command: LibraryPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('s'))] }, command: SearchPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('b'))] }, command: BrowsePage }, Keymap { key_sequence: KeySequence { keys: [None(Backspace)] }, command: PreviousPage }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('q'))] }, command: PreviousPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('?'))] }, command: OpenCommandHelp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('h'))] }, command: OpenCommandHelp }, Keymap { key_sequence: KeySequence { keys: [None(Char('q'))] }, command: Quit }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('c'))] }, command: Quit }, Keymap { key_sequence: KeySequence { keys: [None(Esc)] }, command: ClosePopup }, Keymap { key_sequence: KeySequence { keys: [None(Char('j'))] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('n'))] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Down)] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('k'))] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('p'))] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(Up)] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(PageUp)] }, command: PageSelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('b'))] }, command: PageSelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(PageDown)] }, command: PageSelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('f'))] }, command: PageSelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('g'))] }, command: SelectFirstOrScrollToTop }, Keymap { key_sequence: KeySequence { keys: [None(Home)] }, command: SelectFirstOrScrollToTop }, Keymap { key_sequence: KeySequence { keys: [None(Char('G'))] }, command: SelectLastOrScrollToBottom }, Keymap { key_sequence: KeySequence { keys: [None(End)] }, command: SelectLastOrScrollToBottom }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('t'))] }, command: SortTrackByTitle }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('a'))] }, command: SortTrackByArtists }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('A'))] }, command: SortTrackByAlbum }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('d'))] }, command: SortTrackByDuration }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('D'))] }, command: SortTrackByAddedDate }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('r'))] }, command: ReverseTrackOrder }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('k'))] }, command: MovePlaylistItemUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('j'))] }, command: MovePlaylistItemDown }] }

Most recent backtrace:
empty

Console output (Localized to German):

Error: Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat. (os error 10060)
Please check your internet connection.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment

  • OS: Windows
  • Application version: 0.15.2
  • Application features: ...

Additional context
Used the Github Release Build

Originally created by @a-usr on GitHub (Nov 27, 2023). Original GitHub issue: https://github.com/aome510/spotify-player/issues/301 **Describe the bug** As already Described in #296, The player only is able to connect to the web api once per OS restart. If i quit or the player fails to start, it is unable to connect once more unless i reboot. I suspect this is because the player doesn't close its connections properly, however as I dont have any knowledge of the inner workings of your program or am able to understand rust, i cant really tell for sure. **To Reproduce** - Start your Windows machine and log in. - Start Spotify Player - Observe that it sucessfully connects - Try to restart Spotify Player - Observe that it throws an os error 10060 (remote server appears to not react to syn package) - OPTIONAL: Log out, Log back in and try again - OPTIONAL: Observe that nothing changed - Reboot Windows machine - Start Spotify Player - Observe that it works again - Restart Spotify Player - Observe that it fails for the same reason **Expected behavior** Spotify Player Succeeds to connect on every atttempt **Log and backtrace** Most recent Log: ``` 2023-11-27T08:39:32.004089Z INFO spotify_player: General configurations: AppConfig { theme: "dracula", client_id: "65b708073fc0480ea92a077233ca87bd", client_port: 8080, copy_command: Command { command: "clip", args: [] }, player_event_hook_command: None, playback_format: "{track} • {artists}\n{album}\n{metadata}", tracks_playback_limit: 50, proxy: None, ap_port: None, app_refresh_duration_in_ms: 32, playback_refresh_duration_in_ms: 0, page_size_in_rows: 20, play_icon: "▶", pause_icon: "▌▌", liked_icon: "♥", border_type: Plain, progress_bar_type: Rectangle, playback_window_position: Top, playback_window_width: 6, enable_media_control: true, enable_streaming: Always, enable_cover_image_cache: true, default_device: "spotify-player", device: DeviceConfig { name: "spotify-player", device_type: "speaker", volume: 70, bitrate: 320, audio_cache: false, normalization: false } } 2023-11-27T08:39:32.004273Z INFO spotify_player: Theme configurations: ThemeConfig { themes: [Theme { name: "default", palette: Palette { background: None, foreground: None, black: Color { color: Black }, blue: Color { color: LightBlue }, cyan: Color { color: LightCyan }, green: Color { color: LightGreen }, magenta: Color { color: LightMagenta }, red: Color { color: LightRed }, white: Color { color: Gray }, yellow: Color { color: LightYellow }, bright_black: Color { color: DarkGray }, bright_white: Color { color: White }, bright_red: Color { color: Red }, bright_magenta: Color { color: Magenta }, bright_green: Color { color: Green }, bright_cyan: Color { color: Cyan }, bright_blue: Color { color: Blue }, bright_yellow: Color { color: Yellow } }, component_style: ComponentStyle { block_title: None, border: None, playback_track: None, playback_artists: None, playback_album: None, playback_metadata: None, playback_progress_bar: None, current_playing: None, page_desc: None, table_header: None, selection: None } }] } 2023-11-27T08:39:32.004319Z INFO spotify_player: Keymap configurations: KeymapConfig { keymaps: [Keymap { key_sequence: KeySequence { keys: [None(Char('n'))] }, command: NextTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('p'))] }, command: PreviousTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('.'))] }, command: PlayRandom }, Keymap { key_sequence: KeySequence { keys: [None(Char(' '))] }, command: ResumePause }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('r'))] }, command: Repeat }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('s'))] }, command: Shuffle }, Keymap { key_sequence: KeySequence { keys: [None(Char('+'))] }, command: VolumeUp }, Keymap { key_sequence: KeySequence { keys: [None(Char('-'))] }, command: VolumeDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('_'))] }, command: Mute }, Keymap { key_sequence: KeySequence { keys: [None(Char('>'))] }, command: SeekForward }, Keymap { key_sequence: KeySequence { keys: [None(Char('<'))] }, command: SeekBackward }, Keymap { key_sequence: KeySequence { keys: [None(Enter)] }, command: ChooseSelected }, Keymap { key_sequence: KeySequence { keys: [None(Char('r'))] }, command: RefreshPlayback }, Keymap { key_sequence: KeySequence { keys: [None(Char('/'))] }, command: Search }, Keymap { key_sequence: KeySequence { keys: [None(Char('z'))] }, command: Queue }, Keymap { key_sequence: KeySequence { keys: [None(Char('Z'))] }, command: AddSelectedItemToQueue }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char(' '))] }, command: ShowActionsOnSelectedItem }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('a'))] }, command: ShowActionsOnSelectedItem }, Keymap { key_sequence: KeySequence { keys: [None(Char('a'))] }, command: ShowActionsOnCurrentTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('R'))] }, command: RestartIntegratedClient }, Keymap { key_sequence: KeySequence { keys: [None(Tab)] }, command: FocusNextWindow }, Keymap { key_sequence: KeySequence { keys: [None(BackTab)] }, command: FocusPreviousWindow }, Keymap { key_sequence: KeySequence { keys: [None(Char('T'))] }, command: SwitchTheme }, Keymap { key_sequence: KeySequence { keys: [None(Char('D'))] }, command: SwitchDevice }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('p'))] }, command: BrowseUserPlaylists }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('a'))] }, command: BrowseUserFollowedArtists }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('A'))] }, command: BrowseUserSavedAlbums }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char(' '))] }, command: CurrentlyPlayingContextPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('t'))] }, command: TopTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('r'))] }, command: RecentlyPlayedTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('y'))] }, command: LikedTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('l'))] }, command: LibraryPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('s'))] }, command: SearchPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('b'))] }, command: BrowsePage }, Keymap { key_sequence: KeySequence { keys: [None(Backspace)] }, command: PreviousPage }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('q'))] }, command: PreviousPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('?'))] }, command: OpenCommandHelp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('h'))] }, command: OpenCommandHelp }, Keymap { key_sequence: KeySequence { keys: [None(Char('q'))] }, command: Quit }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('c'))] }, command: Quit }, Keymap { key_sequence: KeySequence { keys: [None(Esc)] }, command: ClosePopup }, Keymap { key_sequence: KeySequence { keys: [None(Char('j'))] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('n'))] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Down)] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('k'))] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('p'))] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(Up)] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(PageUp)] }, command: PageSelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('b'))] }, command: PageSelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(PageDown)] }, command: PageSelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('f'))] }, command: PageSelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('g'))] }, command: SelectFirstOrScrollToTop }, Keymap { key_sequence: KeySequence { keys: [None(Home)] }, command: SelectFirstOrScrollToTop }, Keymap { key_sequence: KeySequence { keys: [None(Char('G'))] }, command: SelectLastOrScrollToBottom }, Keymap { key_sequence: KeySequence { keys: [None(End)] }, command: SelectLastOrScrollToBottom }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('t'))] }, command: SortTrackByTitle }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('a'))] }, command: SortTrackByArtists }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('A'))] }, command: SortTrackByAlbum }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('d'))] }, command: SortTrackByDuration }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('D'))] }, command: SortTrackByAddedDate }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('r'))] }, command: ReverseTrackOrder }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('k'))] }, command: MovePlaylistItemUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('j'))] }, command: MovePlaylistItemDown }] } ``` Most recent backtrace: empty Console output (Localized to German): ``` Error: Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat. (os error 10060) Please check your internet connection. ``` **Screenshots** If applicable, add screenshots to help explain your problem. **Environment** - OS: Windows - Application version: 0.15.2 - Application features: ... **Additional context** Used the Github Release Build
kerem 2026-03-02 23:45:06 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@a-usr commented on GitHub (Nov 27, 2023):

Upon fiddling around a bit, the Connection issue seems irrelevant, as moving the credentials.json in spotify-player's .cache, starting it, stopping it by Keyboard Interrupt to cancel the the retrieval of credentials, and then moving the credentials.json back solves the issue for 1 start. however a restart of the player still bring up the same error.

<!-- gh-comment-id:1827430945 --> @a-usr commented on GitHub (Nov 27, 2023): Upon fiddling around a bit, the Connection issue seems irrelevant, as moving the credentials.json in spotify-player's .cache, starting it, stopping it by Keyboard Interrupt to cancel the the retrieval of credentials, and then moving the credentials.json back solves the issue for 1 start. however a restart of the player still bring up the same error.
Author
Owner

@a-usr commented on GitHub (Nov 27, 2023):

Is there maybe some temporary directory that is read from instead if the credentials.json exists in the cache?

<!-- gh-comment-id:1827431607 --> @a-usr commented on GitHub (Nov 27, 2023): Is there maybe some temporary directory that is read from instead if the credentials.json exists in the cache?
Author
Owner

@a-usr commented on GitHub (Nov 27, 2023):

Alright, this issue seems to be fixed in the current version of the player. Please do build a new release. Thank you

Closing this as completed.

<!-- gh-comment-id:1827432038 --> @a-usr commented on GitHub (Nov 27, 2023): Alright, this issue seems to be fixed in the current version of the player. Please do build a new release. Thank you Closing this as completed.
Author
Owner

@a-usr commented on GitHub (Nov 27, 2023):

I take back what i said, in the current version the error just stays for some reason regardless of what i do (rebooting etc)

<!-- gh-comment-id:1827502354 --> @a-usr commented on GitHub (Nov 27, 2023): I take back what i said, in the current version the error just stays for some reason regardless of what i do (rebooting etc)
Author
Owner

@a-usr commented on GitHub (Nov 27, 2023):

ok, i am super confused rn, but it appears that my machine is prevented from connecting to certain ports on any server by my firewall. This doesnt make any sense, however since this is not an issue on your side, I'll close this issue

<!-- gh-comment-id:1827644569 --> @a-usr commented on GitHub (Nov 27, 2023): ok, i am super confused rn, but it appears that my machine is prevented from connecting to certain ports on any server by my firewall. This doesnt make any sense, however since this is not an issue on your side, I'll close this issue
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#160
No description provided.