1
votes

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...

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.
1

1 Answers

1
votes

I pulled the source code for the buildpack and started poking around - I found that the SSH_HOST config variable that I was setting - [email protected] - was not being found, and it was just defaulting to the single [email protected] host that's hard-coded in... the docs say that you can add additional hosts, but it didn't seem to be working for me.

I was able to resolve this issue by cloning the buildpack and replacing line 13 in bin/compile with

ssh_hosts=${SSH_HOSTS:-"[email protected]"}

So if your private repos are in Github, you're probably fine... but if they're on a different host, you may need to grab the buildpack code and host it on your own repo with custom hosts.