Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to clone bitbucket repo during pipelines run

Deleted user April 21, 2017 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?

3 answers

0 votes
AlexanderKozhevin211 May 2, 2018
I've the same problem. And the funny thing that it worked before. 



+ umask 000

+ GIT_LFS_SKIP_SMUDGE=1 git clone --branch="master" --depth 50 https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/morningst101/portal_frontend.git $BUILD_DIR ; git reset --hard cad678d0edbcdfb8937ca46e05d8a554dc727707 ; git remote set-url origin git@bitbucket.org:morningst101/portal_frontend.git
Cloning into '/opt/atlassian/pipelines/agent/build'...
fatal: repository 'https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/morningst101/portal_frontend.git/' not found

 
Jose Elizondo May 2, 2018

Try this, I experienced the same behaviour.

I opt out from Bitbucket Labs -> New source browser experience; and pipelines went back to normal.

Like • Jesper Paulsen likes this
Lisa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 22, 2018

Dude. This comment wins the internet today. ++ for fix that had me running in circles for HOURS. Gotta love it when disabling a completely unrelated feature fixes a problem. I owe you many drinks/coffees/insert vice here @Jose Elizondo. Thank you.

Like • Jose Elizondo likes this
Darlan Silveira
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 1, 2019

That worked for me too! I've disabled all beta tools from Bitbucket Labs and it's working now. Thank you!

Like • Jose Elizondo likes this
0 votes
adrian
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 16, 2018

Same issue here.

0 votes
xtjhin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 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.

Chris_Harrison
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 14, 2017

Was this ever resolved? I have the same issue.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events