My build is failing because of "No Such Key" or "Host key verification failed". What do I do?

If you are seeing these errors, your configuration is probably trying to use other repositories that Runnable does not have access to.

Command failed: Host key verification failed.
fatal: Could not read from remote repository.

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

To give containers within Runnable access to those dependency repositories, we just need to generate and add the right ssh key to the repository’s configuration.

Generate SSH Key

SSH keys come in a pair, private and public. To generate a new ssh key pair, open up a terminal session on a Linux or Mac machine you trust. If you already have an SSH key that you would like to use, skip this step.

  1. Navigate to the ~/.ssh/ directory. (Or create it, if it doesn’t exist)

$ mkdir -p ~/.ssh/ && cd ~/.ssh

  1. Generate the SSH key

$ ssh-keygen -t rsa -b 4096 -C "[email protected]**.

  1. You will be prompted to provide a location for the generated key. Press enter if you are happy with the default location. You can change the location if you want to, but make sure that you choose a safe location.

Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Hit Enter]

  1. You will now be prompted to enter a passphrase. You have to press enter to signal that you don’t want to add a passphrase for this key. It’s important to not set a paraphrase for the key to work with Runnable.
  Enter passphrase (empty for no passphrase): [Hit Enter]
  Enter same passphrase again: [Hit Enter]

You have now generated an ssh key pair. In our case, the private key is called “id_rsa” and the public key is “id_rsa.pub”.

Add Public SSH key to GitHub

Now, you are ready to upload the public key to your Github.com user account. If you already have an SSH key added to GitHub that you would like to use, skip this step.

  1. First copy the public key (id_rsa.pub in our case) to your clipboard.

$ pbcopy < ~/.ssh/id_rsa.pub

  1. Next, log in to your account on Github.com.

  2. Click on your username on the top right to reveal a tray. On the tray, click on Settings.

  3. Next, click on SSH Keys settings under Personal Settings.

  4. Click on New SSH Key button on the top right.

  5. Give your new ssh-key a title with which you can easily associate Runnable with.

  6. Paste the public key into the text area labeled Key

  7. Click on Add SSH Key.

Add Private SSH key to Runnable

Now, we move on to adding the private key into our repository configuration in Runnable.

  1. Copy the SSH private key

    Note the lack of .pub file extension

$ pbcopy < ~/.ssh/id_rsa

  1. Navigate to the Configure page.
  2. Locate the repository that is failing to build.
  3. Click on the Files & SSH Keys tool.
  4. Click on the Add… dropdown.
  5. Select SSH Key.
  6. A modal will open with a label for “Title” and a text area titled “Key”.
  7. Give your key a title that you can identify with.
  8. Paste in the private key that you copied in step 19 into the text area.
  9. Click “Save & Rebuild** and your failing build step should now complete successfully!

As always, please feel to reach out to us using the in-app chat if you are unable to resolve your build errors.