Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Errno 111] Connection refused #65

Closed
v-127 opened this issue Jul 17, 2024 · 4 comments
Closed

[Errno 111] Connection refused #65

v-127 opened this issue Jul 17, 2024 · 4 comments

Comments

@v-127
Copy link

v-127 commented Jul 17, 2024

I get connection refused when it tries to create a new rich presence object

[nekkles@NekklesOS steam-presence]$ python3 main.py
----------------------------------------------------------
[Jul 17 2024 - 14:28:38] progam's current folder structure version is up to date...
----------------------------------------------------------
[Jul 17 2024 - 14:28:38] loading config file
[Jul 17 2024 - 14:28:38] intializing the SteamGrid database...
[Jul 17 2024 - 14:28:38] everything is ready!
----------------------------------------------------------
[Jul 17 2024 - 14:28:38] found game THE FINALS played by Nekkles
[Jul 17 2024 - 14:28:40] steam app ID 2073850 found for THE FINALS
[Jul 17 2024 - 14:28:41] game changed, updating to 'THE FINALS'
[Jul 17 2024 - 14:28:41] fetching the Discord game ID for THE FINALS
[Jul 17 2024 - 14:28:42] found the discord game ID for the finals
[Jul 17 2024 - 14:28:42] fetching icon for THE FINALS
[Jul 17 2024 - 14:28:42] found icon for THE FINALS in cache
[Jul 17 2024 - 14:28:42] creating new rich presence object for THE FINALS
Traceback (most recent call last):
  File "/home/nekkles/steam-presence/main.py", line 1201, in <module>
    main()
  File "/home/nekkles/steam-presence/main.py", line 1182, in main
    RPC.connect()
  File "/home/nekkles/.local/lib/python3.12/site-packages/pypresence/presence.py", line 43, in connect
    self.loop.run_until_complete(self.handshake())
  File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/nekkles/.local/lib/python3.12/site-packages/pypresence/baseclient.py", line 112, in handshake
    self.sock_reader, self.sock_writer = await asyncio.wait_for(asyncio.open_unix_connection(ipc_path), self.connection_timeout)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/streams.py", line 97, in open_unix_connection
    transport, _ = await loop.create_unix_connection(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/unix_events.py", line 261, in create_unix_connection
    await self.sock_connect(sock, path)
  File "/usr/lib/python3.12/asyncio/selector_events.py", line 651, in sock_connect
    return await fut
           ^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/selector_events.py", line 659, in _sock_connect
    sock.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused
@connerdavis47
Copy link

connerdavis47 commented Jul 25, 2024

Same here. Maybe a Python change caused this? Worked for me for several weeks until about a week ago, and I have had Arch distribute a few Python upgrades in that time, I think.

Jul 25 15:27:00 baine python[1887016]:     await self.sock_connect(sock, path)
Jul 25 15:27:00 baine python[1887016]:   File "/usr/lib/python3.12/asyncio/selector_events.py", line 651, in sock_connect
Jul 25 15:27:00 baine python[1887016]:     return await fut
Jul 25 15:27:00 baine python[1887016]:            ^^^^^^^^^
Jul 25 15:27:00 baine python[1887016]:   File "/usr/lib/python3.12/asyncio/selector_events.py", line 659, in _sock_connect
Jul 25 15:27:00 baine python[1887016]:     sock.connect(address)

It successfully detects the game I'm playing, but fails shortly after within about 5 seconds. Never updates Discord in that time, so seems like it's an issue connecting to Discord?

Jul 25 15:32:50 baine systemd[1071]: Started Discord rich presence from Steam on Linux.
Jul 25 15:32:50 baine python[1890441]: ----------------------------------------------------------
Jul 25 15:32:50 baine python[1890441]: [Jul 25 2024 - 15:32:50] progam's current folder structure version is up to date...
Jul 25 15:32:50 baine python[1890441]: ----------------------------------------------------------
Jul 25 15:32:50 baine python[1890441]: [Jul 25 2024 - 15:32:50] loading config file
Jul 25 15:32:50 baine python[1890441]: [Jul 25 2024 - 15:32:50] intializing the SteamGrid database...
Jul 25 15:32:50 baine python[1890441]: [Jul 25 2024 - 15:32:50] everything is ready!
Jul 25 15:32:50 baine python[1890441]: ----------------------------------------------------------
Jul 25 15:32:51 baine python[1890441]: [Jul 25 2024 - 15:32:51] found game Sekiro™: Shadows Die Twice played by ---

@JustTemmie
Copy link
Owner

i believe that your virtual environment breaks when your OS's python version got updated, you should be able to fix it by just deleting it and remaking it

rm -rf venv/
python3 -m venv venv/
./venv/bin/python -m pip install -r requirements.txt

@connerdavis47
Copy link

i believe that your virtual environment breaks when your OS's python version got updated, you should be able to fix it by just deleting it and remaking it

rm -rf venv/ python3 -m venv venv/ ./venv/bin/python -m pip install -r requirements.txt

Thanks for the reply! TBH, this didn't work for me initially but I've since restarted my computer and it just... kinda... works now? Not sure. I had also tried to reinstall before your suggestion which I think includes the step you suggested. Not sure what actually changed but I will take it :)

@JustTemmie
Copy link
Owner

seems fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants