I'm working on deploying a Phoenix app to Heroku, but several of the dependencies are in private Gitlab repos, and I am having trouble gaining access to them via SSH. When I try to push my app up, I hit the following error related to one of the dependencies (to which I normally have SSH access on my local machine):
remote: -----> Fetching app dependencies with mix
remote: * Getting cool_dep ([email protected]:group/cool_dep.git)
remote: Host key verification failed.
remote: fatal: Could not read from remote repository.
remote:
remote: Please make sure you have the correct access rights
remote: and the repository exists.
So here's what I've done so far - if anyone can tell me what I'm missing or have done wrong, it would be much appreciated...
Generated a new public/private key pair for this Heroku deployment. I put the public key into the SSH keys in my Gitlab settings. (the keys do not have a secret passphrase)
Added the
debitoor/ssh-private-key
buildpack to my buildpacks so that they read like so:Added the private key counterpart of the public key to the app's config:
$ heroku config:set SSH_KEY=$(cat /Users/username/.ssh/heroku_id_rsa | base64) --app cool-app-12345
Set the SSH hosts in the app's config:
$ heroku config:set SSH_HOSTS="[email protected]" --app cool-app-12345
And finally, when I run git subtree push --prefix local_app cool-app-12345 master
, it starts to load up but then flops when it hits the first private dependency.
Can anyone clarify what I am missing here? Why is that host key verification failing?
- also worth noting - I tested the public/private key pair by doing a basic
$ git clone ...
and that worked just fine, so the key relationship is valid... just seems to be a problem when Heroku gets in the mix.