microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.43k stars 29.34k forks source link

We cannot connect to the extensions Marketplae at this time, please try again later #119375

Closed BbIKTOP closed 3 years ago

BbIKTOP commented 3 years ago

macOS 11.2.3 (20D91)

Steps to Reproduce:

When I try to search for extensions, I am getting this error.Log:

extensionsViews.ts:317 Error querying extensions gallery Cannot read property 'toLowerCase' of undefined
query @ extensionsViews.ts:317
async function (async)
query @ extensionsViews.ts:314
(anonymous) @ extensionsViews.ts:235
y @ async.ts:24
show @ extensionsViews.ts:233
(anonymous) @ extensionsViewlet.ts:648
onDidAddViewDescriptors @ extensionsViewlet.ts:647
(anonymous) @ viewPaneContainer.ts:527
fire @ event.ts:622
triggerOnDidAddVisibleViewDescriptors @ viewContainerModel.ts:447
onDidChangeContext @ viewContainerModel.ts:634
(anonymous) @ viewContainerModel.ts:329
fire @ event.ts:622
(anonymous) @ event.ts:74
fire @ event.ts:622
fire @ event.ts:682
setContext @ contextKeyService.ts:326
set @ contextKeyService.ts:200
doSearch @ extensionsViewlet.ts:635
(anonymous) @ extensionsViewlet.ts:600
(anonymous) @ async.ts:261
Promise.then (async)
trigger @ async.ts:255
triggerSearch @ extensionsViewlet.ts:600
(anonymous) @ extensionsViewlet.ts:501
fire @ event.ts:624
(anonymous) @ suggestEnabledInput.ts:173
(anonymous) @ textModel.ts:263
fire @ event.ts:622
endDeferredEmit @ textModel.ts:3361
pushEditOperations @ textModel.ts:1284
_innerExecuteCommands @ cursor.ts:783
executeCommands @ cursor.ts:741
_executeEditOperation @ cursor.ts:446
(anonymous) @ cursor.ts:651
_executeEdit @ cursor.ts:606
type @ cursor.ts:639
(anonymous) @ viewModelImpl.ts:949
_withViewEventsCollector @ viewModelImpl.ts:1016
_executeCursorEdit @ viewModelImpl.ts:935
type @ viewModelImpl.ts:949
_type @ codeEditorWidget.ts:1065
type @ codeEditorWidget.ts:1591
type @ viewController.ts:70
(anonymous) @ textAreaHandler.ts:266
fire @ event.ts:622
(anonymous) @ textAreaInput.ts:351

Does this issue occur when all extensions are disabled?: Yes/No

vscodebot[bot] commented 3 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

sandy081 commented 3 years ago

Can you please record a video/gif trying to reproduce the issue and share with us. This will help us understanding how the issue happens.

BbIKTOP commented 3 years ago

Don't think it is really required. I simply pressed "Extensions" icon on the left toolbar, then started to type text I wanna search:

image
sandy081 commented 3 years ago

Please follow these steps

BbIKTOP commented 3 years ago

Did you read my first message? There's a log, which clearly states where it failed. Anyway:

  1. Nothing wrong, no failed requests

    image
  2. As there are no failed requests, I have nothing to check

  3. My network works like a swiss watch, of course. I see the image on the URL provided, here's more convenient check:

viktor@Black-pro-6:~ $ telnet ms-python.gallerycdn.vsassets.io 80
Trying 68.232.34.200...
Connected to ms-python.gallerycdn.vsassets.io.
Escape character is '^]'.
GET / HTTP/1.0

HTTP/1.0 404 Not Found
Content-Type: text/html
Date: Wed, 24 Mar 2021 11:36:52 GMT
Server: ECAcc (wmi/FEC0)
Content-Length: 345
Connection: close

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>404 - Not Found</title>
    </head>
    <body>
        <h1>404 - Not Found</h1>
    </body>
</html>
Connection closed by foreign host.
viktor@Black-pro-6:~ $
  1. Developer Tools Console: image

    Shared Process:

    image

    Log (Shared):

    image

    Log (Window):

    image
sandy081 commented 3 years ago

Assigning to April for investigation

sandy081 commented 3 years ago

It seems like following error is coming from recommendations.

querying extensions gallery Cannot read property 'toLowerCase' of undefined

BbIKTOP commented 3 years ago

It seems like following error is coming from recommendations.

querying extensions gallery Cannot read property 'toLowerCase' of undefined

What would you advice me to do to solve this? I tried complete removal/reinstall with no success.

yto60 commented 3 years ago

Hi, I had the same problem with my VSCode (version 1.56.0).

The error seems to have come from https://github.com/microsoft/vscode/blob/1.56.0/src/vs/workbench/contrib/experiments/common/experimentService.ts#L500 at local.manifest.publisher.toLowerCase(). Indeed, I had a local extension installed which didn't have a manifest.publisher set. The extension was one which I created for personal use, so I just set manifest.publisher for it.

As a workaround, disabling experimental stuff by setting

  "workbench.enableExperiments": false

in settings.json and reloading the window solved the problem too.

sandy081 commented 3 years ago

I cannot repro the bug but I investigated in the code that if there is an error while getting experiments, this is impacting the extensions view. So please review the fix especially this change - https://github.com/microsoft/vscode/commit/fd6adaf30a2c56ed2d5f92f10903dfb056ad4b83#diff-911e37f13f52205cd492d9ccc7d8021e8d62c6783943f938cf236b3f1723a32dR702-R710

Errors from experiments service are ignored.

rchiodo commented 3 years ago

/verified. PR looks like it would prevent the problem to me.