How to clone bitbucket repo during pipelines run Edited

So following https://confluence.atlassian.com/bitbucket/use-ssh-keys-in-bitbucket-pipelines-847452940.html

 

I am having issues. I have generated SSH key from the pipelines settings in the bitbucket settings for my pipeline repo, and added the pub key to the other repo I want to clone.

 

I then have my first step as:

- git clone git@bitbucket.org:organization/repo.git

 

And I am getting:

+ git clone git@bitbucket.org:organization/repo.git
Cloning into 'repo'...
Host key verification failed.
fatal: Could not read from remote repository.

 

Even though the docs say "Note that Bitbucket Pipelines automatically adds the fingerprint for the Bitbucket and GitHub sites to all pipelines" I still tried to add it to the known hosts in the pipelines settings. Even then, I still got the same error.

 

What do I need to do to get this working?

2 answers

0 vote
Joshua Tjhin Atlassian Team Apr 25, 2017

Hey, that seems strange.

Could you cat your known_host file by adding the following to your scripts?

cat ~/.ssh/known_hosts

Or if you raise a support ticket, we could help you further.

Was this ever resolved? I have the same issue.

0 vote

Same issue here.

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

714 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot