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

Error when downloading VS Code #233

Closed
xisui-MSFT opened this issue Sep 14, 2023 · 7 comments · Fixed by #241
Closed

Error when downloading VS Code #233

xisui-MSFT opened this issue Sep 14, 2023 · 7 comments · Fixed by #241
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@xisui-MSFT
Copy link
Contributor

We have a pipeline running some extension tests. After 1.82.1 release, we see consistent permission error after downloading VS Code (removed some download progress output):

Downloading VS Code 1.82.1 from https://update.code.visualstudio.com/1.82.1/win32-x64-archive/stable
Downloading VS Code (131881006B)
Downloading VS Code [------------------------------] 1%Downloading VS Code [=============================-] 99%Downloading VS Code [==============================] 100%Error downloading, retrying (attempt 1 of 3): EPERM: operation not permitted, rename 'C:\Agent\_work\2\s\Extension\.vscode-test\vscode-win32-x64-archive-1.82.1.tmp' -> 'C:\Agent\_work\2\s\Extension\.vscode-test\vscode-win32-x64-archive-1.82.1'
Error downloading, retrying (attempt 3 of 3): EPERM: operation not permitted, unlink 'C:\Agent\_work\2\s\Extension\.vscode-test\vscode-win32-x64-archive-1.82.1.tmp\Code.exe'
[Error: EPERM: operation not permitted, unlink 'C:\Agent\_work\2\s\Extension\.vscode-test\vscode-win32-x64-archive-1.82.1.tmp\Code.exe'] {
  errno: -4048,
  code: 'EPERM',
  syscall: 'unlink',
  path: 'C:\\Agent\\_work\\2\\s\\Extension\\.vscode-test\\vscode-win32-x64-archive-1.82.1.tmp\\Code.exe'
}

vscode/test-electron version is 2.3.4. We checked the permissions of code.exe file in the tmp folder, and everything seems to be correct.

@IEvangelist
Copy link
Member

I'm seeing the same thing:

Downloading VS Code 1.82.2 from https://update.code.visualstudio.com/1.82.2/win32-x64-archive/stable
Downloading VS Code [==============================] 100%
Error downloading, retrying (attempt 1 of 3): EPERM: operation not permitted, rename 'C:\Users\dapine\source\repos\pathological\.vscode-test\vscode-win32-x64-archive-1.82.2.tmp' -> 'C:\Users\dapine\source\repos\pathological\.vscode-test\vscode-win32-x64-archive-1.82.2'
Downloading VS Code 1.82.2 from https://update.code.visualstudio.com/1.82.2/win32-x64-archive/stable
Downloading VS Code [==============================] 100%
Error downloading, retrying (attempt 3 of 3): EPERM: operation not permitted, rename 'C:\Users\dapine\source\repos\pathological\.vscode-test\vscode-win32-x64-archive-1.82.2.tmp' -> 'C:\Users\dapine\source\repos\pathological\.vscode-test\vscode-win32-x64-archive-1.82.2'
Downloading VS Code 1.82.2 from https://update.code.visualstudio.com/1.82.2/win32-x64-archive/stable
Downloading VS Code [==============================] 100%[Error: EPERM: operation not permitted, rename 'C:\Users\dapine\source\repos\pathological\.vscode-test\vscode-win32-x64-archive-1.82.2.tmp' -> 'C:\Users\dapine\source\repos\pathological\.vscode-test\vscode-win32-x64-archive-1.82.2'] {
  errno: -4048,
  code: 'EPERM',
  syscall: 'rename',
  path: 'C:\\Users\\dapine\\source\\repos\\pathological\\.vscode-test\\vscode-win32-x64-archive-1.82.2.tmp',
  dest: 'C:\\Users\\dapine\\source\\repos\\pathological\\.vscode-test\\vscode-win32-x64-archive-1.82.2'
}
Failed to run tests

But on the rename of the temp down. My tests will not run as a result of this, and VS Code is operating as an Admin. Please help.

@connor4312
Copy link
Member

I was able to hit that locally it one case, it seems that adding a retry to the rename was sufficient to fix it. Please give @vscode/test-electron 2.3.5 a try and let me know if you still hit it.

@JustinGrote
Copy link

JustinGrote commented Oct 4, 2023

@connor4312 still happening for me on 2.3.5

Debugger listening on ws://127.0.0.1:50430/e64e9856-b975-4bd9-845e-bf063bce0df1
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Downloading VS Code insiders from https://update.code.visualstudio.com/latest/win32-x64-archive/insider
Downloading VS Code [==============================] 100%
Error downloading, retrying (attempt 1 of 3): EPERM: operation not permitted, rename 'C:\Users\jgrote\Projects\vscode-adapter\.vscode-test\vscode-win32-x64-archive-insiders.tmp' -> 'C:\Users\jgrote\Projects\vscode-adapter\.vscode-test\vscode-win32-x64-archive-insiders'

Weirdly, when I go to manually delete the tmp folder, I get an admin popup
image

not sure what kind of permissions weirdness may be happening here, they look normal to me in the properties and are set to inherit.

EDIT: The popup appears to be because vscode still has a handle open in that folder. Killing the process and it works. Maybe related?

EDIT2: If I start the test outside vscode, e.g. from windows terminal, it works fine, so something in vscode holding a handle in that folder it shouldn't be?

@connor4312
Copy link
Member

connor4312 commented Oct 4, 2023

That's unfortunate. That seems to be a bug on VS Code itself, it should not lock folders like that.

I think that is distinct from OP's issue, since their happens in CI

@bpasero
Copy link
Member

bpasero commented Oct 5, 2023

I cannot reproduce, here is what I tried:

  • fresh hello world extension
  • open VS Code stable
  • open an integrated terminal (NOT powershell)
  • run npm run test

Anything else? Does it reproduce in VS Code insiders?

@connor4312
Copy link
Member

Looks like the failure is still present in OP's CI 😢

@connor4312 connor4312 reopened this Oct 5, 2023
@connor4312 connor4312 self-assigned this Oct 5, 2023
@connor4312 connor4312 added the bug Issue identified by VS Code Team member as probable bug label Oct 5, 2023
@xisui-MSFT
Copy link
Contributor Author

Sorry for the late response. This still repros for us after updating to 2.3.5.

connor4312 added a commit that referenced this issue Oct 24, 2023
Fixes #233, which Andrea ran into when testing.

Instead of staging and renaming, which tends to fail on Windows, write a 'completed' file when the install is done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants