how to pull latest code of bitbucket private repo into server using https
Asked by Pradip Solace:

I have tried using access token, generating one and adding to my jenkins, but it gives me error as "cannot read password for username" now what is the reason for this?

I have already tried transferring this repo into different account and trying to pull latest changes from there, but still it refers to original repo and gives me same error

please can anyone help me in this?


Answers:
author: jennifer.dempsey_Appfire
body: Hi [@Pradip Solace](/t5/user/viewprofilepage/user-id/4155021)

You might want to also consider using an integration app like [**Webhook to Jenkins for Bitbucket**](https://marketplace.atlassian.com/apps/1211284/webhook-to-jenkins-for-bitbucket?tab=overview&hosting=cloud) which is now available for Cloud! This app from Appfire is easy to set up and will allow you to automatically trigger Jenkins builds when committing or merging code.

Please feel free to reach out to me at Jennifer.Dempsey@appfire.com if I can answer any questions about the app for you. You can also [contact our awesome support team](https://appfire.atlassian.net/servicedesk/customer/portal/11/group/36/create/163) to ask questions about the product or request a demo.

Cheers,  
Jennifer


author: Patrik S
body: Hello [@Pradip Solace](/t5/user/viewprofilepage/user-id/4155021) ,

Thank you for reaching out to Atlassian Community!

From your description and the error message, I suspect the issue is related to how the authentication was setup on the Jenkins side. Since you mentioned to be currently trying with an access token, I would suggest trying basic authentication instead and checking if the issue persists. For that, you would have to configure the credentials in Jenkins as follows:

* **username** : your bitbucket account username. You can find your username by accessing the Personal settings of your account (<https://bitbucket.org/account/settings/>)
* **AppPassword** : is used to authenticate git operations and API calls. You can [create an app password](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/) and use it as the password in your Jenkins configuration.

You can try the suggestion above and let us know how it goes.

Thank you, [@Pradip Solace](/t5/user/viewprofilepage/user-id/4155021) !

Patrik S

comments: author: Pradip Solace
body: hello [@Patrik S](/t5/user/viewprofilepage/user-id/4603309)

thanks for your reply!  
As i can see from your reply you want me to try using username and app password generated from bitbucket.

I have already tried this method, but it still gives me same error

    "fatal: could not read Password for: 'https://username@bitbucket.org': No such file or directory".

Is anything related to app authorization has to be implemented for this?  
kindly let me know

Thanks


author: Patrik S
body: Hello [@Pradip Solace](/t5/user/viewprofilepage/user-id/4155021) ,

The error message seems to be related to a local configuration on Jenkins.

As you are trying to integrate Bitbucket Cloud with your Jenkins instance, I would suggest using the Bitbucket Jenkins plugin below :

* <https://plugins.jenkins.io/bitbucket/>

This plugin relies on bitbucket webhooks to receive the events that happen in your repository, such as a new push, to then trigger an event in your Jenkins instance.

Also, the following article has step-by-step instructions on how to setup this integration :

* <https://medium.com/ampersand-academy/integrate-bitbucket-jenkins-c6e51103d0fe>

Let me know in case you have any questions.

Thank you, [@Pradip Solace](/t5/user/viewprofilepage/user-id/4155021) !

Patrik S


Tags: access

bitbucket-cloud

cloud