Why is VSCode "Unable to open Extension. An unknown error occurred."?

It happens that, this is a problem with the Egyptian ISPs' default DNS servers, which are most probably blocking some of Microsoft servers.

The solution (in case you live in Egypt):

  1. clear DNS cache using ipconfig /flushdns command on Windows cmd (For Other OS).
  2. change the default DNS servers in your router settings to Google's 8.8.8.8 & 8.8.4.4 (or Cloudflare's 1.1.1.1 or any other DNS server you trust).
  3. restart VSCode and try installing extensions.

Hopefully, everything will work fine by now.

Check this Github issue for more insight.


It probably is because of the certificate check.

Below solution works for me in CentOS 7 (Linux).

Step 1. Change the file /usr/share/applications/code.desktop

Open the file /usr/share/applications/code.desktop, then modify the Exec value with adding --ignore-certificate-errors before %F:

Exec=/usr/share/code/code --unity-launch --ignore-certificate-errors %F

Save the file with typing sudo in the begining.

the file code.desktop

Step 2. Close all windows of vs code instances.

Step 3. Back to the terminal, use below command to open VS code:

code --ignore-certificate-errors

Step 4. Click extension button in the left side bar.

Click any extension like "Ruby" by Peng Lv, if the images in the Details page can be seen successfully, perhaps the issue is solved.

Step 5. Try to continue to install the extensions you need.

Just enjoy! May it be helpful for you.