Skip to content

[Bug Report] __authenticate_partial() TimeoutError No Packet Received #215

Description

@valk2143-blip

Zotify Version

0.17.2

Operating System

Windows 10

Python Version

Python 3.12

Bug-Triggering Command

zotify https://open.spotify.com/playlist/5seR0S9RTzv7vOIvpfAiaa?si=a8bed04e0a1c4d9d

Bug Description

Zotify can't get past the login. It tries logging in with the saved credentials, but always fails, so it sends me the link to login. If I delete the credentials file, it sends me the link, as expected. In both of these cases, after I go to the link, confirm my account and I see "librespot python received callback", Zotify gets stuck in "logging in" for quite some time, after which it throws out the error I included in the console output, which was pretty much all the console output it gave. Judging by the debug.log file I can only assume that it was connecting several times and it could get my account info, but no dice. I also did this with the Firewall off, as I thought it may be the cause for the connection issues, and also because it helped one time. I did manage to get Zotify working but only one time, and it was not complete. I choose a 500+song playlist and it downloaded 50, after which it could not get the metadata or api things it needs and suggested increasing the bulk wait time, which was already set to 10 seconds, but I think that's another issue that was probably solved. What I still don't understand is why it can't log in and do anything.

Upload config_DEBUG.json

config_DEBUG.json

Upload DEBUG.log

zotify_DEBUG_2026-04-25_20-32-58.log

Relevant Error Traceback

PS C:\Users\Valik> zotify https://open.spotify.com/playlist/5seR0S9RTzv7vOIvpfAiaa?si=a8bed04e0a1c4d9d --debug

DEBUG
###   config_DEBUG.json saved to C:\Users\Valik\AppData\Roaming\Zotify   ###
###   zotify_DEBUG_2026-04-25_20-32-58.log logging to C:\Users\Valik\Music\Zotify Music   ###

        [●∙∙] Logging in...                                                                                             
Click on the following link to login:
https://accounts.spotify.com/authorize?response_type=code&client_id=65b708073fc0480ea92a077233ca87bd&redirect_uri=http://127.0.0.1:4381/login&code_challenge=s7LosXDLIImjiPfEXAo7idEFVggiIrpLw_9q9F9ZM98&code_challenge_method=S256&scope=streaming+playlist-read-private+playlist-read-collaborative+user-follow-read+user-read-playback-position+user-top-read+user-read-recently-played+user-library-read+user-read-email+user-read-private

        [●∙∙] Logging in...                                                                                             
Exception in thread session-packet-receiver:
Traceback (most recent call last):
  File "C:\Users\Valik\AppData\Local\pipx\pipx\venvs\zotify\Lib\site-packages\librespot\crypto.py", line 59, in receive_encoded
    connection.read_exact(3))
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Valik\AppData\Local\pipx\pipx\venvs\zotify\Lib\site-packages\librespot\core.py", line 1946, in read_exact
    chunk = self.__socket.recv(remaining)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Valik\AppData\Local\pipx\pipx\venvs\zotify\Lib\site-packages\librespot\core.py", line 2054, in run
    packet = self.__session.cipher_pair.receive_encoded(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Valik\AppData\Local\pipx\pipx\venvs\zotify\Lib\site-packages\librespot\crypto.py", line 72, in receive_encoded
    raise RuntimeError("Failed to receive packet")
RuntimeError: Failed to receive packet

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Valik\AppData\Local\pipx\pipx\venvs\zotify\Lib\site-packages\librespot\crypto.py", line 59, in receive_encoded
    connection.read_exact(3))
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Valik\AppData\Local\pipx\pipx\venvs\zotify\Lib\site-packages\librespot\core.py", line 1946, in read_exact
    chunk = self.__socket.recv(remaining)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Valik\scoop\apps\python\3.12.2\Lib\threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "C:\Users\Valik\scoop\apps\python\3.12.2\Lib\threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Valik\AppData\Local\pipx\pipx\venvs\zotify\Lib\site-packages\librespot\core.py", line 2068, in run
    self.__session.reconnect()
  File "C:\Users\Valik\AppData\Local\pipx\pipx\venvs\zotify\Lib\site-packages\librespot\core.py", line 1253, in reconnect
    self.__authenticate_partial(
  File "C:\Users\Valik\AppData\Local\pipx\pipx\venvs\zotify\Lib\site-packages\librespot\core.py", line 1332, in __authenticate_partial
    packet = self.cipher_pair.receive_encoded(self.connection)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Valik\AppData\Local\pipx\pipx\venvs\zotify\Lib\site-packages\librespot\crypto.py", line 72, in receive_encoded
    rais[●∙∙] Logging in...                                                                                              untimeError: Failed to receive packet

Upload Screenshots

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions