[GH-ISSUE #154] [Bug Report] ConnectionRefusedError: [Errno 111] Connection refused #137

Closed
opened 2026-02-27 04:57:46 +03:00 by kerem · 3 comments
Owner

Originally created by @carlyd95 on GitHub (Jan 20, 2026).
Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/154

Originally assigned to: @Googolplexed0 on GitHub.

Zotify Version
v0.15.1 (new-hierarchy)

Bug Description
Program immediately exits with Connection refused error.

Bug Triggering Command
sudo -u pi /home/pi/.local/bin/zotify -f tz.txt --download-format mp3 --download-quality very_high --root-path /media/pi/X9/DJ/Music --output "{artist} - {song_name}" --download-real-time True --md-save-genres True --client-id XXXXXXXXXXXXXXXXXX --debug

Error Traceback / Logs

OUTPUT:

`DEBUG
### config_DEBUG.json saved to /home/pi/.config/zotify ###
### zotify_DEBUG_2026-01-19_23-37-56.log logging to /media/pi/X9/DJ/Music ###

[●∙∙] Logging in...
Click on the following link to login:
https://accounts.spotify.com/authorize?response_type=code&client_id=XXXXXXXXXXXXXXXXXXXXXXX&redirect_uri=http://127.0.0.1:4381/login&code_challenge=XXXXXXXXXXXXXXXXXXXXX&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...
Traceback (most recent call last):
File "/home/pi/.local/bin/zotify", line 7, in
sys.exit(main())
^^^^^^
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/main.py", line 142, in main
Zotify.configure(args)
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/config.py", line 739, in configure
Zotify.login(args)
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/config.py", line 695, in login
cls.SESSION = session_builder.create()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/librespot/core.py", line 1669, in create
session = Session(
^^^^^^^^
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/librespot/core.py", line 929, in init
self.connection = Session.ConnectionHolder.create(address, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/librespot/core.py", line 1910, in create
sock.connect((ap_address, ap_port))
ConnectionRefusedError: [Errno 111] Connection refused`

DEBUG:

zotify_DEBUG_2026-01-19_23-37-56.log

Config File
config_DEBUG.json

Additional Context
This error does not always occur but perhaps it could be handled and have it try again.

Originally created by @carlyd95 on GitHub (Jan 20, 2026). Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/154 Originally assigned to: @Googolplexed0 on GitHub. **Zotify Version** v0.15.1 (new-hierarchy) **Bug Description** Program immediately exits with Connection refused error. **Bug Triggering Command** sudo -u pi /home/pi/.local/bin/zotify -f tz.txt --download-format mp3 --download-quality very_high --root-path /media/pi/X9/DJ/Music --output "{artist} - {song_name}" --download-real-time True --md-save-genres True --client-id XXXXXXXXXXXXXXXXXX --debug **Error Traceback / Logs** ### OUTPUT: `DEBUG \### config_DEBUG.json saved to /home/pi/.config/zotify ### \### zotify_DEBUG_2026-01-19_23-37-56.log logging to /media/pi/X9/DJ/Music ### \[●∙∙] Logging in... Click on the following link to login: https://accounts.spotify.com/authorize?response_type=code&client_id=XXXXXXXXXXXXXXXXXXXXXXX&redirect_uri=http://127.0.0.1:4381/login&code_challenge=XXXXXXXXXXXXXXXXXXXXX&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... Traceback (most recent call last): File "/home/pi/.local/bin/zotify", line 7, in <module> sys.exit(main()) ^^^^^^ File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/__main__.py", line 142, in main Zotify.configure(args) File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/config.py", line 739, in configure Zotify.login(args) File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/config.py", line 695, in login cls.SESSION = session_builder.create() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/librespot/core.py", line 1669, in create session = Session( ^^^^^^^^ File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/librespot/core.py", line 929, in __init__ self.connection = Session.ConnectionHolder.create(address, None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/librespot/core.py", line 1910, in create sock.connect((ap_address, ap_port)) ConnectionRefusedError: [Errno 111] Connection refused` ### DEBUG: [zotify_DEBUG_2026-01-19_23-37-56.log](https://github.com/user-attachments/files/24727953/zotify_DEBUG_2026-01-19_23-37-56.log) **Config File** [config_DEBUG.json](https://github.com/user-attachments/files/24727970/config_DEBUG.json) **Additional Context** This error does not always occur but perhaps it could be handled and have it try again.
kerem 2026-02-27 04:57:46 +03:00
Author
Owner

@Googolplexed0 commented on GitHub (Jan 20, 2026):

Will add a catcher for this specific error and possibly a retry mechanism.

<!-- gh-comment-id:3773936349 --> @Googolplexed0 commented on GitHub (Jan 20, 2026): Will add a catcher for this specific error and possibly a retry mechanism.
Author
Owner

@Googolplexed0 commented on GitHub (Jan 21, 2026):

Added with github.com/Googolplexed0/zotify@ee88dfca80

<!-- gh-comment-id:3776206534 --> @Googolplexed0 commented on GitHub (Jan 21, 2026): Added with https://github.com/Googolplexed0/zotify/commit/ee88dfca800042a971ae0df6ebbb7a04aa99ad1b
Author
Owner

@carlyd95 commented on GitHub (Jan 21, 2026):

@Googolplexed0 Thank you! 😄

<!-- gh-comment-id:3776255403 --> @carlyd95 commented on GitHub (Jan 21, 2026): @Googolplexed0 Thank you! 😄
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/zotify#137
No description provided.