Home > Software design >  Heroku: Host key verification failed, Could not read from remote repository
Heroku: Host key verification failed, Could not read from remote repository

Time:10-14

I currently have a private server that I share with another person. I have made changes locally on my computer which work just fine. When merging changes on Github, I went over to Heroku and pulled the new changes to the master branch. We don't use the Heroku CLI and just use git and github for all our changes.

Suddenly the build fails and can't compile. This is the error in question.

   npm ERR! Host key verification failed.

   npm ERR! fatal: Could not read from remote repository.

   npm ERR! 

   npm ERR! Please make sure you have the correct access rights

   npm ERR! and the repository exists.

   npm ERR! 

   npm ERR! exited with error code: 128

This is the first time seeing this error when it never happened before. The other person was able to push changes just fine with no issues. Now, we can't update our server because of this error. Could anyone walk us through steps on how to solve this issue? Thanks.

CodePudding user response:

I managed to find the solution to this issue. I didn't set up my git username and email on my computer in terminal. I also needed to generate a personal access token to be able to make changes to private repositories.

I ended up configuring my Git username and email using the following commands on terminal

  1. git config --global user.name "name-goes-here"
  2. git config --global user.email [email-goes-here]

Refer to this article for more information on how to set it up

You will also need to create a new Personal Access Token (PAT) using this document.

I then proceeded, to remove my macOS Keychain credential to add my new personal access token.

$ git credential-osxkeychain erase
host=github.com
protocol=https
> [press enter]

You can reference the document in question using this link updating credentials Github Docs

Afterwards, when you try to push/pull/merge changes to the repository, it will prompt you to login with your Github email and you can add your Personal Access Token as the password. The error specified should go away.

  • Related