Bitbucket Integration Issue - Authentication Error (401)

We are facing an issue with the Bitbucket integration on our SonarQube instance (version 10.5). The integration is not working, and we are receiving the following error in logs -

Unable to contact Bitbucket server: 401 com.atlassian.plugins.rest.api.security.exception.AuthenticationRequiredException You are not permitted to access this resource
2025.04.22 20:49:11 INFO web[d4db876f-3ad2-41da-b8ba-78ea09d96090][o.s.a.c.b.BitbucketServerRestClient] Unable to contact Bitbucket server: 401 com.atlassian.plugins.rest.api.security.exception.AuthenticationRequiredException You are not permitted to access this resource
2025.04.22 20:49:12 INFO web[5b8deced-0ac4-4e19-8b3a-93fb80ad4f1b][o.s.a.c.b.BitbucketServerRestClient] Unable to contact Bitbucket server: 401 com.atlassian.plugins.rest.api.security.exception.AuthenticationRequiredException You are not permitted to access this resource
2025.04.22 20:49:13 INFO web[16d71d82-ffd4-4299-b034-6bd6fdee8e2e][o.s.a.c.b.BitbucketServerRestClient] Unable to contact Bitbucket server: 401 com.atlassian.plugins.rest.api.security.exception.AuthenticationRequiredException You are not permitted to access this resource
2025.04.22 20:49:13 INFO web[cd1c711b-2fdb-4051-bdef-703de47a7343][o.s.a.c.b.BitbucketServerRestClient] Unable to contact Bitbucket server: 401 com.atlassian.plugins.rest.api.security.exception.AuthenticationRequiredException You are not permitted to access this resource
2025.04.22 20:49:13 INFO web[983d2191-8c67-4e23-97d0-d3f47782d6f8][o.s.a.c.b.BitbucketServerRestClient] Unable to contact Bitbucket server: 401 com.atlassian.plugins.rest.api.security.exception.AuthenticationRequiredException You are not permitted to access this resource

Details:

  • SonarQube Version: 10.5

  • Bitbucket integration configured, but not working

  • Error logs showing repeated authentication failure when SonarQube attempts to connect to Bitbucket.

  • We have confirmed that the authentication credentials provided to SonarQube for Bitbucket access are correct.

  • We have attempted to reconfigure the integration multiple times but the issue persists.

Could you please assist us in resolving this authentication issue? If there are any specific steps to ensure the correct integration?

Hi,

Between the 401 (unauthorized) in your logs and the “Invalid personal access token” message in the UI, the cause seems pretty clear here.

I suggest you try creating a new PAT from an account that definitely has permissions, and use that.

 
HTH,
Ann

HI @ganncamp : Thanks for the reply :slight_smile:

I just created new PAT token and tried to integrate but no luck. still facing the same issue.


FYI, i have full permissions on bitbucket and im using my PAT token to connect from sonar.

Thanks,Siva

Hi Siva,

I don’t know what to tell you. The UI is pretty clear that something’s going wrong with authentication.

Is it possible there’s something “helpful” on the network, such as a proxy, interfering with the communication?

 
Ann