MicrosoftDocs / intellicode

Visual Studio IntelliCode - AI-enhanced development tools. 👋Want to submit an issue to MicrosoftDocs/intellicode? If you have a bug or an idea, read the contributing guidelines before opening an issue. For FAQ's see
https://aka.ms/vsicfaq
Creative Commons Attribution 4.0 International
751 stars 69 forks source link

Couldn't download IntelliCode model (PROXY SSL issue) #157

Closed chdecourcel closed 2 years ago

chdecourcel commented 4 years ago

Product and Version [VS/VSCode]: VSCode 1.35.1 OS Version [macOS/Windows]: Windows 8.1 Enterprise IntelliCode Extension Version: 1.2.0 Target Platform or Language [e.g. Node.js]:

Steps to Reproduce / Scenario:

When Intellicode loads at VSCode startup, i get this error message : Couldn't download IntelliCode model. Please check your network connectivity or firewall settings.

And here is the Output Error: Acquiring model 'intellisense-members' for python Querying IntelliCode service for available models. Couldn't reach service Error Message: write EPROTO 10364:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:d:\_vsts\3\s\vendor\node\deps\openssl\openssl\ssl\record\ssl3_record.c:252: , (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: write EPROTO 10364:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:d:\_vsts\3\s\vendor\node\deps\openssl\openssl\ssl\record\ssl3_record.c:252: , (Error) No model available for Python, cannot continue.

The d: path does not exists on my machine.

The HTTP_PROXY / HTTPS_PROXY are set to the correct PROXY of our organisation. As i suspect it is a SSL / PROXY issue, I tried to unset the HTTP(S)_PROXY variables, and to reload VSCode. Then I got this message: Starting Microsoft Python language server. Downloading https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-win-x64.0.4.127.nupkg... download failed Error: Failed with status 407, Proxy Authentication Required, Uri https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-win-x64.0.4.127.nupkg Starting Jedi Python language engine.

So i tried to download the above package via Chrome, on the same machine. The download completed successfully. So may be i can use it as a local cache. But i don't know where to install / copy it.

Can you help me please ?

vivlimmsft commented 4 years ago

Hi chdecourcel,

To troubleshoot the first issue you are seeing, where you can't acquire the python model, please check if you can access this url through your proxy in Chrome.

For the second one, it looks like your network is set up to block network connections that don't go through the proxy. So you must configure the proxy somehow.

Do you have the http.proxySupport setting configured? Can you try setting it to override if so?

If you are behind an authenticated proxy, I'm not sure if that setting will help based on the discussion here: https://github.com/Microsoft/vscode/issues/12588#issuecomment-530719673 Maybe one of these workarounds could help: https://stackoverflow.com/questions/37730040/how-to-specify-a-user-id-and-password-for-visual-studio-code-with-an-authenticat?rq=1

Unfortunately for IntelliCode we don't support downloading a model and installing it outside of VS Code. I'm not sure whether the Microsoft Python language server supports manual download & install.

chdecourcel commented 4 years ago

Hi vivlimmsft,

thank you for your message.

To answers your first question, Yes i can get access to the first url. Response is a JSON dict: {"model":{"id":"88630A1B4C077752096ECAA576B92C7D3FA1","friendlyName":"Base (Python)","language":"python","analyzer":"intellisense-members"},"output":{"id":"9BA695AD4C514C32A5D0AC9B02846CD7","modelId":"88630A1B4C077752096ECAA576B92C7D3FA1","targetedInputIds":[],"version":1570750537470,"status":"OutputReady","trainingResults":{"totalClasses":9710,"displayClasses":["numpy","os","tensorflow"]},"blob":{"schema":"azureBlobStorage","name":"Output_88630A1B4C077752096ECAA576B92C7D3FA1_9BA695AD4C514C32A5D0AC9B02846CD7","azureBlobStorage":{"readSasToken":"https://cdsmprodstg.blob.core.windows.net/models-prod-output/Output_88630A1B4C077752096ECAA576B92C7D3FA1_9BA695AD4C514C32A5D0AC9B02846CD7?sv=2018-03-28&sr=b&sig=ef9c6u%2BZBGnAm1F7N22pH4wAJyMn3EreufJxS6%2FB8R0%3D&se=2019-12-11T12%3A12%3A17Z&sp=r"}},"created":"2019-10-10T23:35:37.4706165Z","updated":"2019-10-11T08:52:34.3058442Z"}}

Regarding the http.proxySupport i have set it to ON and also set the http:proxy settings in VSCode (and not only as an environnement variable on Windows).

And this has changed the log messsage to: Acquiring model 'intellisense-members' for python Querying IntelliCode service for available models. Couldn't reach service Error Message: tunneling socket could not be established, statusCode=503, (Error) Could not reach the IntelliCode service. Checking the local model cache. Recent model was found in cache. vs-intellicode-python was passed a model: {"modelPath":"c:\\Users\\XXXYYY\\.vscode\\extensions\\visualstudioexptteam.vscodeintellicode-1.2.0\\cache\\88630A1B4C077752096ECAA576B92C7D3FA1_9BA695AD4C514C32A5D0AC9B02846CD7","modelId":"88630A1B4C077752096ECAA576B92C7D3FA1","outputId":"9BA695AD4C514C32A5D0AC9B02846CD7"}. Loaded language server extension.

So it seems that it has found a local model cache. Furthermore, the error message from IntelloCode has desapeared ! Should i considered this as OK, despite the tunneling socket error ? Best regards.

markw-t commented 4 years ago

@vivlimmsft is what @chdecourcel is seeing OK?

vivlimmsft commented 4 years ago

Couldn't reach service Error Message: tunneling socket could not be established, statusCode=503, (Error) Could not reach the IntelliCode service This means that the service couldn't be reached to update the model, but IntelliCode is still able to run using the cached model. Interestingly, there could only be a cached model if IntelliCode was able to talk to the service at least once, so at some point things were configured so that could happen.

Is this issue still happening for you?

ayim commented 2 years ago

@chdecourcel thanks for opening this issue! Hope IntelliCode's still been helpful for you if you're continuing to use it.

If you're still seeing this issue, we'd love to hear from you! Feel free to open a new issue