Extensions installation / update broken @ 3.10.0
OS/Web Information
- Web Browser: Google Chrome 90.0.4430.93 (Official Build) (x86_64)
- Local OS: macOS Big Sur 11.3.1
- Remote OS: Ubuntu 20.04.2 LTS
- Remote Architecture: x86_64
code-server --version: 3.10.0 6610bff3216c48fdd0884191338b1092765dbb5a
Steps to Reproduce
- Start installing (updating) extension from Marketplace
- or start installing (updating) extension from CLI
Expected
Installed extension
Actual
If extension install / update started from GUI / CLI using Marketplace or VSIX file the process stalls. Button says 'Installing / Updating' and nothing more. While installing in CLI it stalls on "Installing extensions..."
Logs
1. The most recent files from ~/.local/share/code-server/coder-logs.
empty logs
2. The browser console.

3. The browser network tab.
none
4. The most recent files from ~/.local/share/code-server/logs
Screenshot


Notes
This issue can be reproduced in VS Code: No
Hmm...I'm having trouble reproducing on macOS + Chrome. Here's what I'm doing:
code-server --auth none- Open in browser
- Go to Extensions panel
- Search extension
- Click "Install on Remote"
I also tried installing via the CLI and it worked.
➜ code-server git:(main) SERVICE_URL=https://open-vsx.org/vscode/gallery ITEM_URL=https://open-vsx.org/vscode/item code-server --install-extension esbenp.prettier-vscode
Installing extensions...
Installing extension 'esbenp.prettier-vscode' v6.3.2...
Extension 'esbenp.prettier-vscode' v6.3.2 was successfully installed.

We may need to look into this a bit further.
Hey there, I couldn't reproduce it either - it could be possible that one of your extensions is in a corrupted state. Can you uninstall TabNine and try again, or move ~/.local/share/code-server to another location and try with a fresh state?
Unfortunately, switching to new blank configuration didn't help. Reinstalling v.3.10.0 didn't help either.
I'm using systemd to launch code-server as root (don't ask) like that:
/lib/systemd/system/code-server.service
[Unit]
Description=code-server
After=network.target
[Service]
Environment=SERVICE_URL=https://marketplace.visualstudio.com/_apis/public/gallery
Environment=ITEM_URL=https://marketplace.visualstudio.com/items
Type=simple
ExecStart=/usr/bin/code-server --config /etc/code-server/config.yaml
Restart=always
[Install]
WantedBy=multi-user.target
/etc/code-server/config.yaml
bind-addr: 0.0.0.0:444
auth: password
password: **********
cert: /etc/letsencrypt/live/domain.com/cert.pem
cert-key: /etc/letsencrypt/live/domain.com/privkey.pem
I've already tried to change
Environment=SERVICE_URL=https://marketplace.visualstudio.com/_apis/public/gallery
Environment=ITEM_URL=https://marketplace.visualstudio.com/items
to open-vsx.org with no success: I can list all extensions but cant install or update any.
I've been using code-server like that for many releases with no problem. Please advice.
Hmm...I'm not sure what could have changed. Do you mind recording a video/screencast running this locally and sharing with us?
SERVICE_URL=https://open-vsx.org/vscode/gallery ITEM_URL=https://open-vsx.org/vscode/item code-server --install-extension esbenp.prettier-vscode
Yes, here it is.
I totally removed code-server package and deleted ./local/share/code-server But no success, install process stalls.

That's super helpful! Thank you. It looks like you're running those as a separate lines so the variables won't be set when you install the extension. Can you run SERVICE_URL=https://open-vsx.org/vscode/gallery ITEM_URL=https://open-vsx.org/vscode/item code-server --install-extension esbenp.prettier-vscode --log trace as one line and post a video + logs of that? --log trace might show us something useful.
I spoke to @oxy who said it could be related to running as root as well.
You can also test the API with curl by running
curl 'https://open-vsx.org/vscode/gallery/extensionquery' -H "Content-Type: application/json" --data-raw '{"filters":[{"criteria":[{"filterType":4,"value":"does \
not exist"}]}]}'
which should get you:
{"results":[{"extensions":[],"resultMetadata":[{"metadataType":"ResultCount","metadataItems":[{"name":"TotalCount","count":0}]}]}]}
Same thing.

curl 'https://open-vsx.org/vscode/gallery/extensionquery' -H "Content-Type: application/json" --data-raw '{"filters":[{"criteria":[{"filterType":4,"value":"does not exist"}]}]}'
fetches
{"results":[{"extensions":[],"resultMetadata":[{"metadataType":"ResultCount","metadataItems":[{"name":"TotalCount","count":0}]}]}]}
Should I try run code-server as regular user (not root) next?
Ah, bummer. I see this in the logs Extension VSIX downloads cache dir does not exist but not sure if that matters 🤔
Yeah, try running as a regular user and seeing what happens.
It looks like the /bin/bash node -p spawn never exits. Does something like this work?
$ /bin/bash -ilc 'echo hello'
hello
If that works perhaps try the full command:
$ /bin/bash -ilc "/usr/lib/code-server/lib/node -p '\"<marker>\" + JSON.stringify(process.env) + \"</marker>\"'"
<marker>{<env should show here>}</marker>
If it doesn't work perhaps there's something blocking in the .bashrc or .profile?
/bin/bash -ilc 'echo hello'
Thank you so much! Your snippet solved my problem. I had an admin text menu bash script autoloaded in .profile After removed now it works correctly. Thank you, you're breathtaking!