# Getting An Unauthorized error

**URL:** https://community.linx.software/community/t/getting-an-unauthorized-error/455
**Category:** Support
**Created:** [May 29, 2020, 7:48am UTC](https://community.linx.software/community/t/getting-an-unauthorized-error/455 "2020-05-29T07:48:22Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Siobhan\_Rohlwink-Cou](https://community.linx.software/community/user_avatar/community.linx.software/siobhan_rohlwink-cou/32/324_2.png) [@Siobhan\_Rohlwink-Cou](https://community.linx.software/community/u/Siobhan_Rohlwink-Cou)
#### Post date: [May 29, 2020, 7:48am UTC](https://community.linx.software/community/t/getting-an-unauthorized-error/455/1 "2020-05-29T07:48:22Z")

</div>

When I run the debug I seem to be getting an: MigrateAllRepos.WriteReposCSV: WriteReposCSV.GetReposRESTCall: Response status code does not indicate success: 401 (Unauthorized).

I’ve followed all the process so Im not exactly sure where I went wrong.

## This is the trace Log: WriteReposCSV Trace Log: URL Constructed [https://api.bitbucket.org/2.0/repositories/TonyLoubser?page=1&pagelen=100](https://api.bitbucket.org/2.0/repositories/TonyLoubser?page=1&pagelen=100) HTTP client created Added Basic authorization header. Sending GET request Request Headers: None Response received

Response code: 401 (Unauthorized)  
Response Body:

* * *

---

<div class="post-metadata">

### Author: ![Franz](https://community.linx.software/community/user_avatar/community.linx.software/franz/32/316_2.png) [@Franz](https://community.linx.software/community/u/Franz)
#### Post date: [May 29, 2020, 8:11am UTC](https://community.linx.software/community/t/getting-an-unauthorized-error/455/2 "2020-05-29T08:11:55Z")

</div>

The 401 error indicates that the call to fetch the list of repos is not authenticated. Please:

1. Make sure the BitbucketAppPassword in the settings of your Linx solution is correct
2. Check on Bitbucket that the BitbucketAppPassword has the correct rights
3. The value in the BitbucketWorkspace in the settings of your Linx solution (TonyLoubser) is correct
4. Make sure the BitbucketUsername in the settings of your Linx solution is correct  
Let me know if all these details seem correct, but you still have problems with our migration solution  
Franz

---

<div class="post-metadata">

### Author: ![Siobhan\_Rohlwink-Cou](https://community.linx.software/community/user_avatar/community.linx.software/siobhan_rohlwink-cou/32/324_2.png) [@Siobhan\_Rohlwink-Cou](https://community.linx.software/community/u/Siobhan_Rohlwink-Cou)
#### Post date: [May 30, 2020, 12:19am UTC](https://community.linx.software/community/t/getting-an-unauthorized-error/455/3 "2020-05-30T00:19:25Z")

</div>

Im still getting the error and I have made sure all the information it correct in terms of what is said to add.

it seems to stop at the function of WriteReposCSV and doesnt go any further than that

Do I have to fill any of the other information as well other than the  
bitbucketAppPassword,  
BitbucketUsername,  
BitbucketWorkspace,  
GitUserName,  
GitUserEmail and the MainDirectory.

How exactly does the ApiURL work do I need to add anything to it?

---

<div class="post-metadata">

### Author: ![Franz](https://community.linx.software/community/user_avatar/community.linx.software/franz/32/316_2.png) [@Franz](https://community.linx.software/community/u/Franz)
#### Post date: [May 30, 2020, 11:24am UTC](https://community.linx.software/community/t/getting-an-unauthorized-error/455/5 "2020-05-30T11:24:10Z")

</div>

You don’t need to complete anything other than the items you listed above. There is nothing you need to do with the APIUrl setting as it uses the value from the BitbucketWorkspace setting to construct the url that is used in the REST call to retreive your Mercurial repos from Bitbucket. In your case, this is url is:  
[https://api.bitbucket.org/2.0/repositories/TonyLoubser?page=1&pagelen=100](https://api.bitbucket.org/2.0/repositories/TonyLoubser?page=1&pagelen=100)  
If you are getting a 401 error then the authentication is not successful. This means that there is a problem with one of the settings below or with the permissions of the BitbucketAppPassword on Bitbucket (read & write):

1. BitbucketAppPassword
2. BitbucketUsername
3. BitbucketWorkspace  
I assume you are using 2-factor authentication on yoru account? If not, you should try switch that on and see if it makes a difference.  
Let me know if you still have trouble.  
Franz

---

<div class="post-metadata">

### Author: ![Siobhan\_Rohlwink-Cou](https://community.linx.software/community/user_avatar/community.linx.software/siobhan_rohlwink-cou/32/324_2.png) [@Siobhan\_Rohlwink-Cou](https://community.linx.software/community/u/Siobhan_Rohlwink-Cou)
#### Post date: [June 1, 2020, 10:19am UTC](https://community.linx.software/community/t/getting-an-unauthorized-error/455/6 "2020-06-01T10:19:20Z")

</div>

I have added the bitbucketApp Password and double checked it. I have also Added the username and the bitbucket workspace. I am not using a 2 factor authentication at the moment as Im missing a few other things to do so. Is there a way I might be able to convert one repo using this process. Do I need to add the username and the login password anywhere.

Is there other specific reasons why it wont get past the WriteReposCSV function. Should the repos have an ssh key and not be using the https way of cloning?

why is it when I put this [https://api.bitbucket.org/2.0/repositories/TonyLoubser?page=1&pagelen=100](https://api.bitbucket.org/2.0/repositories/TonyLoubser?page=1&pagelen=100) in the browser that I get a result which seems to be a json result.

|pagelen|100|  
|values|[]|  
|page|1|  
|size|0|

Ive also seem to get an error when I was checking the breakdown i the RepoList folder for the function WriteRepoCSV and at the GetReposRestCall there seems to an error that says Value is not a well-formed URL.

---

<div class="post-metadata">

### Author: ![Franz](https://community.linx.software/community/user_avatar/community.linx.software/franz/32/316_2.png) [@Franz](https://community.linx.software/community/u/Franz)
#### Post date: [June 1, 2020, 11:47am UTC](https://community.linx.software/community/t/getting-an-unauthorized-error/455/7 "2020-06-01T11:47:16Z")

</div>

The step where the process is failing is supposed to fetch a list of your Mercurial repos from your Bitbucket account and write this list to a CSV file. The clone step is later in the process, but the debugger is not reaching that step.  
My suggestion for you is to send an email to support@linx.software with your solution (including the settings you are using). We can then test the process and see what exaclty is happening.

---

<div class="post-metadata">

### Author: ![Siobhan\_Rohlwink-Cou](https://community.linx.software/community/user_avatar/community.linx.software/siobhan_rohlwink-cou/32/324_2.png) [@Siobhan\_Rohlwink-Cou](https://community.linx.software/community/u/Siobhan_Rohlwink-Cou)
#### Post date: [June 1, 2020, 1:02pm UTC](https://community.linx.software/community/t/getting-an-unauthorized-error/455/8 "2020-06-01T13:02:38Z")

</div>

by settings do u mean the details that one enters including the bitbucketApp password?

---

<div class="post-metadata">

### Author: ![Franz](https://community.linx.software/community/user_avatar/community.linx.software/franz/32/316_2.png) [@Franz](https://community.linx.software/community/u/Franz)
#### Post date: [June 1, 2020, 1:15pm UTC](https://community.linx.software/community/t/getting-an-unauthorized-error/455/9 "2020-06-01T13:15:43Z")

</div>

Yes. The problem is in the authentication step, so, we can only help you if we can try authenticating with a working AppPassword. If you are not comfortable with that you could create a new AppPassword with only read permissions. That should be enough to resolve this problem.
