forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
949 stars 403 forks source link

SFDX plugin not picking up http.proxy from VS code settings #2340

Open prateekmathur1991 opened 4 years ago

prateekmathur1991 commented 4 years ago

Summary

The project I work on requires HTTP_PROXY environment variable to be set, for sfdx commands to work. I can set that using export HTTP_PROXY=http://MY_USERNAME:MY_PASSWORD@PROXY_URL:PORT, and run the sfdx commands (e.g. sfdx force:source:retrieve, or sfdx force:source:deploy) manually. But this means that I cannot use the UI shortcuts provided by Salesforce extensions for VS Code, (SFDX: Retrieve this source from org), because that fails with this error -

ERROR:  Error: getaddrinfo ENOTFOUND MY_ORG_DOMAIN.my.salesforce.com:443
ERROR running force:source:retrieve:  getaddrinfo ENOTFOUND MY_ORG_DOMAIN.my.salesforce.com MY_ORG_DOMAIN.my.salesforce.com:443

I tried to resolve this by setting http.proxy setting in VS code for my project workspace, but this does not resolve the problem. I also tried experimenting with the http.proxyStrictSSL, and http.proxySupport settings, but that also didn't worked.

My guess is that, Salesforce Extensions plugin only pick proxy settings from the http_proxy and https_proxy environment variables, but not from the VS code settings.

Steps To Reproduce:

  1. In VS Code, open command palette, and open 'Prefrences: Open User Settings'
  2. Open the workspace tab, and search for 'proxy'
  3. In the setting named Http: Proxy, set your desired proxy server URL
  4. Open command palette, and select 'Developer: Reload Window' to reload your workspace
  5. Open any salesforce resource (apex class, LWC component, apex trigger etc), right click, and select 'SFDX: Retrieve this source from org'

Expected result

The sfdx force:source:retrieve command that executes as part of step 5 should have completed successfully.

Actual result

The command fails with this error -

ERROR:  Error: getaddrinfo ENOTFOUND MY_ORG_DOMAIN.my.salesforce.com:443
ERROR running force:source:retrieve:  getaddrinfo ENOTFOUND MY_ORG_DOMAIN.my.salesforce.com MY_ORG_DOMAIN.my.salesforce.com:443

VS Code Version: Version: 1.47.0 Commit: d5e9aa0227e057a60c82568bf31c04730dc15dcd Date: 2020-07-09T08:01:54.115Z Electron: 7.3.2 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Darwin x64 19.5.0

SFDX CLI Version: sfdx-cli/7.56.1-2773b53bf5 darwin-x64 node-v10.15.3

OS and version: macOS Catalina Version 10.15.5

prateekmathur1991 commented 4 years ago

Any updates on this one?

git2gus[bot] commented 4 years ago

This issue has been linked to a new work item: W-7907789

lcampos commented 4 years ago

Hi @prateekmathur1991 I can confirm this is a limitation in the extensions. I've added it to our list of items to look into and will provide an update on this once we schedule the work to address this.

cc @smaddox-sf

prateekmathur1991 commented 3 years ago

@lcampos Is there any update on this? Any tentative schedule when will this be available?

bloxsome commented 2 years ago

Any update on this @lcampos and @smaddox-sf? We would like this capability as well.

mohanraj-r commented 2 years ago

We have this to our backlog and will prioritize it as possible. Currently we don't have any updates on when it will be available. Sorry about that.

cwarden commented 4 months ago

Proxy support seems to be broken due to the transitive dependency on https-proxy-agent through request-light.