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

Error while fetching extensions. Server returned 503

Open khanakia opened this issue 4 years ago • 16 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS/Web Information

  • Web Browser: Chrome
  • Local OS: Mac Os
  • Remote OS: Ubunut
  • Remote Architecture: x64
  • code-server --version: 4.3.0 09bc30027a7fbba170f907a527eaa9f7219fe739 with Code 1.65.2

Steps to Reproduce

  1. open code-server
  2. Search any extension

Expected

It should search the extension

Actual

But getting error Error while fetching extensions. Server returned 503

Logs

No response

Screenshot/Video

Screenshot 2022-04-27 at 11 54 53 AM

Does this issue happen in VS Code?

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

Are you accessing code-server over HTTPS?

  • [X] I am using HTTPS.

Notes

The issue is happening because the new code-server version sending requests to https://open-vsx.org/vscode/gallery/extensionquery but the old version which is working fine is sending requests to https://extensions.coder.com/api/extensionquery that's why I am getting error.

ERROR CURL

curl 'https://open-vsx.org/vscode/gallery/extensionquery' \
  -H 'Accept: application/json;api-version=3.0-preview.1' \
  -H 'Content-Type: application/json' \
  --data-raw '{"filters":[{"criteria":[{"filterType":10,"value":"golan"},{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":12,"value":"4096"}],"pageNumber":1,"pageSize":50,"sortBy":0,"sortOrder":0}],"assetTypes":[],"flags":950}' \
  --compressed

WORKING CURL

curl 'https://extensions.coder.com/api/extensionquery' \
  -H 'accept: application/json;api-version=3.0-preview.1' \
  -H 'content-type: application/json' \
  --data-raw '{"filters":[{"criteria":[{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":10,"value":"gol"},{"filterType":12,"value":"4096"}],"pageNumber":1,"pageSize":50,"sortBy":0,"sortOrder":0}],"assetTypes":[],"flags":950}' \
  --compressed

khanakia avatar Apr 27 '22 06:04 khanakia

I have same problem :-(

image

dualface avatar Apr 27 '22 07:04 dualface

I think this problem source is https://open-vsx.org/ not available now.

dualface avatar Apr 27 '22 07:04 dualface

Meeeee Tooooo!! T_T

On the xavier ...

zed654 avatar Apr 27 '22 07:04 zed654

Was it down temporarily? It's working for me

image

jsjoeio avatar Apr 27 '22 17:04 jsjoeio

Yes, https://open-vsx.org was down today which caused the issue. The issue seems to be resolved now. So closing the ticket.

khanakia avatar Apr 27 '22 17:04 khanakia

It's happening now, again...

PhantasWeng avatar Jul 28 '22 07:07 PhantasWeng

It's happening now, again...

Tiny-Wei avatar Oct 13 '22 03:10 Tiny-Wei

Error Request failed: GET https://open-vsx.org/user (Service Unavailable) image

zhuangweiji avatar Oct 13 '22 05:10 zhuangweiji

Error Request failed: GET https://open-vsx.org/user (Service Unavailable) image

OK.... I can install the extensions from VSIX: https://www.alphr.com/vs-code-how-to-install-extensions/

zhuangweiji avatar Oct 13 '22 08:10 zhuangweiji

This is happening again for me. It seems like vsx server is quite unreliable.

To address this, I changed the default in the settings General from: https://open-vsx.org/vscode/gallery to https://marketplace.visualstudio.com/_apis/public/gallery

...and from https://open-vsx.org/vscode/item to https://marketplace.visualstudio.com/items

zytegalaxy avatar Apr 23 '25 21:04 zytegalaxy

This is happening again for me. It seems like vsx server is quite unreliable.

To address this, I changed the default in the settings General from: https://open-vsx.org/vscode/gallery to https://marketplace.visualstudio.com/_apis/public/gallery

...and from https://open-vsx.org/vscode/item to https://marketplace.visualstudio.com/items

Its works for me, dont forget restart your editor

lisongkun avatar Apr 24 '25 05:04 lisongkun

This is happening again for me. It seems like vsx server is quite unreliable.

To address this, I changed the default in the settings General from: https://open-vsx.org/vscode/gallery to https://marketplace.visualstudio.com/_apis/public/gallery

...and from https://open-vsx.org/vscode/item to https://marketplace.visualstudio.com/items

It works!

NickJay159 avatar Apr 24 '25 06:04 NickJay159

This is happening again for me. It seems like vsx server is quite unreliable.

To address this, I changed the default in the settings General from: https://open-vsx.org/vscode/gallery to https://marketplace.visualstudio.com/_apis/public/gallery

...and from https://open-vsx.org/vscode/item to https://marketplace.visualstudio.com/items

How exactly can I change the settings?

bkeraj-28 avatar Apr 24 '25 09:04 bkeraj-28

This is happening again for me. It seems like vsx server is quite unreliable.

To address this, I changed the default in the settings General from: https://open-vsx.org/vscode/gallery to https://marketplace.visualstudio.com/_apis/public/gallery

...and from https://open-vsx.org/vscode/item to https://marketplace.visualstudio.com/items

How exactly can I change the settings?

The fix is to add

  "extensionsGallery": { "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", 
                         "itemUrl": "https://marketplace.visualstudio.com/items" }

to /usr/lib/code-server/lib/vscode/product.json or any alternative location of product.json

indiano68 avatar Apr 24 '25 11:04 indiano68

if you're using the docker container, you ought to be able to set it via env var. EXTENSIONS_GALLERY='{"serviceUrl": "https://extensions.coder.com/api"}'

didn't work for me, so I'm overriding the entrypoint, which did work.

#!/bin/bash
set -e

PRODUCT_JSON="/app/code-server/lib/vscode/product.json"

if [ -f "$PRODUCT_JSON" ]; then
  # only insert once
  if ! grep -q '"extensionsGallery"' "$PRODUCT_JSON"; then
    # insert right after the opening `{`
    sed -i '1s|{|{\
\  "extensionsGallery": {\
\    "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",\
\    "itemUrl":    "https://marketplace.visualstudio.com/items"\
\  },|' "$PRODUCT_JSON"
    echo "✓ injected extensionsGallery into product.json"
  fi
else
  echo "⚠️  product.json not found at $PRODUCT_JSON"
fi

# Continue with the default container startup
exec /init

in docker-compose.yml

services:
  codeserver:
    image: linuxserver/code-server:latest
    user: "${UID:-0}:${GID:-0}"
    environment:
      PUID: 0    # linuxserver/codeserver
      PGID: 0    # linuxserver/codeserver
      TZ: Europe/Brussels
    ...
    entrypoint: ["/bin/bash", "/config/entrypoint.sh"]

TimChaubet-I4U avatar Apr 24 '25 11:04 TimChaubet-I4U

if you're using the docker container, you ought to be able to set it via env var. EXTENSIONS_GALLERY='{"serviceUrl": "https://extensions.coder.com/api"}'

didn't work for me, so I'm overriding the entrypoint, which did work.

#!/bin/bash set -e

PRODUCT_JSON="/app/code-server/lib/vscode/product.json"

if [ -f "$PRODUCT_JSON" ]; then

only insert once

if ! grep -q '"extensionsGallery"' "$PRODUCT_JSON"; then # insert right after the opening { sed -i '1s|{|{
\ "extensionsGallery": {
\ "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
\ "itemUrl": "https://marketplace.visualstudio.com/items"
\ },|' "$PRODUCT_JSON" echo "✓ injected extensionsGallery into product.json" fi else echo "⚠️ product.json not found at $PRODUCT_JSON" fi

Continue with the default container startup

exec /init in docker-compose.yml

services: codeserver: image: linuxserver/code-server:latest user: "${UID:-0}:${GID:-0}" environment: PUID: 0 # linuxserver/codeserver PGID: 0 # linuxserver/codeserver TZ: Europe/Brussels ... entrypoint: ["/bin/bash", "/config/entrypoint.sh"]

if you remove the single quotes form around the json, it works, however you can't install anything because they aren't signed by the extension marketplace

norweeg avatar Apr 24 '25 17:04 norweeg