Forums

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

Git clone fail with self hosted runner on linux

Tarlabs. February 19, 2022

Using a basic pipeline 

image: atlassian/default-image:3

pipelines:
default:
- parallel:
- step:
  runs-on:
  - self.hosted
  - linux
name: 'Build and Test'
script:
- echo "Your build and test goes here..."
```

 The pipeline fails to clone the repository.

With further investigation into the clone container, it seems that the variable BITBUCKET_REPO_FULL_NAME is empty, as a result it fails to clone.

I've tried setting it as "Repository variables"  with out any luck.

Any other suggestions for a fix? This looks like a bug!

1 answer

0 votes
Pramodh M
Community Champion
February 19, 2022

Hi @Tarlabs. 

Welcome to the Community!!

May I know the git version you are running on a self-hosted runner?

Also, can you try the SSL Skip and check once

https://support.atlassian.com/bitbucket-cloud/docs/configure-your-runner-in-bitbucket-pipelines-yml

Thanks,
Pramodh

Tarlabs. February 21, 2022

 

docker run -it docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-dvcs-tools:prod-stable bash
bash-4.4# git --version
git version 2.15.4

 

If the BITBUCKET_REPO_FULL_NAME variable isn't passed into the container then git doesn't know where to go.

This is the error that the container gets:

bash-4.4# GIT_LFS_SKIP_SMUDGE=1 retry 6 git clone --branch="main" --depth 1 https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIR
Cloning into 'bitbucket.org'...
remote: The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you're authenticated.
fatal: repository 'https://x-token-auth:@bitbucket.org/.git/' not found

Attempt 1 of 6 failed.
Retrying in 1 seconds
Cloning into 'bitbucket.org'...
remote: The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you're authenticated.
fatal: repository 'https://x-token-auth:@bitbucket.org/.git/' not found

Notice the 'https://x-token-auth:@bitbucket.org/<this part is missing>.git/'

bash-4.4# echo $BITBUCKET_REPO_FULL_NAME

bash-4.4#

 If I set the above variable it can clone the repo.

 

I should say that the runner is added at the workspace level and I presume that is why it doesn't know what repo it should be downloading.

Сергей Ревков
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!
March 1, 2022

What kind of server do you use for runner - on-premise or cloud ?

Tarlabs. March 3, 2022

Self hosted, meaning on-premise.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events