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

Couldn't connect to the Discord IPC socket on Ubuntu 22.04 #23

Closed
echelon opened this issue Oct 18, 2022 · 4 comments
Closed

Couldn't connect to the Discord IPC socket on Ubuntu 22.04 #23

echelon opened this issue Oct 18, 2022 · 4 comments

Comments

@echelon
Copy link

echelon commented Oct 18, 2022

This appears to be the same issue as #2

I'm running this on vanilla Ubuntu 22.04 and am receiving "Couldn't connect to the Discord IPC socket".

Desktop Discord client version:

Stable 152532 (a118a24) Host 0.0.20 Linux 64-Bit (5.15.0-48-Generic)

rustc 1.64.0

discord-rich-presence = "0.2.3"

Linux 5.15.0-48-generic #54-Ubuntu SMP Fri Aug 26 13:26:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

I'll be happy to provide more details.

@Rayrsn
Copy link

Rayrsn commented Oct 18, 2022

Are you running a flatpak or snap version of discord by any chance? because they're known to to be problematic with sockets since they're contained/sandboxed
Flatpak Issue. (Solution?)
Snap Issue.

@echelon
Copy link
Author

echelon commented Oct 18, 2022

Thanks for the info, @Rayrsn !

I've tested running the app as both an Ubuntu Snap and as Discord's provided Debian package, which I assume does not use Flatpak. Both of them are failing to perform IPC.

I can see why the Snap package isn't working, but I'm not sure what's up with the Debian package.

Here's the process running as installed from a deb:

ps -lAf | grep discord

4 S bt        810175    3001  2  80   0 - 9635938 do_pol 15:22 ?      00:00:37 /usr/share/discord/Discord
0 S bt        810179  810175  0  80   0 - 55525 do_pol 15:22 ?        00:00:00 /usr/share/discord/Discord --type=zygote --no-zygote-sandbox
4 S bt        810180  810175  0  80   0 - 55525 do_wai 15:22 ?        00:00:00 /usr/share/discord/Discord --type=zygote
1 S bt        810182  810180  0  80   0 - 55525 do_pol 15:22 ?        00:00:00 /usr/share/discord/Discord --type=zygote
...

Here are the socket files it's attempting to utilize for IPC:

"/run/user/1000/discord-ipc-0"
"/run/user/1000/discord-ipc-1"
"/run/user/1000/discord-ipc-2"
"/run/user/1000/discord-ipc-3"
"/run/user/1000/discord-ipc-4"
"/run/user/1000/discord-ipc-5"
"/run/user/1000/discord-ipc-6"
"/run/user/1000/discord-ipc-7"
"/run/user/1000/discord-ipc-8"
"/run/user/1000/discord-ipc-9"

And that directory shows the socket file as existing,

find /run/user/1000/ | grep discord
/run/user/1000/discord-ipc-0
/run/user/1000/snap.discord
/run/user/1000/snap.discord/.org.chromium.Chromium.ZzV6Er
/run/user/1000/snap.discord/.org.chromium.Chromium.ZzV6Er/discord1_2.png
/run/user/1000/snap.discord/discord-ipc-0
/run/user/1000/snap.discord/.org.chromium.Chromium.kowpPo
/run/user/1000/snap.discord/.org.chromium.Chromium.kowpPo/SS
...

But it's a broken symlink!

ls -lA /run/user/1000/discord-ipc-0
lrwxrwxrwx 1 bt bt 55 Oct 18 15:47 /run/user/1000/discord-ipc-0 -> /run/user/1000/app/com.discordapp.Discord/discord-ipc-0

ls -lA /run/user/1000/app/com.discordapp.Discord/discord-ipc-0
ls: cannot access '/run/user/1000/app/com.discordapp.Discord/discord-ipc-0': No such file or directory

Not sure what happened here or what app caused this state.

I deleted it, restarted, and everything works!

Edit: Not sure where the broken symlink came from, or if this is your library's responsibility or opportunity to ameliorate.

@vionya
Copy link
Owner

vionya commented Oct 20, 2022

I deleted it, restarted, and everything works!

To clarify, is this referring to deleting the broken symlink and then restarting Discord?

In any case, I can tell you that the library does not create symlinks at any point, it only looks for open pipes under the given paths. It is possible that the broken symlink was created by a Flatpak installation of Discord, and wasn't overwritten by the Debian package.

Sorry for the late response!

@echelon
Copy link
Author

echelon commented Oct 21, 2022

To clarify, is this referring to deleting the broken symlink and then restarting Discord?

Correct

It is possible that the broken symlink was created by a Flatpak installation of Discord

It was probably the Snap version of Discord that did this. I used a fresh Ubuntu system and confirmed that I only installed and ran Ubuntu's Snap and Discord's own .deb.

This is a Snap problem and there's nothing for you to do. I'll close the issue.

Thanks for the help!

@echelon echelon closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2022
@echelon echelon closed this as completed Oct 21, 2022
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