question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bloxsomecommented, Oct 8, 2021

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

0reactions
mohanraj-rcommented, Apr 1, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio and Salesforce CLI : Not able to authorize org
In my case I have to uninstall Salesforce Extension Pack and reinstall in after I setting up Http proxy in Environment Variable. Share....
Read more >
SFDX Extension behind proxy without HTTP_PROXY ...
When setting only proxy in workspace settings and not setting HTTP_PROXY the extension isn't able to connect to salesforce ...
Read more >
Use the Salesforce CLI from Behind a Company Firewall or ...
To address this issue, run these commands from your terminal or Windows command prompt, replacing username:pwd with your web proxy username and password....
Read more >
Setup Visual Studio Code's Network Connection
Proxy server support​​ This means that your proxy settings should be picked up automatically. Otherwise, you can use the following command-line arguments to ......
Read more >
Setting Corporate network proxy in Visual Studio Code?
Later I got to know that I will have to set up the network proxy in VS Code. I have gone through the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found