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

Fails to connect to pipe on macOS #59

Open
Injazz opened this issue Apr 2, 2019 · 13 comments
Open

Fails to connect to pipe on macOS #59

Injazz opened this issue Apr 2, 2019 · 13 comments
Labels
bug Something isn't working

Comments

@Injazz
Copy link

Injazz commented Apr 2, 2019

while it works perfect on windows and linux, i fail to connect on macos.
It spams the following:

ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc--1. Error on creating named pipe: error code -1
WARN: Tried to close a already closed pipe.
ERR : Failed to connect for some reason.
@Lachee
Copy link
Owner

Lachee commented Apr 3, 2019

snap.discord aaagh, another sandbox enviroment.
Okay, can you please open your Discord console and tell me what is says for the following:
[RPCServer:IPC] Starting on ________

You can open your Discord console by pressing ctrl + shift + i

@Lachee Lachee added the bug Something isn't working label Apr 3, 2019
@Injazz
Copy link
Author

Injazz commented Apr 3, 2019

[RPCServer:IPC] Starting on /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T/discord-ipc-0

@ghost
Copy link

ghost commented Apr 3, 2019

So i guess it connects to the wrong place?

Shouldnt the path here

[RPCServer:IPC] Starting on /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T/discord-ipc-0

be instead of the path it tries to connect to but fails.

while it works perfect on windows and linux, i fail to connect on macos.
It spams the following:

ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc--1. Error on creating named pipe: error code -1
WARN: Tried to close a already closed pipe.
ERR : Failed to connect for some reason.

@ghost
Copy link

ghost commented Apr 3, 2019

So I guess one thing you could try to do is change the path that it connects too

@Injazz
Copy link
Author

Injazz commented Apr 3, 2019

case PlatformID.Unix:
case PlatformID.MacOSX:
Logger.Trace("PIPE UNIX / MACOSX");
return GetEnviromentTemp() + "/" + sandbox + string.Format(PIPE_NAME, pipe);

well, macos is unix, right? (mono thinks so sometimes)
case PlatformID.Unix:
return "snap.discord/";

https://www.mono-project.com/docs/faq/technical/#how-to-detect-the-execution-platform

@Injazz
Copy link
Author

Injazz commented Apr 3, 2019

better use this
System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.OSX);

@Lachee
Copy link
Owner

Lachee commented Apr 3, 2019

Can you give the entire log leading up to it failing? The snap.discord is normal and is it just trying sandbox enviroments additionally.

@Injazz
Copy link
Author

Injazz commented Apr 3, 2019

INFO: Attempting a new connection
Thread started: Discord IPC Thread #2
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-0
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/5.16.1/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll [External]
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-0. Asynchronous pipe mode is not supported
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-0
[DEBG] root: Switching to state SS14.Client.State.States.MainScreen
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-0. Error on creating named pipe: error code -1
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-1
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-1. Asynchronous pipe mode is not supported
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-1
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-1. Error on creating named pipe: error code -1
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-2
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-2. Asynchronous pipe mode is not supported
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-2
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-2. Error on creating named pipe: error code -1
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-3
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-3. Asynchronous pipe mode is not supported
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-3
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-3. Error on creating named pipe: error code -1
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-4
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-4. Asynchronous pipe mode is not supported
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-4
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-4. Error on creating named pipe: error code -1
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-5
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-5. Asynchronous pipe mode is not supported
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-5
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-5. Error on creating named pipe: error code -1
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-6
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-6. Asynchronous pipe mode is not supported
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-6
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-6. Error on creating named pipe: error code -1
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-7
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-7. Asynchronous pipe mode is not supported
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-7
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-7. Error on creating named pipe: error code -1
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-8
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-8. Asynchronous pipe mode is not supported
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-8
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-8. Error on creating named pipe: error code -1
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-9
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc-9. Asynchronous pipe mode is not supported
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-9
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc-9. Error on creating named pipe: error code -1
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc--1
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//discord-ipc--1. Asynchronous pipe mode is not supported
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc--1
ERR : Failed connection to /var/folders/xc/wbs6jsyx4dq8_nd06b2zjg600000gr/T//snap.discord/discord-ipc--1. Error on creating named pipe: error code -1
WARN: Tried to close a already closed pipe.
ERR : Failed to connect for some reason.

Lachee added a commit that referenced this issue Apr 3, 2019
Hopefully this will fix one of the issues in #59
@Lachee
Copy link
Owner

Lachee commented Apr 3, 2019

Alrighty, hopefully a fix to the issue. Can you please give that a try?

@Injazz
Copy link
Author

Injazz commented Apr 3, 2019

still fails to connect, but the path is correct now, i guess it's the same issue as #54, although I got it worked on linux without unitynamedpipe

@Injazz
Copy link
Author

Injazz commented Apr 3, 2019

Linux (Arch):

[INFO] discord: Attempting a new connection
[INFO] discord: Attempting to connect to /run/user/1000/discord-ipc-0
[DEBG] root: Switching to state SS14.Client.State.States.MainScreen
[INFO] discord: Connected to /run/user/1000/discord-ipc-0
[INFO] discord: Handling Response. Cmd: Dispatch, Event: Ready
[INFO] discord: Connection established with the RPC
[INFO] discord: Connected to discord with user User
[INFO] discord: Handling Response. Cmd: SetActivity, Event: 
[INFO] discord: Presence has been updated! 
[INFO] discord: Handling Response. Cmd: SetActivity, Event: 
[INFO] discord: Presence has been updated! 

@GeneUNCG
Copy link

GeneUNCG commented May 31, 2020

I'm getting the same issue on Windows 10 as well.

ERR : Failed connection to discord-ipc-0. Access to the path is denied.
WARN: Tried to close a already closed pipe.
ERR : Failed connection to discord-ipc-1. The operation has timed out.
WARN: Tried to close a already closed pipe.

DiscordRichPresence version: 1.0.150
Newtonsoft.Json version: 12.0.3
Project's .NET Version: 4.8

@Lachee
Copy link
Owner

Lachee commented Jun 1, 2020

Are you running discord?

@Lachee Lachee added this to Low priority in Weekend Bug Fix Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Weekend Bug Fix
  
Low priority
Development

No branches or pull requests

3 participants