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.

exited with an unexpected code: 128. Host key verification failed. fatal: Could not read from remote repository.

See original GitHub issue

Description

Just installed GitHub Desktop fresh. I opened a local cloned repo, commited a change and tried to push.

2018-04-20T08:11:04.553Z - info: [ui] Executing fetch: git -c credential.helper= fetch --progress --prune origin (took 3.414s)
2018-04-20T08:11:04.553Z - error: [ui] `git -c credential.helper= fetch --progress --prune origin` exited with an unexpected code: 128.
Host key verification failed.
fatal: Could not read from remote repository.

I suspect the issue is in the git binary that GH desktop is using.

Version

  • GitHub Desktop: 1.1.1
  • Operating system: Microsoft Windows [Version 10.0.16299.371]

Steps to Reproduce

Install GitHub Desktop fresh. I opened a local cloned repo, commited a change and tried to push.

Expected Behavior

Pushes

Actual Behavior

Authentication error modal

Additional Information

Have installed git for windows, git in cygwin and gitkraken. All these work in their own respective environments.

Logs

Relevant excerpt provided above

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
stevewardcommented, Apr 20, 2018

@deed02392 that’s all the information I needed, and it does indicate that this repository is using SSH.

There are two solutions for this:

  1. Switch the remote URL to use HTTPS instead of SSH (you should not have any authentication issues as long as you are logged in with your GitHub Enterprise account in GitHub Desktop).
  2. Get SSH working. The host key verification failed error means that the host key from GitHub Enterprise isn’t in your known_hosts file. You should be able to fix this by running the following command from Git Bash:

ssh-keyscan -H <GitHub_Enterprise_URL> >> ~/.ssh/known_hosts

Replace <GitHub_Enterprise_URL> with the URL of the GitHub Enterprise server you are connecting to.

Hope that helps. Let me know if that doesn’t get things working.

2reactions
stevewardcommented, Apr 20, 2018

@deed02392 thanks for the update. You can check the remote URL the repository is using from GitHub Desktop by going to the file menu and selecting Repository > Repository Settings > Remote. Let me know what that shows.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git error: "Host Key Verification Failed" when connecting to ...
You should be prompted to add github to your known hosts. If this hasn't happened, you can run ssh -T git@github.com to receive...
Read more >
How to fix the error “host key verification failed” - The Geek Diary
This indicates some environment of the SSH server has changed since last time you connected to it, especially the public key and the...
Read more >
GitHub Host Key Verification Failed - How to Use GitLab
desc = Gitlab::Git::RepositoryMirroring::RemoteError: Host key verification failed. fatal: Could not read from remote repository.
Read more >
I can't install the repo from a remote bitbucket p...
Exit code : 128 Command: git Arguments: ls-remote --tags --heads. ... I got this error. ... fatal: Could not read from remote repository....
Read more >
notebook import from git with LDAP credentials
Branches and tags could not be fetched from remote Git, caused by: IOException: Process failure, caused by: IOException: Process execution ...
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