Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to configure an 'app password' in Jenkins?

Bryan Basham August 4, 2020

Hello,

We've been using BitBucket for our git repository and Jenkins (v2.204) for our CI build engine.  This month our builds began failing with this error message:

10:41:16 stderr: remote: Because your Atlassian account admin requires single sign-on, you'll need to authenticate with an app password. Create an app password at https://bitbucket.org/account/admin/app-passwords

I have created an "app password" for our CI user account and I attempted to configure that new pwd into Jenkins but now our builds are failing with this message:

10:52:35 using GIT_ASKPASS to set credentials BitBucket app password for solu-dev
10:52:35  > git fetch --tags --progress https://bitbucket.org/XXX/solu-core.git +refs/heads/*:refs/remotes/origin/*
10:52:36 ERROR: Error fetching remote repo 'origin'
10:52:36 hudson.plugins.git.GitException: Failed to fetch from https://bitbucket.org/XXX/solu-core.git
10:52:36 	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:894)

So clearly, I didn't configure Jenkins properly.  Does anyone know how it should be done?

Thanks, Bryan

3 answers

1 vote
Diego March 17, 2022

https://stackoverflow.com/questions/39886995/how-to-access-bitbucket-using-app-password

 

https://<Your_Account_Name>:<App_Password>@bitbucket.org/<Your_Account_Name>/<Repo_Name>.git
0 votes
yogesh jadhav March 10, 2022

@Bryan Basham where to change from https to git

Bryan Basham March 10, 2022

If you have already cloned a repo using `https` then you will need to drop that repo directory and rebuild it using a `git` URL pattern.  Make sure to save any local changes to the remote before dropping the old local repo.

You can find the clone operation on the main page for the repo in BitBucket.

Like CSW-Integration likes this
0 votes
Sabrina Liao March 12, 2021

Hi @Bryan Basham Did you end up figuring this out?

Bryan Basham March 12, 2021

I switched from the `https` to `git` scheme and installed a private key.  That solved it.

rbx-dev-builds February 15, 2022

I too created an App Password and it didn't work. However, I only changed from the "https" scheme to the "git" scheme and still retained my App Password and it worked.

Mike Banducci March 9, 2022

I may have figured this out completely accidentally. Before the change I was using the account name (account@domain.tld) with the account password. I tried changing only the password to an app password, but as everyone here has reported, that doesn't work.

I removed the account name and used the "Username" value shown under account settings, which allowed Jenkins to access the repos again.

Like # people like this
Mitch Clarke March 9, 2022

@Mike Banducci Thank you! Changing from using the email as the username to the "Username" as you put it got the app password working.

I was previously trying to use an OAuth consumer in a job as support for account password ended last week, but for some reason it wasn't recognised as valid credentials (it works with the Bitbucket Branch Plugin in an org). Using the app password I configured months ago with the right username works.

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events