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

EXTENSIONS_GALLERY environment variable parsing error

Open ericsgagnon opened this issue 4 years ago • 3 comments

OS/Web Information

  • Web Browser: chrome
  • Local OS: ubuntu 20.04
  • Remote OS: ubuntu 20.04
  • Remote Architecture: amd x86_64
  • code-server --version: 4.0.1 735c6da829535969ff7193c79379299e4a1cb9bc

Steps to Reproduce

  1. curl -fsSL https://code-server.dev/install.sh | bash -s -- --method=standalone --prefix=/usr/local
  2. export EXTENSIONS_GALLERY='{"serviceUrl": "https://extensions.coder.com/api"}'
  3. run code-server

Expected

code-server should run with legacy extension marketplace.

Actual

parsing error for EXTENSIONS_GALLERY - result is that it ignores it and uses the pre-baked custom open vsix marketplace.

Logs

[08:39:10] Extension host agent started.
[08:39:11] [127.0.0.1][4ad73486][ManagementConnection] New connection established.
[08:39:12] [127.0.0.1][690f299a][ExtensionHostConnection] New connection established.
[08:39:12] [127.0.0.1][690f299a][ExtensionHostConnection] <4807> Launched Extension Host Process.
[08:39:12] [127.0.0.1][690f299a][ExtensionHostConnection] <4807> Custom marketplace env found. Parsing...
[08:39:12] [127.0.0.1][690f299a][ExtensionHostConnection] <4807> SyntaxError: Unexpected token s in JSON at position 1
    at JSON.parse (<anonymous>)
    at m (/usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/server/remoteExtensionHostProcess.js:84:13118)
    at Object.<anonymous> (/usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/server/remoteExtensionHostProcess.js:84:18246)
    at Function.i._safeInvokeFunction (/usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/loader.js:5:1337)
    at Function.i._invokeFactory (/usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/loader.js:5:1584)
    at i.complete (/usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/loader.js:5:1821)
    at i._onModuleComplete (/usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/loader.js:6:991)
    at i._resolve (/usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/loader.js:6:510)
    at i.defineModule (/usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/loader.js:5:6142)
    at v (/usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/loader.js:6:1702)
    at g (/usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/loader.js:4:2557)
    at Object.<anonymous> (/usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/server/remoteExtensionHostProcess.js:84:13160)
    at Object.<anonymous> (/usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/server/remoteExtensionHostProcess.js:114:32934)
    at e._createAndEvalScript (/usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/loader.js:4:2601)
    at /usr/local/lib/code-server-4.0.1/vendor/modules/code-oss-dev/out/vs/loader.js:4:2240
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:71:3)

ericsgagnon avatar Jan 17 '22 09:01 ericsgagnon

I have tested on my Cloud9 AWS EC2 setup, and can't replicate this, though I didn't install using step 1, the difference being I didn't use the options --method=standalone or --prefix=/usr/local Step 2 was entered verbatim.

w0otness avatar Jan 17 '22 23:01 w0otness

@ericsgagnon the Coder Extension marketplace is not being maintained just so you know.

I am not seeing any obvious errors with the JSON and I cannot reproduce this locally:

➜ EXTENSIONS_GALLERY='{"serviceUrl": "https://extensions.coder.com/api"}' code-server
[2022-01-18T17:56:54.915Z] info  code-server 4.0.1 975cf5a64e3c1a117931e9a176a09951d9ce3cdb
[2022-01-18T17:56:54.916Z] info  Using user-data-dir ~/.local/share/code-server
[2022-01-18T17:56:54.933Z] info  Using config file ~/.config/code-server/config.yaml
[2022-01-18T17:56:54.933Z] info  HTTP server listening on http://127.0.0.1:8080/ 
[2022-01-18T17:56:54.933Z] info    - Authentication is enabled
[2022-01-18T17:56:54.933Z] info      - Using password from ~/.config/code-server/config.yaml
[2022-01-18T17:56:54.933Z] info    - Not serving HTTPS 
Custom marketplace env found. Parsing...
Custom marketplace enabled.
{
  "serviceUrl": "https://extensions.coder.com/api",
  "itemUrl": "",
  "resourceUrlTemplate": "",
  "controlUrl": "",
  "recommendationsUrl": ""
}

jsjoeio avatar Jan 18 '22 17:01 jsjoeio

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

stale[bot] avatar Jul 17 '22 21:07 stale[bot]