code-server icon indicating copy to clipboard operation
code-server copied to clipboard

[Bug]: bad EXTENSIONS_GALLERY input not handled

Open jsjoeio opened this issue 3 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS/Web Information

  • Web Browser: any
  • Local OS: macOS
  • Remote OS: macOS
  • Remote Architecture: amd64
  • code-server --version: 4.5.1

Steps to Reproduce

  1. run EXTENSIONS_GALLERY='{"serviceUrl":"undefined"}' code-server --install-extension yolo
  2. observe output

Expected

stderr should print No extension gallery service configured or something else.

Actual

stderr prints connect ECONNREFUSED 127.0.0.1:3000

Logs

EXTENSIONS_GALLERY='{"serviceUrl":"undefined"}' code-server --install-extension yolo
Installing extensions...
connect ECONNREFUSED 127.0.0.1:3000

Screenshot/Video

n/a

Does this issue happen in VS Code or GitHub Codespaces?

  • [X] I cannot reproduce this in VS Code.
  • [X] I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • [X] I am using HTTPS.

Notes

Identified while working on https://github.com/coder/code-server/pull/5432

Talking to @code-asher about this, we have a theory:

  • https://github.com/microsoft/vscode/blob/460768a452221ee8595dcc15114b285a09f4f9cf/src/vs/platform/extensionManagement/common/extensionGalleryService.ts#L598
  • this ends up being just /path without a domain
  • then in the request service it would get defaulted to port 80 and the default hostname is probably localhost so that explains the behavior Asher gets
  • still unsure why Joe gets 3000

jsjoeio avatar Aug 09 '22 19:08 jsjoeio