Forums

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

Bitbucket Pipelines fails to clone

jmusser73
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 8, 2017

In all of my pipeline builds I get the same error:

 

remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.fatal: Authentication failed for 'https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/<company-name>/<repository-name>.git/'

2 answers

1 vote
Brent Schultz
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!
May 2, 2018

Ever figure this one out @jmusser73 ?

Cavell Blood
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 29, 2018

I'm also getting this error. 

I created a brand new pipeline for a PHP application with the following example code given:

# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.1.1

pipelines: default:
-
step:
caches:
-
composer
script:
-
apt-get update && apt-get install -y unzip
-
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
-
composer install
-
vendor/bin/phpunit

When I run the first (and subsequent builds) I get the following failure message:

GIT_LFS_SKIP_SMUDGE=1 git clone --branch="master" --depth 50 https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/projectname/repo-name.git $BUILD_DIR ; git reset --hard 610705fc575fc880e38fea219767126cc01106e7 ; git remote set-url origin git@bitbucket.org:projectname/repo-name.git
Cloning into '/opt/atlassian/pipelines/agent/build'...
remote: Invalid username or password
fatal: Authentication failed for 'https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/projectname/repo-name.git/'

I've tried making the repository public and removing 2-Factor Authentication from my account and I still got the same error. So I made the repo private again and re-enabled 2FA on my account.

I've also added an SSH key-pair to the pipeline to see if that would fix it but it still didn't work. I feel like I'm really close to getting this to work but I'm just missing a small step.

I don't think it needs an app password because there is no location to enter a username and password when starting the pipeline.

I've thought that maybe I need to create a new environment variable named `REPOSITORY_OAUTH_ACCESS_TOKEN` and set it to a new OAuth token key or secret. Not sure what to do.

1 vote
Val Allen Samonte
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!
August 25, 2017

I am having the same issue also. My pipelines were working before, then suddenly it starts giving the error.

Val Allen Samonte
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!
August 25, 2017

Woops, I thought this is a comment section. sorry im a newbie

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events