The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Export fails with 'You are not permitted to access this resource'

Denys Zhuravel
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!
February 13, 2023
We have Bitbucket version `7.21.2`

This is the export documentation for this version:

The documentation says this:
> There’s no graphical user interface in the initial (Bitbucket Server 5.14) release of this feature. Instead, REST calls can be made to control the migration process.

This is what it says to do to trigger the export for a project:
> curl -u <adminusername> -s -n -X POST -H ‘Content-type: application/json’ -d ‘{“repositoriesRequest”:{“includes”:[{“projectKey”:“”,“slug”:“”}]}}’ http://localhost:7990/rest/api/1.0/migration/exports | jq .

The documentation specifies that I have to use the admin user (which I am). I created a PAT using this documentation:

My permissions for the token are set as following:
* Project permissions: admin
* Repository permissions: admin

I am calling the API using the following command:

```
curl --request POST \
--user my.user:MY_TOKEN_FROM_SETTINGS \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"repositoriesRequest": {
"includes": [
{
"projectKey": "SOME_KEY",
"slug": "SOME_SLUG"
}
]
}
}'
```
And this is the error that I am getting back:

```
{"errors":[{"context":null,"message":"You are not permitted to access this resource","exceptionName":"com.atlassian.bitbucket.AuthorisationException"}]}%
```

I tried sending gibberish in the user field to verify that that is correct and the response is actually different:

```
{"errors":[{"context":null,"message":"Authentication failed. Please check your credentials and try again.","exceptionName":"com.atlassian.bitbucket.auth.IncorrectPasswordAuthenticationException"}]}%
```

What am I doing wrong here?

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events