Error 403: pull, push, clone repository
Asked by Alisson Sifuentes Davila:

Hello,

For the last month or two I have been trying to make modifications to a repository that I had stored locally on my PC but I kept getting the same error:

**fatal: unable to access '<https://bitbucket....com/../{repository}.git/>': The requested URL returned error: 403**

I have tried to clone or pull also in repository and it doesn't let me to do any action.  
I have updated the git version from 2.41.0.3 to 2.42.0.2 as said in other posts and I still have the same problem.

I have permissions to access the repository, since if I access the URL it lets me without problems with the same user.

Could it be a bitbucket bug?

Thank you.

Alisson


Answers:
author: Patrik S
body: Hello [@Alisson Sifuentes Davila](/t5/user/viewprofilepage/user-id/5332507) and welcome to the Community!

The error being returned by git indicates an authentication issue :

```
The requested URL returned error: 403
```

So I suspect you might be using the old/invalid credentials.

To confirm if this is the case, I would suggest trying to do a fresh clone of the repository in a different folder using the command below :

```
git clone https://USERNAME:APP_PASSWORD@bitbucket.org/WORKSPACE/REPOSITORY.git
```

replacing the USERNAME, APP_PASSOWORD, WORKSPACE, and REPOSITORY with the actual values, where :

* **Username** : your bitbucket account username (not email address). You can check the username on [your account's personal settings page](https://bitbucket.org/account/settings/).
* **App password** : the password to be used for the authentication (it's not the same password you use to log in to the UI). If you haven't already, you can [create a new app password](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/) with the needed permissions. To clone a repository the app password needs at least **repo:read** permission.

You can try cloning using the credentials as described above and let us know how it goes :)

Thank you, [@Alisson Sifuentes Davila](/t5/user/viewprofilepage/user-id/5332507) !

Patrik S

comments: author: Alisson Sifuentes Davila
body: Hello [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) ,

is it possible to use that url in this way if it is a bitbucket server I am working on and it is not cloud?

Because my username I have checked that it is the email and I still get the same error.

Thank you!


author: Patrik S
body: Hello [@Alisson Sifuentes Davila](/t5/user/viewprofilepage/user-id/5332507) ,

For Bitbucket Server you can [create an HTTP Access token](https://confluence.atlassian.com/bitbucketserver/http-access-tokens-939515499.html) and use it with the following syntax :

    git clone https://username:MDM0MjM5NDc2MDxxxxxxxxxxxxxxxxxxxxx@bitbucketserver.com/scm/projectname/teamsinspace.git

where you will need to replace bitbucketserver.com with your bitbucket server's domain.

For the username, you should be able to get it by accessing your bitbucket server instance and navigating to **Profile Picture \> View Profile**.

Thank you, [@Alisson Sifuentes Davila](/t5/user/viewprofilepage/user-id/5332507) !  
Patrik S


Tags: bitbucket-server

clone

permission