dotnet / dotnet/vscode-dotnet-runtime

listen EACCES: permission denied

Open
#2,236 0 comments 0 reactions 0 assignees View on GitHub
untriaged
Dominant language
TypeScript
Stars
209
Forks
455
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug.

`listen EACCES: permission denied`
Sometimes, this error is thrown by the extension, based on our data, but only on 'darwin'.
This appears to be when calling .listen() on a socket as part of our new mutex implementation. This is likely due to people having a protected temp directory on Mac that we can't write to.

It impacted about 800 people, out of 600k people.

If impacted, make sure that your temp directory is writeable if you can, or set VSCODE_DOTNET_RUNTIME_DISABLE_MUTEX=true. Note that this will cause many race conditions to be possible if you kill vscode or run multiple instances of vscode or code insiders at the same time, so I would refrain from doing so.

If anyone is impacted by this, I would like to know if you have a custom tempdir() on Mac and if you locked down the permissions of it.

vscode-main doesnt seem to handle this https://github.com/microsoft/vscode/blob/05541bc30808210a9c04dc53044806dcd40d85cb/src/vs/code/electron-main/main.ts#L422

They have EACCESS catchers later but not part of the init service. Im surprised they havent hit this.

But, they do use https://github.com/microsoft/vscode/blob/05541bc30808210a9c04dc53044806dcd40d85cb/src/vs/platform/environment/electron-main/environmentMainService.ts#L48 a different path, perhaps we should use userDataPath instead? https://github.com/microsoft/vscode/blob/05541bc30808210a9c04dc53044806dcd40d85cb/src/vs/platform/environment/node/userDataPath.ts#L18
in https://github.com/dotnet/vscode-dotnet-runtime/blob/92ce511d2a017c1f1fe4d465c6fff0172d3f49bb/vscode-dotnet-runtime-library/src/Utils/NodeIPCMutex.ts#L80
or alternatively, check if temp is restricted, if so use home on darwin.

### Please attach log file(s) here if you have any.

The log file location should be copied to your clipboard if you came from VS Code.

### Reproduction Steps

Not sure.

### Expected Behavior

Can we use a different directory?

### Exceptions & Errors (if any)

_No response_

### .NET Install Tool Version

Latest

### Your operating system? Please provide more detail, such as the version and or distro above.

N/A

### VS Code Version

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.