haverchuck
haverchuck

Reputation: 600

Automated build from Github private repositority on Docker Hub doesn't work

I'm trying to create an automated build on Docker Hub from a Github private repository.

But I still have an error. I'm not sure if it's related to SSH keys or gitmodules.

Here is the log I get (in Build Details tab in my Docker Hub repo) :

Starting to clone
Cloning into 'bsntx4mjvrqncsdvzcn7tqp'...
Warning: Permanently added the RSA host key for IP address 'XXX.XX.XX.XX' to the list of known hosts.
No submodule mapping found in .gitmodules for path 'vendor/bundle/ruby/2.1.0/bundler/gems/logan-3722sdf9a9db5'
please ensure the correct public key is added to the list of trusted keys for this repository and the remote branch exists. (1)

Does anyone has the same error ?

My solution : I have solved my problem by removing the file vendor/bundle/ruby/2.1.0/bundler/gems/logan-3722sdf9a9db5 in my github repo. So the error about the public keys has nothing to do with it.

Upvotes: 2

Views: 3288

Answers (5)

Shubham Mahajan
Shubham Mahajan

Reputation: 231

The issue is not with the key.

I don't know the exact issue. You can use the following command to sort the issue out.

git submodule update --init

The output of the command will be passed to

git rm --cached {{output}}

Push the commit.

Upvotes: 2

Harry
Harry

Reputation: 4050

When the automated build fails the orange alert on the top of the build details can be a bit deluding:

Build failed: please ensure the correct public key is added to the list of trusted keys for this repository and the remote branch exists. (128)

Even when you have set up you ssh keys this message always displays. You need to look at your Logs at the bottom of the build details to see more information if you know that you have set up your ssh keys for a private repo already.

For example your logs might say:

fatal: no submodule mapping found in .gitmodules for path 'my-app/my-blog'

or maybe it could be

Dockerfile not found at ./my-app/Dockerfile

in your case you had a problem related to having the file vendor/bundle/ruby/2.1.0/bundler/gems/logan-3722sdf9a9db5 in your solution which needed to be removed.

Upvotes: 0

VelikiiNehochuha
VelikiiNehochuha

Reputation: 4373

For work with private repo, you should add ssh key from Docker Hub (showing on add auto build) to your github ssh keys.

Upvotes: 0

Yugesh Avadhanula
Yugesh Avadhanula

Reputation: 71

Following procedure followed by me made it work:

Added my private key to local ssh through git bash. Added my public SSH key to github. This ssh key was already available in my dockerhub. So, I linked another public dockerhub userid (where automated build was successful) as a collaborator to this private automated build.

Upvotes: 0

Jay Y
Jay Y

Reputation: 48

I can't comment, so I'm posting this as an "answer" instead (sorry!)

I have the same issue with Bitbucket, it fails to fetch from my submodule which is included in my main repo. I haven't been able to fix this issue yet. I even bough a paid subscription and added an automated build in hub.docker, hoping that would fix it, but nope..

Starting to clone Cloning into 'bokyrk3hkhspby5smhf6kby'... Warning: Permanently added the RSA host key for IP address 'xxx.xxx.xxx' to the list of known hosts. Submodule 'lib/shared' (https://[email protected]/xxx/xxx_sharedlibs.git) registered for path 'lib/shared' Cloning into 'lib/shared'... fatal: could not read Password for 'https://[email protected]': No such device or address Clone of 'https://[email protected]/xxx/xxx_sharedlibs.git' into submodule path 'lib/shared' failed please ensure the correct public key is added to the list of trusted keys for this repository and the remote branch exists. (1)

Upvotes: 0

Related Questions