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

Cannot access extensions marketplace clone #1463

Closed
nsadeh opened this issue Mar 30, 2020 · 10 comments
Closed

Cannot access extensions marketplace clone #1463

nsadeh opened this issue Mar 30, 2020 · 10 comments
Assignees
Labels
waiting-for-info Waiting for more information from submitter

Comments

@nsadeh
Copy link

nsadeh commented Mar 30, 2020

I downloaded and installed code server on a Digital Ocean droplet following this guide. Everything works except when I go to the Extensions tab to install extensions from the marketplace clone (as I understand it). It’s unable to connect.

I know I can install manually from the VSIX files but it’s a huge hassle and since I am limited to command line (running on iPad) I need to find a wget link which is not always available.

@nhooyr nhooyr added bug Something isn't working waiting-for-info Waiting for more information from submitter and removed bug Something isn't working labels Mar 30, 2020
@nhooyr
Copy link
Contributor

nhooyr commented Mar 30, 2020

@nsadeh What exactly does it say? Could it not resolve the host? Could it not connect to the IP?

Would be a good idea to check the debug console as well.

@code-asher any other debugging tips?

@nsadeh
Copy link
Author

nsadeh commented Mar 30, 2020

It says "cannot connect to the extensions marketplace at this time, please try again later".

I tried to get to the docs through the VSCode terminal but copy-paste didn't work so I gave up.

Through Blink, most of the files in log-dir are empty, but the render logs had TypeError: Cannot read property clientWidth of type Undefined. I assume that has nothing to do with it. exthost.log had an info line for ExtensionService.doActivateExtension with startup: false in the JSON.

Debugger couldn't start because of no extension access.

@code-asher
Copy link
Member

See #1106 for some potential copy/paste workarounds.

Running code-server with --log trace or --log debug and then checking the logs directory in ~/.local/share/code-server might give some hints. Installing directly from the command line with code-server --install-extension <extension id> might also show something helpful.

It can also be helpful to open the browser devtools and go to the network tab to see what requests VS Code is trying to make to extensions.coder.com and what exactly the responses are.

@nsadeh
Copy link
Author

nsadeh commented Mar 30, 2020

I get the following out of the Chrome network tab headers:
Accept: application/json;api-version=3.0-preview.1
Content-Type: application/json
Referer: http:///
Sec-Fetch-Dest: empty
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
X-Market-Client-Id: VSCode 1.33.1
X-Market-User-Id: user-id

Will run with logs in a second

@nsadeh
Copy link
Author

nsadeh commented Mar 30, 2020

Ok so running with the log option didn’t work, code-server says it does know about it. Here is what ./code-server —install-extension scalameta.metals gave:

INFO code-server v1.1119-vsc1.33.1 ERROR (node:8650) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. ERROR ERROR connect ECONNREFUSED [ip]:88 ERROR ERROR Failed Installing Extensions: scalameta.metals

Looks like I need to give it access to port 88. I don’t know how to do that off my head because I never learned how networking on computers works but I can google more into it.

EDIT: sudo ufw allow 88/tcp did not work either

@nsadeh
Copy link
Author

nsadeh commented Mar 30, 2020

After ufw allow I get

ERROR ERROR Uncaught Exception: { Error: spawn ENOMEM ERROR at ChildProcess.spawn (internal/child_process.js: 366:11) ERROR at spawn (child_process.js:538:9) ERROR at /src/packages/server/out/cli.js:259:2339 ERROR at /src/packages/server/out/cli.js:259:2295 ERROR at /src/packages/server/out/cli.js:504:22829 ERROR at /src/packages/server/out/cli.js:504:23213 ERROR at /src/packages/server/out/cli.js:504:24010 ERROR at FSReqWrap.oncomplete (fs.js:155:5) errno: 'ENO MEM', code: 'ENOMEM', syscall: 'spawn' } ERROR ERROR connect ECONNREFUSED [ip]:88 ERROR ERROR Failed Installing Extensions: scalameta.metals

@code-asher
Copy link
Member

code-asher commented Mar 31, 2020

Oh interesting that's a rather old version of code-server. If you can, trying out the 3.0.1 pre-release might be worth a shot.

It looks like that might be your own IP address? When I browsed to it I was able to access an instance of code-server without any authorization. I removed the IP from your posts and the post revision history just in case but you might want to add some password authentication.

I'm not sure why it's trying to connect to itself over port 88. It's supposed to be connecting to extensions.coder.com for v3 and v1.extapi.coder.com for v1 & v2 (which I believe now just redirects to extensions.coder.com).

When I try v1 and v2 I get a different error; unable to get local issuer certificate. v3 works without a problem. 🤔

@nsadeh
Copy link
Author

nsadeh commented Mar 31, 2020

Really appreciate it @code-asher - I started running without auth as I was using multiple devices and got careless with the IP. I'll try the newer version.

Where would I go to change the address it's trying to connect to?

@code-asher
Copy link
Member

There is an environment variable SERVICE_URL that can be used to set the address for the marketplace but I'm not sure setting that will change anything. It's almost as if the marketplace is being redirected by a proxy or something.

@nsadeh
Copy link
Author

nsadeh commented Apr 1, 2020

I redid the installation and now I can, but my extension doesn’t work with code-server.

@nsadeh nsadeh closed this as completed Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-info Waiting for more information from submitter
Projects
None yet
Development

No branches or pull requests

4 participants