Repository navigation
Installing extensions at system level (user: root, built-in location) throws an error #7042
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingtriageThis issue needs to be triaged by a maintainerThis issue needs to be triaged by a maintainer
Description
Is there an existing issue for this?
- I have searched the existing issues
OS/Web Information
- Web Browser: Safari v18.0.1 (20619.1.26.31.7)
- Local OS: macOS 15.0.1 (24A348)
- Remote OS: Debian 12 (bookworm)
- Remote Architecture: x86_64
code-server --version: 4.94.2-rc.1 dd2e9fc with Code 1.94.2
Steps to Reproduce
-
Start container:
docker run --rm -ti \ -u root \ -e NB_USER=root \ -e NB_UID=0 \ -e NB_GID=0 \ glcr.b-data.ch/jupyterlab/python/base:3.12.7-code-server-4.94.2-rc.1-linux-amd64 \ bash
-
Install extension:
code-server \ --extensions-dir /opt/code-server/lib/vscode/extensions \ --install-extension ms-python.python
Expected
Installing extensions...
Installing extension 'ms-python.python'...
Extension 'ms-python.debugpy' v2024.12.0 was successfully installed.
Extension 'ms-python.python' v2024.16.1 was successfully installed.
Actual
Installing extensions...
Installing extensions...
Installing extension 'ms-python.python'...
Installing extension 'ms-python.python'...
[2024-10-19T05:53:53.402Z] error parent:77 Uncaught exception: ENOTEMPTY: directory not empty, rename '/opt/code-server/lib/vscode/extensions/.4361a9d7-c95f-49fb-a7cf-6f4ae4201a3c' -> '/opt/code-server/lib/vscode/extensions/ms-python.debugpy-2024.12.0-linux-x64'
[2024-10-19T05:53:53.403Z] error parent:77 Error: ENOTEMPTY: directory not empty, rename '/opt/code-server/lib/vscode/extensions/.4361a9d7-c95f-49fb-a7cf-6f4ae4201a3c' -> '/opt/code-server/lib/vscode/extensions/ms-python.debugpy-2024.12.0-linux-x64'
at async Object.rename (node:internal/fs/promises:782:10)
at async Object.nE (file:///opt/code-server/lib/vscode/out/vs/server/node/server.main.js:45:5381)
at async yf.G (file:///opt/code-server/lib/vscode/out/vs/server/node/server.main.js:54:24201)
at async yf.extractUserExtension (file:///opt/code-server/lib/vscode/out/vs/server/node/server.main.js:54:21240)
at async zc.rb (file:///opt/code-server/lib/vscode/out/vs/server/node/server.main.js:54:14468)
[2024-10-19T05:53:53.962Z] error parent:77 Uncaught exception: ENOTEMPTY: directory not empty, rename '/opt/code-server/lib/vscode/extensions/.0c81ab66-e49a-4744-af2d-3a7ca1755d35' -> '/opt/code-server/lib/vscode/extensions/ms-python.python-2024.16.1-universal'
[2024-10-19T05:53:53.962Z] error parent:77 Error: ENOTEMPTY: directory not empty, rename '/opt/code-server/lib/vscode/extensions/.0c81ab66-e49a-4744-af2d-3a7ca1755d35' -> '/opt/code-server/lib/vscode/extensions/ms-python.python-2024.16.1-universal'
at async Object.rename (node:internal/fs/promises:782:10)
at async Object.nE (file:///opt/code-server/lib/vscode/out/vs/server/node/server.main.js:45:5381)
at async yf.G (file:///opt/code-server/lib/vscode/out/vs/server/node/server.main.js:54:24201)
at async yf.extractUserExtension (file:///opt/code-server/lib/vscode/out/vs/server/node/server.main.js:54:21240)
at async zc.rb (file:///opt/code-server/lib/vscode/out/vs/server/node/server.main.js:54:14468)
Error while installing extensions: ENOTEMPTY: directory not empty, rename '/opt/code-server/lib/vscode/extensions/.0c81ab66-e49a-4744-af2d-3a7ca1755d35' -> '/opt/code-server/lib/vscode/extensions/ms-python.python-2024.16.1-universal'
ENOTEMPTY: directory not empty, rename '/opt/code-server/lib/vscode/extensions/.0c81ab66-e49a-4744-af2d-3a7ca1755d35' -> '/opt/code-server/lib/vscode/extensions/ms-python.python-2024.16.1-universal'
Logs
See above.
Screenshot/Video
-
Does this bug reproduce in native VS Code?
This cannot be tested in native VS Code
Does this bug reproduce in GitHub Codespaces?
This cannot be tested in GitHub Codespaces
Are you accessing code-server over a secure context?
- I am using a secure context.
Notes
It seems to work at user level (user: root) by executing code-server --install-extension ms-python.python, but ls -al ~/.local/share/code-server/extensions reveals
drwx------ 4 root root 4096 Oct 19 06:00 .
drwxr-xr-x 9 root root 4096 Oct 19 06:00 ..
drwxr-xr-x 7 root root 4096 Oct 19 06:00 .b88d8567-9056-4934-883b-6ae404444689
-rw-r--r-- 1 root root 804 Oct 19 06:00 extensions.json
drwxr-xr-x 5 root root 4096 Oct 19 06:00 ms-python.debugpy-2024.12.0-linux-x64
which does not look fine.
FYI @code-asher
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriageThis issue needs to be triaged by a maintainerThis issue needs to be triaged by a maintainer
Activity
[-]Installing extensions at system level (built-in location) throws an error[/-][+]Installing extensions at *system level* (built-in location) throws an error[/+][-]Installing extensions at *system level* (built-in location) throws an error[/-][+]Installing extensions at system level (built-in location) throws an error[/+][-]Installing extensions at system level (built-in location) throws an error[/-][+]Installing extensions at system level (user: `root`, built-in location) throws an error[/+]benz0li commentedon Oct 19, 2024
Installing extensions using the GUI seem to work fine at user level (user:
jovyan):Start container:
Open https://127.0.0.1:8888/lab?token=... in a browser
Click
code-serverto start the applicationInstall Python extension using the GUI
antoinemorcos-bpi commentedon Oct 24, 2024
I'm seeing the same error with other extensions too, (examples include
eamodio.gitlens-15.6.1andmhutchie.git-graph-1.30.0)Both were ok on version 4.93.1
The repeated lines
Installing extensions...andInstalling extension 'ms-python.python'...seem like a good hint that it's running twice for some reason, in which case the failure to rename (the second time) makes sense.My stacktrace is the same when i "download and install", and is slightly different when I install from a vsix file
the common part
lib/vscode/out/vs/server/node/server.main.js:45:5381-> https://github.com/microsoft/vscode/blob/ffe710dc78580f03d042e404f807a71083f55305/src/vs/base/node/pfs.ts#L499lib/vscode/out/vs/server/node/server.main.js:54:24201->https://github.com/microsoft/vscode/blob/ffe710dc78580f03d042e404f807a71083f55305/src/vs/platform/extensionManagement/node/extensionManagementService.ts#L822
lib/vscode/out/vs/server/node/server.main.js:54:21240-> https://github.com/microsoft/vscode/blob/ffe710dc78580f03d042e404f807a71083f55305/src/vs/platform/extensionManagement/node/extensionManagementService.ts#L666install from vsix file:
lib/vscode/out/vs/server/node/server.main.js:54:16041-> https://github.com/microsoft/vscode/blob/ffe710dc78580f03d042e404f807a71083f55305/src/vs/platform/extensionManagement/node/extensionManagementService.ts#L383lib/vscode/out/vs/server/node/server.main.js:54:29045-> https://github.com/microsoft/vscode/blob/ffe710dc78580f03d042e404f807a71083f55305/src/vs/platform/extensionManagement/node/extensionManagementService.ts#L1050Download and install
lib/vscode/out/vs/server/node/server.main.js:54:14468-> https://github.com/microsoft/vscode/blob/ffe710dc78580f03d042e404f807a71083f55305/src/vs/platform/extensionManagement/node/extensionManagementService.ts#L312EDIT:
Fixed the urls in the stacktrace
antoinemorcos-bpi commentedon Oct 24, 2024
@benz0li in case you're looking at the urls I posted, one or two of them were wrong, now fixed
benz0li commentedon Oct 26, 2024
@antoinemorcos-bpi I will wait for the next release and then check again.
Cross reference:
benz0li commentedon Nov 4, 2024
@code-asher This issue is still present with
code-serverv4.95.1-rc.1.benz0li commentedon Nov 4, 2024
Yes, it seems to run twice for some reason.
code-asher commentedon Nov 5, 2024
I pushed a fix for the cli running twice; leaving the issue open until we confirm it works for y'all (should have an RC out shortly). Thanks for all the debugging and for finding the issue!
Fix cli being ran twice
code-asher commentedon Nov 5, 2024
I tested this and it seems to be working now:
https://github.com/coder/code-server/releases/tag/v4.95.1-rc.2
benz0li commentedon Nov 5, 2024
Confirmed. It works now.
Fix cli being ran twice