Sonaqube Bitbucket Cloud PR Decoration

Must-share information (formatted with Markdown):

  • Developer Edition Version 7.9.1 (build 27448)
  • Sonaqube Bitbucket Cloud PR Decoration
  • I followed this guide to integrate my sonar developer edition to bitbucket (cloud). I maked a pull request to test my configuration and trigger pr analisys issuing this command from may maven module:

mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar -Dsonar.pullrequest.key=29 -Dsonar.pullrequest.branch=pr-decoration-test -Dsonar.pullrequest.base=prod

but it seems not work. On sonar web gui, under my project i have this warning:

Pull request decoration did not happen. Failed to access Bitbucket Server, the repository or the pull request

and from sonar docker logs (enabled also debug):

java.lang.IllegalStateException: Unable to contact Bitbucket server
at com.sonarsource.C.C.A.A.C.A(Unknown Source)
at com.sonarsource.C.C.A.A.C.A(Unknown Source)
at com.sonarsource.C.C.A.A.C.A(Unknown Source)
at com.sonarsource.C.C.A.G.A(Unknown Source)
at com.sonarsource.C.C.A.G.A(Unknown Source)
at com.sonarsource.C.C.A.C.A(Unknown Source)
at com.sonarsource.C.C.Z.A(Unknown Source)
at java.base/java.util.Optional.ifPresent(Optional.java:183)
at com.sonarsource.C.C.Z.B(Unknown Source)
at com.sonarsource.C.C.Z.A(Unknown Source)
at org.sonar.ce.async.SynchronousAsyncExecution.addToQueue(SynchronousAsyncExecution.java:27)
at com.sonarsource.C.C.Z.A(Unknown Source)
at java.base/java.util.Optional.ifPresent(Optional.java:183)
at com.sonarsource.C.C.Z.finished(Unknown Source)
at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.executeTask(PostProjectAnalysisTasksExecutor.java:113)
at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:107)
at org.sonar.ce.task.step.ComputationStepExecutor.executeListener(ComputationStepExecutor.java:91)
at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:63)
at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:209)
at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:191)
at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:158)
at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:133)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:85)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.net.ProtocolException: Too many follow-up requests: 21
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:139)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:221)
at okhttp3.RealCall.execute(RealCall.java:81)
… 32 common frames omitted

I think that sonar is correctly configured with bitbucket credentials (key and secret) and the bitbucket cloud (server) is reachable (i maked an oauth call to have a valid access token and i did).
I can not understand why this error and this warning appens. Could you please halp me? I buy the developer edition only to use the pullrequest decoration feature but seems not work for a reason…:frowning:

Hi @governator84,

welcome to the community !
Quick question before trying to answer your issue:

are you trying to decorate PR in Bitbucket Cloud, using SonarQube?

The guide you followed is for authentication, not PR decoration.

SonarQube works with Bitbucket Server, as mentioned in our documentation here:
https://docs.sonarqube.org/latest/analysis/pull-request/

If you use Bitbucket Cloud, I would recommend to have a look at SonarCloud and PR documentation here: https://sonarcloud.io/documentation/analysis/pull-request/

HTH,
Carine

So you can confirm to me that sonarQube is not compabile with bitbucket cloud and i must use sonarCloud to integrate with bitbucket cloud? So compatibility . is only beetween server versions and cloud versions of both appplications?

I would also know :i buy the developer edition also to use PR decoration. Is required/needed the license to use this feature with sonar cloud version?

I saw that to make private my code i need to by a sonar cloud license but i already have a developer edition license. Is eventually possible use my license with nexus cloud version?

@governator84, there is no “license” on SonarCloud, but “plans” according to your privacy needs for your projects.

Either you are on a free plan, which means public projects, or you want to keep your code private, then you’ll move to a “private” plan, which pricing is here: https://sonarcloud.io/about/pricing
And on this page, you’ll find the main differences between free and private plans.