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

Extension installation fails with EPERM on windows when running with vscode-test #258

Open
karthiknadig opened this issue Jan 31, 2024 · 9 comments
Assignees

Comments

@karthiknadig
Copy link
Member

Downloaded VS Code into C:\GIT\formatters\vscode-black-formatter\.vscode-test\vscode-win32-x64-archive-1.85.2
Installing extensions...
Installing extension 'ms-python.python'...
(node:31328) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
[node.js fs] rename failed after 1 retries with error: Error: EPERM: operation not permitted, rename 'c:\GIT\formatters\vscode-black-formatter\.vscode-test\extensions\.70c4e24d-3e6d-4ef9-8311-de75c41021cf' -> 'c:\GIT\formatters\vscode-black-formatter\.vscode-test\extensions\ms-python.python-2023.22.1'
EPERM: operation not permitted, rename 'c:\GIT\formatters\vscode-black-formatter\.vscode-test\extensions\.70c4e24d-3e6d-4ef9-8311-de75c41021cf' -> 'c:\GIT\formatters\vscode-black-formatter\.vscode-test\extensions\ms-python.python-2023.22.1'
Failed Installing Extensions: ms-python.python
Found existing install in C:\GIT\formatters\vscode-black-formatter\.vscode-test\vscode-win32-x64-archive-1.85.2. Skipping download
@JustinGrote
Copy link

Seeing something similar, my test archives using vscode-test-cli are not extracting correctly and getting ENOENT because code.exe isn't there.

@connor4312
Copy link
Member

@JustinGrote it sounds like you're hitting an issue that's fixed on the latest version of @vscode/test-electron

@JustinGrote
Copy link

@connor4312 you are correct, my dependency in the vscode-test-cli project didn't update. Nice catch.
image

@sandy081
Copy link
Member

sandy081 commented Feb 6, 2024

rename failed after 1 retries with error: Error: EPERM: operation not permitted

Looks like on the system where you are running this, you do not have permissions to do rename. Please fix it and re-run.

@sandy081 sandy081 closed this as completed Feb 6, 2024
@karthiknadig
Copy link
Member Author

@sandy081 in my case I do have permissions and it does work sometimes. Just repeating the same operation again and again it works after few attempts, after that point it start working every time.

@sandy081 sandy081 assigned bpasero and unassigned sandy081 Feb 8, 2024
@sandy081
Copy link
Member

sandy081 commented Feb 8, 2024

This message is coming from FileService

CC @bpasero

@sandy081 sandy081 reopened this Feb 8, 2024
@bpasero
Copy link
Member

bpasero commented Feb 8, 2024

fs.rename can fail with EPERM if you try to rename to a folder that already exists on disk:

image

If you are using IFileService, the error will be more specific because we check before-hand if the target exists:

https://github.com/microsoft/vscode/blob/9b2e567ee2a13ff5ccad58897343cef0aebfc1df/src/vs/platform/files/node/diskFileSystemProvider.ts#L756

Here I assume that the file service is not being used, since the error message is coming from pfs:

https://github.com/microsoft/vscode/blob/9b2e567ee2a13ff5ccad58897343cef0aebfc1df/src/vs/base/node/pfs.ts#L496

I would suggest to switch to using file service and set the overwrite option to true:

https://github.com/microsoft/vscode/blob/9b2e567ee2a13ff5ccad58897343cef0aebfc1df/src/vs/platform/files/common/files.ts#L165

@bpasero bpasero assigned sandy081 and unassigned bpasero Feb 8, 2024
@sandy081
Copy link
Member

@karthiknadig Is it possible to run with --verbose flag and provide the trace?

@karthiknadig
Copy link
Member Author

npm-run-smoke-tests.log

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

5 participants