Skip to content

Unable to install any extension on macOS #1007

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

Closed
trigun539 opened this issue Sep 20, 2019 · 34 comments
Closed

Unable to install any extension on macOS #1007

trigun539 opened this issue Sep 20, 2019 · 34 comments
Assignees
Labels
bug Something isn't working

Comments

@trigun539
Copy link

Description

Unable to install any extension. Tried eslint, prettier, vim. None worked with same steps.

Steps to Reproduce

  1. Click extensions, find an extension and click install.
    image
  2. Click download manually
    image
@Ehco1996
Copy link

same problem ,
屏幕快照 2019-09-20 下午2 41 51

@frank-dspeed
Copy link

the error does not exist on linux only for information

@sr229 sr229 added bug Something isn't working v2 labels Sep 20, 2019
@sr229
Copy link
Contributor

sr229 commented Sep 20, 2019

@trigun539 As a workaround, use a Ubuntu VM and mount your workspace folder in the VM for now while we try to solve this. I provide daily builds so you can test out the changes once we have it in place.

@trigun539
Copy link
Author

@sr229 Will do, thanks.

@cottongin
Copy link

cottongin commented Sep 21, 2019

I am experiencing this issue as well with code-server running on Fedora 30. I've tried enabling --log debug and --verbose when running the server but nothing is shown in stdout when I try (and fail) to install an extension.

  • code-server version: 2.1523-vsc1.38.1
  • OS Version: Fedora 30
  • Extension: any

@sr229
Copy link
Contributor

sr229 commented Sep 21, 2019

I am experiencing this issue as well with code-server running on Fedora 30. I've tried enabling --log debug and --verbose when running the server but nothing is shown in stdout when I try (and fail) to install an extension.

  • code-server version: 2.1523-vsc1.38.1
  • OS Version: Fedora 30
  • Extension: any

I use Fedora 30 in my end and I have never encountered this. perhaps your xdg-home-dir is not accessible?

@cottongin
Copy link

cottongin commented Sep 21, 2019

After digging in I found this in the logs directory (it'd be nice if this were printed to stdout while the server is running if the --verbose flag is used):

[2019-09-20 20:35:12.087] [remoteagent] [info] Installing extension: ms-python.python                                                                                     
[2019-09-20 20:35:12.223] [remoteagent] [error] Failed to install extension: ms-python.python unable to get local issuer certificate 

Edit:

This perhaps is related? microsoft/vscode-remote-release#231

Edit 2:

Trying to manually fetch any extension URL from the remote host fails as well:

$ curl -IL https://v1.extapi.coder.com/publishers/ms-python/vsextensions/python/2019.9.34911/vspackage

HTTP/2 404 
date: Sat, 21 Sep 2019 15:23:07 GMT
content-type: text/html; charset=utf-8
content-length: 203
vary: Accept-Encoding
x-powered-by: Express
access-control-allow-origin: *
content-security-policy: default-src 'self'
x-content-type-options: nosniff
via: 1.1 google

@bihuchao
Copy link

bihuchao commented Sep 22, 2019

Same error.
version : 2.1485-vsc1.38.1
log:
image

@sr229
Copy link
Contributor

sr229 commented Sep 22, 2019

@code-asher looks like we're getting signature issues

@cottongin
Copy link

any update on this?

@rodydavis
Copy link

Still broken for me

@frank-dspeed
Copy link

you can expect up to 2 month till this is fixed. @AppleEducate @cottongin but you can use the workaround

@frank-dspeed
Copy link

This should get renamed as only MacOS is affected by this.

@sr229 sr229 changed the title Unable to install any extension Unable to install any extension on macOS Oct 8, 2019
@cottongin
Copy link

cottongin commented Oct 8, 2019

This is not limited to macOS, I am using ChromeOS, and thus the work around is not usable. Though I am now unclear; is code-server installing extensions to the OS/client I am accessing the server from? I assumed they were being installed to the server.

To clarify my setup:
code-server version: 2.1523-vsc1.38.1 running on OS Version: Fedora 30 accessed via ChromeOS 78.0.3904.41 (Official Build) beta (64-bit) Platform 12499.20.0 (Official Build) beta-channel eve

No macOS at all in my chain/setup

@frank-dspeed
Copy link

@cottongin your right they get installed to the directorys on server that you choose or home by default

@frank-dspeed
Copy link

@cottongin as you mentoined fedora there are many security features that could prevent you from using this.you can use the workaround you can simply use docker on fedora

@cottongin
Copy link

Alright, using docker worked, but how do I pass in my environment? It doesn't see Python installed and git doesn't work. I don't really use docker so this is all new to me, and not a great workaround.

@frank-dspeed
Copy link

@cottongin you need to create your own modifyed image base on the code-server image.
and add there instructions like apt-get install python git and so on

@cottongin
Copy link

@frank-dspeed well this seems like quite a lot of work when my environment is already established on the fedora box and the appeal, at least to me, is that code-server runs in said environment so everything just works™. Having to essentially clone the already existing environment into the docker image is not ideal (this gets complicated with things like github ssh keys).

I guess I'll wait the 2 months for whatever is broken to be fixed

@frank-dspeed
Copy link

@cottongin simply switch back to v1 till this is ready at present the upstream repo gets prepared to release vscode-server (RemoteHostProcess && RemoteHostAgent) When this has landed it can get used as server for vscode-online vscode-web code-server,

@glasgowm148
Copy link

Same issue in Centos7

@sr229
Copy link
Contributor

sr229 commented Oct 10, 2019

Same issue in Centos7

Can't confirm that. Running a Eclipse Che server and I can install extensions fine.

@glasgowm148
Copy link

Tried running as my own user & root, reinstalling. No joy. Also not sure where the log outputs to?

➜ code-server2.1523-vsc1.38.1-linux-x86_64 ./code-server --port 9999 --verbose --log debug info Server listening on http://localhost:9999 info - No authentication info - Not serving HTTPS

`[root@li666-14]~# wget https://v1.extapi.coder.com/publishers/ms-python/vsextensions/python/2019.9.34911/vspackage
--2019-10-14 12:51:19-- https://v1.extapi.coder.com/publishers/ms-python/vsextensions/python/2019.9.34911/vspackage
Resolving v1.extapi.coder.com (v1.extapi.coder.com)... 2a00:1450:4009:818::2013, 172.217.169.51
Connecting to v1.extapi.coder.com (v1.extapi.coder.com)|2a00:1450:4009:818::2013|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-10-14 12:51:19 ERROR 404: Not Found.

[root@li666-14]# wget https://v1.extapi.coder.com/publishers/vscode-icons-team/vsextensions/vscode-icons/9.3.0/vspackage
--2019-10-14 12:51:39-- https://v1.extapi.coder.com/publishers/vscode-icons-team/vsextensions/vscode-icons/9.3.0/vspackage
Resolving v1.extapi.coder.com (v1.extapi.coder.com)... 2a00:1450:4009:818::2013, 172.217.169.51
Connecting to v1.extapi.coder.com (v1.extapi.coder.com)|2a00:1450:4009:818::2013|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-10-14 12:51:40 ERROR 404: Not Found.
[root@li666-14]
# curl -IL https://v1.extapi.coder.com/publishers/ms-python/vsextensions/python/2019.9.34911/vspackage
HTTP/1.1 404 Not Found
Date: Mon, 14 Oct 2019 12:52:40 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 203
Vary: Accept-Encoding
X-Powered-By: Express
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src 'self'
X-Content-Type-Options: nosniff
Via: 1.1 google`

@glasgowm148
Copy link

glasgowm148 commented Oct 17, 2019

Fixed/Workaround. It works via Docker with some modifications to the path - but as another user pointed out, pretty useless for this kind of application.

Seems to be some sort of permission error or issue with the extension server but can't get any meaningful out the logs. Still can't install via the browser UI but this method makes it a lot clearer where your data and extensions are stored.

  1. Run with this command. This creates a directory for your files and extensions.
    ./code-server --user-data-dir user-data --extensions-dir user-ext
  2. Search for desired extension here https://marketplace.visualstudio.com/vscode & download (right-hand link pane)
  3. Upload via SFTP to /user-ext
  4. Navigate to the instance of vscode running in the browser
  5. Extensions -> three dots --> Install from VSIX

@waclaw66
Copy link

It helped me to set NODE_EXTRA_CA_CERTS environment variable.
I have added the variable to code-server.service file of systemd.

[Service]
Environment=NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt

It seems like a bug, according help...
NODE_EXTRA_CA_CERTS - path to additional CA certificates file
So the code-server cannot use the default system CA file for some reason.

Fedora 30
code-server2.1638-vsc1.39.2-linux-x86_64

@ghost
Copy link

ghost commented Oct 26, 2019

Inspired by @waclaw66's workaround, I just confirmed it also fixes the issue on macOS if you have openssl installed from Homebrew:

NODE_EXTRA_CA_CERTS=/usr/local/etc/openssl/cert.pem ./code-server [your parameters]

@glasgowm148
Copy link

glasgowm148 commented Oct 31, 2019

Can confirm this also worked for me on CentOS

Full service file

[Unit]
Description=Code Server IDE
After=network.target

[Service]
Environment=NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-bundle.crt
Type=simple
User=mark
EnvironmentFile=/etc/profile.d/pass.sh
WorkingDirectory=/home/mark/vscode/code-server
Restart=always
RestartSec=20
ExecStart=/home/mark/vscode/code-server/code-server --auth password --user-data-dir /home/mark/vscode/user-data --extensions-dir /home/mark/vscode/user-ext $(pwd)


StandardOutput=file:/var/log/code-server-output.log
StandardError=file:/var/log/code-server-error.log

[Install]
WantedBy=multi-user.target

@JoeFirmament
Copy link

@glasgowm148 Thx! Same issue on CentOS7. After read your comments, add a new line to /etc/profile
export NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-bundle.crt
and
source /etc/profile
Everything goes well~~~

@frank-dspeed
Copy link

i think we could export that ENV? Maybe by default or Alert if it is not set?

@glasgowm148
Copy link

env can vary from user to user based on shell and OS. Would be clearer to just put it in the instructions for setting up the .service file or readme.md.

@frank-dspeed
Copy link

@glasgowm148 no i think we should simply look if that var exists and if not we throw a error thats it.

zigarn added a commit to Zenika-Training/infra4lab that referenced this issue Nov 28, 2019
@vishalmhjn
Copy link

Any update on this? same problem

@nhooyr nhooyr removed the v2 label Jan 27, 2020
@nhooyr
Copy link
Contributor

nhooyr commented Feb 3, 2020

Confirmed.

@nhooyr
Copy link
Contributor

nhooyr commented Apr 16, 2020

Does not seem to be a problem anymore, just tested.

@nhooyr nhooyr closed this as completed Apr 16, 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
Projects
None yet
Development

No branches or pull requests