microsoft / vscode-mssql

Visual Studio Code SQL Server extension.
Other
1.54k stars 458 forks source link

502 error code after update to 1.20.1 #17772

Closed EdCallahan closed 1 year ago

EdCallahan commented 1 year ago

This is a continuation of the getProxyAgentOptions error error I previously reported.

I was able to get version 1.20.0 working using the advise at https://github.com/microsoft/vscode-mssql/issues/17755#issuecomment-1657959401

After VSCode updated the extension to 1.20.1 today, when I try to establish a SQL Connection I now get a 502 error:

Installing SQL tools service to c:\Users\EVCallahan\.vscode\extensions\ms-mssql.mssql-1.20.1\sqltoolsservice\4.8.1.2\Windows.
Downloading https://github.com/Microsoft/sqltoolsservice/releases/download/4.8.1.2/microsoft.sqltools.servicelayer-win-x64-net7.0.zip
failed (error code '502')
[ERROR] Error: 502

Manually downloading https://github.com/Microsoft/sqltoolsservice/releases/download/4.8.1.2/microsoft.sqltools.servicelayer-win-x64-net7.0.zip and extracting the content to C:\Users\<username>\.vscode\extensions\ms-mssql.mssql-1.20.1\sqltoolsservice\4.8.1.2\Windows and restarting VSCode worked around the problem

Steps to Reproduce:

  1. Allow VSCode to update mssql extension from 1.20.0 to 1.20.1
  2. Try to establish SQL Connection with mssql.connect

image

cheenamalhotra commented 1 year ago

Hi @EdCallahan

It seems your proxy is denying the connection. Does removing proxy settings in settings.json help?

EdCallahan commented 1 year ago

It seems your proxy is denying the connection. Does removing proxy settings in settings.json help?

Hi @cheenamalhotra, I appreciate your responsiveness to this issue.

I can download the ZIP file fine via my proxy, using my web browser for instance. So I don't think the proxy is denying the connection. I think the extension is having a hard time determining the correct proxy settings, or otherwise isn't using the proxy.

I've been doing some debugging. The problem exists when I have the following line in my settings.json:

"http.proxySupport": "on"

When I remove that line the problem goes away.

For your reference my other proxy settings in settings.json are (IP address partially masked):

    "http.proxy": "http://199.17.xxx.xxx:xxxx",
    "http.proxyStrictSSL": false,

I find it surprising, but removing all the proxy statements from my json file does alleviate the problem without any ill effect I've noticed so far.

It appears that when mssql is forced to use the settings.json for proxy information it fails, but succeeds when relying on the OS? The settings in both look identical to my eye.

cheenamalhotra commented 1 year ago

Thanks for validating @EdCallahan We'll keep note of this and hopefully resolve this soon, in the meantime, please choose the settings that work best for you.

cc @cssuh for consideration