[GH-ISSUE #138] mpd-discord-rpc.service doesn't reconnect if discord is restarted. #565

Closed
opened 2026-05-22 23:58:35 +01:00 by JakeStanger · 3 comments
Owner

Originally created by @codeiimon on GitHub (Jun 17, 2024).
Original GitHub issue: https://github.com/JakeStanger/mpd-discord-rpc/issues/138

When the mpd-discord-rpc is enabled, the doesn't automatically connect to discord if it is run after or if the client is restarted. Rather systemctl --user status restart mpd-discord-rpc.service outputs this error:

Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715461Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715486Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715507Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715527Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715548Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715570Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715592Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715614Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715635Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715656Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })

The current way i fix this is by restarting the service with discord using the command vesktop %U && systemctl --user restart mpd-discord-rpc.service. Its a bit hacky tho, and I would rather not have to do this.

It also runs this indefinitely, creating a massive journalctl log file full of errors. I'm not sure if that was the intention, but it'd be nice if there was a cleaner implementation.

I'm Currently on NixOS 24.05.

Originally created by @codeiimon on GitHub (Jun 17, 2024). Original GitHub issue: https://github.com/JakeStanger/mpd-discord-rpc/issues/138 When the mpd-discord-rpc is enabled, the doesn't automatically connect to discord if it is run after or if the client is restarted. Rather `systemctl --user status restart mpd-discord-rpc.service` outputs this error: ``` Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715461Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" }) Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715486Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" }) Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715507Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" }) Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715527Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" }) Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715548Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" }) Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715570Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" }) Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715592Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" }) Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715614Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" }) Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715635Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" }) Jun 14 12:54:50 nixos mpd-discord-rpc[243427]: 2024-06-14T18:54:50.715656Z ERROR discord_presence::connection::manager: Failed to connect: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" }) ``` The current way i fix this is by restarting the service with discord using the command vesktop %U && systemctl --user restart mpd-discord-rpc.service. Its a bit hacky tho, and I would rather not have to do this. It also runs this indefinitely, creating a massive journalctl log file full of errors. I'm not sure if that was the intention, but it'd be nice if there was a cleaner implementation. I'm Currently on NixOS 24.05.
Author
Owner

@42willow commented on GitHub (Nov 2, 2024):

I'm also on 24.05 with mpd-discord-rpc v1.7.2

For me it automatically reconnects to discord after the client is launched but uses a huge amount of processing power and creates the errors you described indefinitely when the discord client is not running
image

image

When discord is running it is fine though.
Seems to be related to #137

<!-- gh-comment-id:2452830479 --> @42willow commented on GitHub (Nov 2, 2024): I'm also on 24.05 with mpd-discord-rpc v1.7.2 For me it automatically reconnects to discord after the client is launched but uses a huge amount of processing power and creates the errors you described indefinitely when the discord client is not running ![image](https://github.com/user-attachments/assets/3378ca7a-5f4e-44ef-856e-76f9681bf889) ![image](https://github.com/user-attachments/assets/86d8eb7c-85f3-4d86-af4b-6e984fa8c5ab) When discord is running it is fine though. Seems to be related to #137
Author
Owner

@JakeStanger commented on GitHub (Nov 16, 2024):

This does not occur for me on v1.7.3 or latest -git. The discord-presence crate responsible for (re-)connecting was updated several times during this period. Can you ensure you are on the latest version and check if this is still an issue please.

EDIT: CPU problems were resolved, looks like it does not reliably re-connect on -git so looking at that now.

<!-- gh-comment-id:2480832947 --> @JakeStanger commented on GitHub (Nov 16, 2024): This does not occur for me on v1.7.3 or latest -git. The `discord-presence` crate responsible for (re-)connecting was updated several times during this period. Can you ensure you are on the latest version and check if this is still an issue please. EDIT: CPU problems were resolved, looks like it does not reliably re-connect on -git so looking at that now.
Author
Owner

@JakeStanger commented on GitHub (Feb 13, 2025):

Resolved by 59f7ddf291

<!-- gh-comment-id:2657612661 --> @JakeStanger commented on GitHub (Feb 13, 2025): Resolved by 59f7ddf291ad54515e9f5199cf289f7489a3dbf1
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
JakeStanger/mpd-discord-rpc#565
No description provided.