Skip to content

Commit

Permalink
Explain why init-terraform fails (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
osterman authored May 18, 2018
1 parent eda2fb4 commit 4744eec
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions content/faq/init-terraform-fails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: "Running `init-terraform` fails: `Permission denied (publickey)`"
description: "Make sure that your GitHub SSH public key has been added to your geodesic `ssh-agent`"
tags:
- geodesic
- ssh-agent
- terraform
- init-terraform
- ssh
---

# Question

When running `init-terraform`, it fails while trying to fetch a private github repository.

```
init-terraform
Mounted buckets
Filesystem Mounted on
eg-staging-terraform-state /secrets/tf
Initializing modules...
- module.identity
Getting source "git::[email protected]:cloudposse/terraform-aws-account-metadata.git?ref=tags/0.1.0"
Error downloading modules: Error loading modules: error downloading 'ssh://[email protected]/cloudposse/terraform-aws-account-metadata.git?ref=tags%2F0.1.0': /usr/bin/git exited with 128: Cloning into '.terraform/modules/ce64520f6f20f6ef2bd2674d5f00db4d'...
Warning: Permanently added the RSA host key for IP address '194.31.252.103' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
```


# Answer

This usually happens for one of two reasons:

1) The SSH key added to your geodesic `ssh-agent` is not the same one authorized with your GitHub account
2) No SSH keys have been added to your `ssh-agent`

Run `ssh-add -l` to verify the keys are in your `ssh-agent`. Remember, that in geodesic `/localhost` is your `$HOME` directory.


0 comments on commit 4744eec

Please sign in to comment.