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

permissions issue for /usr/tmp/pyright directory on shared linux boxes prevents installation #421

Closed
joelhock opened this issue Sep 25, 2020 · 3 comments
Assignees
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@joelhock
Copy link

Environment data

  • Language Server version: 2020.9.6
  • OS and version: remote ssh extension to linux
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.5

Expected behaviour

multiple people should be able to use pylance on the same, shared linux host. possibly the temporary directory should be per-user.

Actual behaviour

2020.9.6 is putting the builtins help (hooray!) into /usr/tmp/pyright. we use the remote ssh feature in vscode (not sure if that's pertinent), and in our setup, that directory is created with drwxr-xr-x permissions, so other users on the same machine cannot write to the directory. when another user on the same host tries to install 2020.9.6, they get errors in the log and the extension does not function properly for the second user.

Logs

[Info  - 7:30:15 PM] Pylance language server 2020.9.6 (pyright c52b78aa) starting
[Info  - 7:30:15 PM] Server root directory: /mnt/harmonix_vol2/soporifix_vol3/user/home/jiahao/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.6/dist
[Error - 7:30:15 PM] Error occurred on background thread: {"errno":-2,"syscall":"unlink","code":"ENOENT","path":"/usr/tmp/pyright/57f44b0a220cc5bfc042d2613ac8a5fb0821a7c987-a"}
[Error - 7:30:21 PM] Notification handler 'workspace/didChangeWatchedFiles' failed with message: ENOENT: no such file or directory, unlink '/usr/tmp/pyright/375017ff2b3be92afdc781d9884743de325354a1c3-a'
[Error - 7:30:36 PM] Notification handler 'workspace/didChangeWatchedFiles' failed with message: ENOENT: no such file or directory, unlink '/usr/tmp/pyright/d3a51d66180ac412c12e9da83abf94b4f68874340c-a'
[Error - 7:32:08 PM] Notification handler 'workspace/didChangeWatchedFiles' failed with message: ENOENT: no such file or directory, unlink '/usr/tmp/pyright/46b6a7cf7bc42fd82d233bcefc128702b2db499d45-a'
[Error - 7:32:09 PM] Notification handler 'workspace/didChangeWatchedFiles' failed with message: ENOENT: no such file or directory, unlink '/usr/tmp/pyright/f91eb2279c602f6ec63bfc69d9e782da6fbfc9b234-a'
[Error - 7:32:19 PM] Notification handler 'workspace/didChangeWatchedFiles' failed with message: ENOENT: no such file or directory, unlink '/usr/tmp/pyright/ffe46323ffd711372852fe018738bab47661aed179-a'
internal/fs/utils.js:220
    throw err;
    ^

Error: ENOENT: no such file or directory, unlink '/usr/tmp/pyright/99790219fecc40d19a678b85f2e20d5854589f5cd5-a'
    at Object.unlinkSync (fs.js:1035:3)
    at y.unlinkSync (/mnt/harmonix_vol2/soporifix_vol3/user/home/joel/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.6/dist/pyright.bundle.js:1:521296)
    at M (/mnt/harmonix_vol2/soporifix_vol3/user/home/joel/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.6/dist/pyright.bundle.js:1:530081)
    at L (/mnt/harmonix_vol2/soporifix_vol3/user/home/joel/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.6/dist/pyright.bundle.js:1:529741)
    at Object.t.normalizePathCase (/mnt/harmonix_vol2/soporifix_vol3/user/home/joel/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.6/dist/pyright.bundle.js:1:533352)
    at F._getSourceFileInfoFromPath (/mnt/harmonix_vol2/soporifix_vol3/user/home/joel/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.6/dist/pyright.bundle.js:1:185002)
    at F.addTrackedFile (/mnt/harmonix_vol2/soporifix_vol3/user/home/joel/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.6/dist/pyright.bundle.js:1:162986)
    at /mnt/harmonix_vol2/soporifix_vol3/user/home/joel/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.6/dist/pyright.bundle.js:1:162923
    at Array.forEach (<anonymous>)
    at F.addTrackedFiles (/mnt/harmonix_vol2/soporifix_vol3/user/home/joel/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.6/dist/pyright.bundle.js:1:162906) {
  errno: -2,
  syscall: 'unlink',
  code: 'ENOENT',
  path: '/usr/tmp/pyright/99790219fecc40d19a678b85f2e20d5854589f5cd5-a'
}
[Info  - 10:07:19 AM] Connection to server got closed. Server will restart.
[Error - 10:07:19 AM] Request textDocument/documentHighlight failed.
Error: Connection got disposed.
    at Object.dispose (/mnt/harmonix_vol2/soporifix_vol3/user/home/joel/.vscode-server/extensions/ms-python.python-2020.9.111407/out/client/extension.js:47:368894)
    at Object.dispose (/mnt/harmonix_vol2/soporifix_vol3/user/home/joel/.vscode-server/extensions/ms-python.python-2020.9.111407/out/client/extension.js:1:306633)
    at _.handleConnectionClosed (/mnt/harmonix_vol2/soporifix_vol3/user/home/joel/.vscode-server/extensions/ms-python.python-2020.9.111407/out/client/extension.js:1:306845)
    at _.handleConnectionClosed (/mnt/harmonix_vol2/soporifix_vol3/user/home/joel/.vscode-server/extensions/ms-python.python-2020.9.111407/out/client/extension.js:47:320424)
...

@jakebailey jakebailey added the bug Something isn't working label Sep 25, 2020
@github-actions github-actions bot removed the triage label Sep 25, 2020
@jakebailey
Copy link
Member

Agh, that's unfortunate. I moved this directory so we weren't dumping everything into the top level temp directory (as I expect us to use tempfiles more), but forgot that new temp directories are created with permissions for their user and that doesn't play well on multi-user systems with shared global temps. With plain files dumped into the top level temp, only the file has the permissions of the user that created it, so this wasn't hit.

It fails at startup because we use a temporary file to check the case-sensitivity of the OS and that path doesn't catch errors (which perhaps was good, given we were able to see this rather than things silently failing).

I'll look into fixing this and making the tempdir per-process.

@jakebailey jakebailey self-assigned this Sep 25, 2020
@jakebailey
Copy link
Member

Thanks again for the report. This'll be fixed in the next release next week. For now, since Pylance is distributed in a VS Code extension, you should be able to work around it by selecting an older release by right clicking on the extension in the extension menu and clicking "install another version".

@jakebailey jakebailey added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Sep 25, 2020
@jakebailey
Copy link
Member

This issue has been fixed in version 2020.9.7, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202097-30-september-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 fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

2 participants