Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't download IntelliCode model. #165

Closed
anatolyburakov opened this issue Jan 30, 2020 · 23 comments
Closed

Couldn't download IntelliCode model. #165

anatolyburakov opened this issue Jan 30, 2020 · 23 comments
Labels
model-acquisition Issue related to obtaining a model file over the network product-issue python vscode

Comments

@anatolyburakov
Copy link

Issue Type: Bug

I get the following error when attempting to download IntelliCode models:

Could not retrieve data from Experimentation service: Error: read ECONNRESET
Acquiring model 'intellisense-members' for python
Querying IntelliCode service for available models.
Couldn't reach service Error Message: tunneling socket could not be established, cause=Client network socket disconnected before secure TLS connection was established, (Error)
Could not reach the IntelliCode service. Checking the local model cache.
None of the cached models match.
Couldn't download IntelliCode model. Please check your network connectivity or firewall settings. Error Message: tunneling socket could not be established, cause=Client network socket disconnected before secure TLS connection was established, (Error)
No model available for Python, cannot continue.

My proxy settings are correct, everything else is working.

Extension version: 1.2.4
VS Code version: Code - Insiders 1.42.0-insider (9e8c4c247a779cdd1f4f53db963bc6124a28ac2f, 2020-01-30T05:29:34.196Z)
OS version: Windows_NT x64 10.0.17763
Remote OS version: Linux x64 4.15.0-74-generic

@osobeso
Copy link
Collaborator

osobeso commented Feb 3, 2020

Hi!
This seems a lot like a proxy issue, or a firewall perhaps not letting you access our servers.
Could you try it on a different network and see if the problem persists?

Thanks for the feedback!

@anatolyburakov
Copy link
Author

@osobeso as i have already stated above, my proxy settings are correct, as everything else is working. i can install the extension no problem, i can install other extensions that have non-extension dependencies (e.g. cpptools) no problem, they all work. this one doesn't - so it's something related to this particular extension's way of downloading its dependencies that's at fault here.

how do i debug this issue and see what commands it is generating?

@osobeso
Copy link
Collaborator

osobeso commented Feb 5, 2020

Hi @anatolyburakov
I'm not sure if you also set your VSCode proxy settings to 'override'.
If you haven't please do and try again.
You can find how to do that in this thread's comment #4

I'm asking because the error message seems to be the same.
That thread covers the same probem that you're facing.

There are also other ways to download the models, but it requires some extra steps of configuration so let's try first with the Proxy override. But we can follow up with that in case my previous provided solution doesn't work (or if you've already done it).

As for your question about how to debug it, I don't think there's need to do that, the console messages are very clear, there's a connection issue that's not allowing us to download the models (or access some of the web services the extension queries).

Again, thanks for the feedback, and let's hope this gets fixed 😄

Oscar.

@anatolyburakov
Copy link
Author

anatolyburakov commented Feb 5, 2020

@osobeso my proxy settings are already on "override".

the "connection issue" is not very descriptive, because nothing else has these "connection issues" (well, LiveShare extension also does, and i would bet that the root cause is exactly the same), and, as i said, the proxy settings are otherwise correct. That means that whatever way you're trying to download the dependencies, it doesn't take proxy settings into account.

I've tried wget-ing the IntelliCode model manually from the target machine, and it worked (link taken from here):

anatoly@xxxx:~/tmp$ wget "https://cdsmprodstg.blob.core.windows.net/models-prod-output/Output_88630A1B4C077752096ECAA576B92C7D3FA1_9BA695AD4C514C32A5D0AC9B02846CD7?sv=2018-03-28&sr=b&sig=EqKpziAF8sBVdPjLyp%2BKPVL%2F3BAstUiAE%2BmWzfSisJI%3D&se=2020-02-05T10%3A27%3A06Z&sp=r"
--2020-02-05 09:57:56--  https://cdsmprodstg.blob.core.windows.net/models-prod-output/Output_88630A1B4C077752096ECAA576B92C7D3FA1_9BA695AD4C514C32A5D0AC9B02846CD7?sv=2018-03-28&sr=b&sig=EqKpziAF8sBVdPjLyp%2BKPVL%2F3BAstUiAE%2BmWzfSisJI%3D&se=2020-02-05T10%3A27%3A06Z&sp=r
Resolving proxy-xxxx.com (proxy-xxxx.com)... <proxy IP>
Connecting to proxy-xxxx.com (proxy-xxxx.com)|<proxy IP>|:<proxy port>... connected.
Proxy request sent, awaiting response... 200 OK
Length: 2401248 (2.3M) [application/octet-stream]
Saving to: ‘Output_88630A1B4C077752096ECAA576B92C7D3FA1_9BA695AD4C514C32A5D0AC9B02846CD7?sv=2018-03-28&sr=b&sig=EqKpziAF8sBVdPjLyp+KPVL%2F3BAstUiAE+mWzfSisJI=&se=2020-02-05T10:27:06Z&sp=r’

Output_88630A1B4C077752096ECAA576B92C7D3FA1_9BA69 100%[=============================================================================================================>]   2.29M  2.48MB/s    in 0.9s    

2020-02-05 09:57:58 (2.48 MB/s) - ‘Output_88630A1B4C077752096ECAA576B92C7D3FA1_9BA695AD4C514C32A5D0AC9B02846CD7?sv=2018-03-28&sr=b&sig=EqKpziAF8sBVdPjLyp+KPVL%2F3BAstUiAE+mWzfSisJI=&se=2020-02-05T10:27:06Z&sp=r’ saved [2401248/2401248]

As you can see, there are no "connectivity issues" there - the proxy works, and wgeting the model directly also works. The problem is with the extension.

@osobeso
Copy link
Collaborator

osobeso commented Feb 5, 2020

Thanks for the information provided @anatolyburakov.
I'm going to do some more research about it, as you mention is probably the way we're calling the services.
I'd assume you are behind corporate proxy settings, this is going to make it a little harder for me to replicate the bug, but if you have any information you could provide to me that would help me create a similar environment it would be really helpful.

Thanks again!

@anatolyburakov
Copy link
Author

anatolyburakov commented Feb 6, 2020

@osobeso i am indeed behind a corporate proxy. I can't offer you anything more, besides the fact that i am running on Windows 10 and using Linux as a remote. both are behind corporate SOCKS5 proxy.

one thing of note here is that technically HTTP and HTTPS proxies are different (they connect to different ports). however, i've tried changing those to be the same, and it had no effect, so it's most likely not the proxy itself that's the problem, but the connection method being in use (maybe something in Node.js itself?).

if you need to run any code or create any debugging logging, i'll gladly oblige, since i understand that this issue is very difficult to reproduce without our proxy.

@vivlimmsft
Copy link
Collaborator

Do you have the http.proxy or https.proxy VSCode settings configured?
I looked at a similar issue a year ago (#93 (comment)) where it seemed that VSCode was sending the wrong proxy settings to the remote. (microsoft/vscode-remote-release#213)

@anatolyburakov
Copy link
Author

@vivlimmsft yes, i do have both set, and env variables as well. they are all set to the same value, as proxy is the same on local and remote system. i also tried fiddling with proxy settings on host and guest, to no avail.

i've just tried explicitly setting a proxy on guest machine (clearing all settings in advance), and it didn't have any effect. however, even absent of proxy settings in VSCode, my env vars are set up properly as well - i have both http(s)?_proxy and HTTP(S)?_PROXY variables set up correctly (on both local and remote).

@mchugh19
Copy link

I had this issue when running on a Windows desktop. Our proxy setup is configured with the login session's kerberos ticket, but I was used to entering my proxy settings manually from linux. Even though my proxy credentials were correct, I saw this error. Clearing out the proxy setting in vscode, allowed it to use the host proxy, and it was able to download.

@anatolyburakov
Copy link
Author

I had this issue when running on a Windows desktop. Our proxy setup is configured with the login session's kerberos ticket, but I was used to entering my proxy settings manually from linux. Even though my proxy credentials were correct, I saw this error. Clearing out the proxy setting in vscode, allowed it to use the host proxy, and it was able to download.

We don't have auth on our proxy.

@anatolyburakov
Copy link
Author

Any movement expected on this?

@falcomomo
Copy link

I've also been having the same issue as @anatolyburakov. I'm also behind a corporate proxy/firewall and have all the http proxy variables set etc.
I'm also able to follow the instructions to download the blob here: comment above comment#4. However, creating the json to point the caching somewhere doesn't seem to work - I did change the modified and access times in the json for the files as appropriate too.

I'm absolutely happy to have a manual solution where I just download the blobs myself and point the plugin to them somehow - is there at least updated instructions for that?

@anatolyburakov
Copy link
Author

IMO this is really an ecosystem-wide problem with Node.js, because it doesn't have a well-defined built-in proxy support. I keep seeing these proxy issues popping up in just about every software package that's ever been built with Node, and everyone seems to have a slightly different partially working proxy implementation. VSCode should really provide its own framework for abstracting away network connections, so that the extensions don't have to care about proxy settings, but apparently no such luck.

@markw-t
Copy link
Contributor

markw-t commented Jul 22, 2020

tagging @osobeso and @vivlimmsft to respond to @falcomomo 's question on latest instructions and close.

@eromoe
Copy link

eromoe commented Sep 23, 2020

Microsoft should provide a cdn for every static packages related to vscode , in order to cope with network issue in different countries .

For example, github asserts is on aws servers which are almost of all blocked in China .

@anatolyburakov
Copy link
Author

it has been a year since this was reported, any updates?

@sglbl
Copy link

sglbl commented Mar 22, 2021

it has been a year since this was reported, any updates?

Today I faced with the same problem. Yesterday, I opened outbound rules from Control Panel -> Network and Sharing Center -> Windows Firewall -> Advanced Setting -> Outbound Rules. Then I blocked an application's internet connection. ( not vscode or similar. It was an pdf app) and after that I had this problem. Today I solved it with opening Outbound Rules and deleting that rule that I blocked. And problem solved for me. I hope it works for you

@pauloneves
Copy link

pauloneves commented Aug 19, 2021

I had this problem using the Ssh remote extension and here is how I solved it.

My local machine is a Windows machine. I have a local cntlm proxy executing with my configuration. Remote SSH works flawlessly, downloading extensions using this proxy.

My remote machine is a linux machine. In my .bashrc I set my http*_proxy variables to another proxy. In my terminal, these variables are correctly set, but I don't think that VSCode sees them.

Solution:: In the Remote settings I configured:

  • Http: Proxy Support as override
  • Http: Proxy as my remote http proxy. If I set an https proxy url here, it failed.

Now I can see in the logs that the model is correctly downloaded.

I believe the correct behavior would be to download the model using my local cntml proxy and transfer it to the remote machine.

@ishallbethat
Copy link

can IntelliCode model support work without internet access ? My VScode does run within corporate network and we don't have internet access. And i hope IntelliCode model supports offline installation or works without internet access.

@ayim ayim pinned this issue Apr 5, 2022
@ayim
Copy link
Collaborator

ayim commented Apr 5, 2022

Pinned and leaving this open just in case anyone needs this workaround.

@Winson-Huang
Copy link

I have met a similiar problem during remote develop, output of IntelliCode is like:

Language server is set to "Default". Pylance is used as current language server.
Acquiring model
Acquiring model 'intellisense-members-lstm-pylance' for python
Querying IntelliCode service for available models.
vs-intellicode-python was passed a model: {}.
Couldn't reach service Error Message: Failed to establish a socket connection to proxies: ["PROXY 127.0.0.1:7890"], (Error)
Could not reach the IntelliCode service. Checking the local model cache.

I use the remote-wsl ext to connect to a "remote-wsl" host (but actually inside my local Windows host) , and there is a proxy service on my Windows listening at http://127.0.0.1:7890, when I open a py file in wsl at VSCode, the IntelliCode ext starts to download the model but failed.
The default proxy settings in VSCode is

"http.proxySupport": "override",
"http.proxy": "",

which means it use local host's system proxy and override it to all exts whether in local or remote. but wsl cannot use 127.0.0.1 to communicate with host.

if you use remote-ssh and follow: #165 (comment) , maybe problem solved, but in remote-wsl it's different, Remote settings doesn't work . (I really think this's a bug)

finally, I configured the local settings.json:

"http.proxySupport": "override",
"http.proxy": "http://<Windows Ethernet adapter vEthernet (WSL) IP address>:7890",

In this way, exts in both Windows and wsl can connect to proxy service on Windows. and because this IP:<Windows Ethernet adapter vEthernet (WSL) IP address> may varys when Windows restart, you can alias some command to better control the "http.proxy" in settings.json.

hope it helps someone.

@tazimmadre
Copy link

tazimmadre commented Mar 4, 2024

FIXED FOR ME
For me accidentally this was set so was unable to read and write either remove this from settings.json of VS Code or else add a read-writable path to store and cache models.

    "vsintellicode.modelDownloadPath": "",

@vivlimmsft vivlimmsft added the model-acquisition Issue related to obtaining a model file over the network label Mar 7, 2024
@vivlimmsft
Copy link
Collaborator

As of version v1.3.0, we no longer download models- they are included as part of the extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
model-acquisition Issue related to obtaining a model file over the network product-issue python vscode
Projects
None yet
Development

No branches or pull requests