I am getting this error when using sfdx force:org:open or deploy or web:auth:login

ERROR running force:org:open: ERROR_HTTP_502

And this error when running git pull:

kex_exchange_identification: Connection closed by remote host Connection closed by UNKNOWN port 65535 fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

But I have no issue connecting to github or salesforce orgs using browser.

I have tried a number of ways investigating this issue. The git config and .zshrc files seem to be normal to me.

Since this issue only happens to me via command line, I am thinking this might have something to do with ssh. But after trying a few things suggested on stackoverflow, I still haven't fixed the issue.

I do understand this error code is not very helpful. But is there any way I can debug into?

1 Answer 1


The error message you are encountering while running git pull indicates a problem with the SSH connection to the remote repository. Here are a few possible solutions to resolve this issue:

  1. Check SSH Configuration: Verify that your SSH configuration is set up correctly. Ensure that you have the correct SSH key added to your SSH agent. You can use the following command to add your SSH key: ssh-add <path_to_ssh_private_key>. Additionally, confirm that your SSH public key is correctly associated with your remote repository.
  2. Verify Remote Repository URL: Double-check the URL of the remote repository you are trying to pull from. Make sure the URL is correct and accessible. Ensure that you have the necessary permissions to access the repository.
  3. Firewall or Network Restrictions: It's possible that your network or firewall settings are blocking the connection to the remote repository. Check if any network restrictions or firewalls are preventing the SSH connection. You may need to contact your network administrator or adjust your firewall settings accordingly.
  4. Temporary Connectivity Issue: Sometimes, the error may be caused by a temporary connectivity issue. Try running the git pull command again after a few minutes to see if the issue resolves itself.
  5. Remote Repository Availability: Ensure that the remote repository is available and functioning properly. It's possible that the repository server is experiencing issues or maintenance. You can try accessing the repository through a web browser or contacting the repository administrator for further assistance. 6.SSH Connection Troubleshooting: You can enable verbose output for SSH to get more detailed information about the connection issue. Use the following command before running git pull to enable verbose SSH output: export GIT_SSH_COMMAND="ssh -v".

If none of these solutions resolve the issue, please provide more details about your setup, such as the remote repository hosting platform (e.g., GitHub, Bitbucket, GitLab), the operating system you're using, and any additional error messages or logs you receive. This information will help in diagnosing and troubleshooting the problem more effectively.

  • 1
    Please do not post content authored by ChatGPT.
    – David Reed
    Jun 26, 2023 at 6:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .