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

Local client not Found on Mac M1 #50

Closed
deevo-sage opened this issue Sep 30, 2022 · 23 comments
Closed

Local client not Found on Mac M1 #50

deevo-sage opened this issue Sep 30, 2022 · 23 comments

Comments

@deevo-sage
Copy link

cannot seem to work i've tried reinstalling discord, event installed it from brew,

This issue persists on every discord presence plugin....

@aurieh
Copy link
Owner

aurieh commented Sep 30, 2022

Unfortunately I do not have an M1 Mac to test on: could you check if any files starting with discord-ipc- exist in the $TMPDIR directory?

@ObserverOfTime
Copy link
Contributor

discordjs/RPC#113 seems to have a solution of sorts.
The question is how do we implement that properly here?

What's the output of the following Python code?

print(__import__('tempfile').gettempdir())

@deevo-sage
Copy link
Author

discordjs/RPC#113 seems to have a solution of sorts. The question is how do we implement that properly here?

What's the output of the following Python code?

print(__import__('tempfile').gettempdir())

I got this as output

/var/folders/32/2h86y69920q2gcd7s7zv1s940000gn/T

@ObserverOfTime
Copy link
Contributor

Is discord-ipc-0 in that folder?

@deevo-sage
Copy link
Author

nope

@deevo-sage
Copy link
Author

deevo-sage commented Sep 30, 2022

lots of com.apple stuff gql-language service and some yarn folders etc

@ObserverOfTime
Copy link
Contributor

I'm assuming you've started Discord.

Does this script find the file?

find /private/var/folders -name "*discord-ipc*" || find /var/folders -name "*discord-ipc*"

@deevo-sage
Copy link
Author

/var/folders/32/2h86y69920q2gcd7s7zv1s940000gn/T/discord-ipc-0

image

it found it in the same directory

@ObserverOfTime
Copy link
Contributor

So had you not started Discord when you said "nope"? 🤔

@deevo-sage
Copy link
Author

it's been on for like last 5-6 hours, maybe wasn't able to see it in kitty, used warp and was clearer

@aurieh
Copy link
Owner

aurieh commented Sep 30, 2022

Unfortunately I do not have an M1 Mac to test on: could you check if any files starting with discord-ipc- exist in the $TMPDIR directory?

I'd still like you to check this by getting the output of ls -A "$(python3 -c "import os, os.path; print(next((os.environ.get(path, None) for path in ['XDG_RUNTIME_DIR', 'TMPDIR', 'TMP', 'TEMP'] if path in os.environ), '/tmp'))")". This is the logic used by the plugin to determine the directory of the IPC socket: it slightly differs from tempfile.gettempdir() (which we really should be using, but that is outside of this issue's scope).

@ObserverOfTime
Copy link
Contributor

I wouldn't say it's outside of the issue's scope if it potentially fixes the issue.

@deevo-sage
Copy link
Author

Unfortunately I do not have an M1 Mac to test on: could you check if any files starting with discord-ipc- exist in the $TMPDIR directory?

I'd still like you to check this by getting the output of ls -A "$(python3 -c "import os, os.path; print(next((os.environ.get(path, None) for path in ['XDG_RUNTIME_DIR', 'TMPDIR', 'TMP', 'TEMP'] if path in os.environ), '/tmp'))")". This is the logic used by the plugin to determine the directory of the IPC socket: it slightly differs from tempfile.gettempdir() (which we really should be using, but that is outside of this issue's scope).

its finding discord-ipc-0

@ObserverOfTime
Copy link
Contributor

Interesting. Why isn't it working then? 🤔

@deevo-sage
Copy link
Author

image

no idea XD

@ObserverOfTime
Copy link
Contributor

Maybe because you're using sudo?

@aurieh
Copy link
Owner

aurieh commented Sep 30, 2022

Indeed, the temporary directory for the root user is different from that of the regular user, which Discord is running as.

@deevo-sage
Copy link
Author

loads of red stuff like this just to ignore i use sudo i guess XD
image

it's working without sudo acutally

@ObserverOfTime
Copy link
Contributor

The file's in your home folder, just chown it.

@aurieh
Copy link
Owner

aurieh commented Sep 30, 2022

That particular error was most likely caused by the log file being created as root due to your previous use of sudo. As @ObserverOfTime already pointed out, you should be able to just chown "$(id -u):" it.

It is inadvisable to use your editor as root, consider sudoedit (or a macOS alternative) when you wish to edit files owned by another user.

@aurieh aurieh closed this as completed Sep 30, 2022
@deevo-sage
Copy link
Author

drwxr-xr-x@ 14 sidharthsahni  staff  448 Sep 15 00:10 nvim/

it's this right now what should i change it to root? ( i haven't used chown before )

@ObserverOfTime
Copy link
Contributor

ObserverOfTime commented Sep 30, 2022

This should do it:

sudo chown -R $USER ~/.cache/nvim

@deevo-sage
Copy link
Author

deevo-sage commented Sep 30, 2022

thanks <3
works now :))

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