SonarQube Server Cannot be reached
Asked by fatma_elbehi:

Hi Team,

I am trying to integrate sonarqube in bitbucket pipeline and i followed all the steps

but i received the following error ![Screenshot_1.png](https://community.atlassian.com/t5/image/serverpage/image-id/178288iC2E5EFE8E83FEB43/image-size/large?v=v2&px=999 "Screenshot_1.png")

I need your help plz asap!

Best,

Fatma


Answers:
author: Patrik S
body: Hello [@fatma_elbehi](/t5/user/viewprofilepage/user-id/4100334) ,

Thank you for contacting Atlassian Community. My name is Patrik, I'm with the Bitbucket Cloud Support Team and I'll be helping you on this case!

Analyzing the logs that you shared with us, looks like you are trying to use the SonarScan in your pipeline build.

The output of the logs are indicating the command you have executed is trying to connect to a SonarQube instance in the address *<https://localhost:9000>*, which is the default SonarQube server URL in case you do not configure it to other value. Since no SonarQube server was found in the localhost, an error was thrown.

In order to fix that, you will probably have to update the URL SonarScan is attempting to connect from the default value to the correct URL of your SonarQube instance. I found the following SonarQube's documentation on how to change the server URL when using it along with maven :

* <https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-maven/>

Alternatively, SonarQube has also developed a pipe to be used on bitbucket pipelines for **sonarqube-scan**, which might be useful on your case.You can find the details on how to use the pipe on your build by referring to the following documentation :

* [https://bitbucket.org/product/features/pipelines/integrations?p=sonarsource/sonarqube-scan](http://%20https://bitbucket.org/product/features/pipelines/integrations?p=sonarsource/sonarqube-scan)

Hope that helps. Let us know in case you have further questions.

Thanks, [@fatma_elbehi](/t5/user/viewprofilepage/user-id/4100334)   
Patrik S

comments: author: fatma_elbehi
body: Hi [@Patrik S](/t5/user/viewprofilepage/user-id/4603309),

Thank you for your response!

Just I would like to confirm that I followed the steps mentioned in the below screen and I didn't add anything in maven file.

![Screenshot_2.png](https://community.atlassian.com/t5/image/serverpage/image-id/178794i81CFFDCD61E981F2/image-dimensions/334x195?v=v2 "Screenshot_2.png")

So the question now should I change sonarqube url host in bitbucket environment variable or from maven file?

for the second link concerning the pipe option does not work properly.

Best,

Fatma


author: fatma_elbehi
body: Hi [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) ,

Now after adding sonarqube plugin in maven file I have the following error

![Screenshot_3.png](https://community.atlassian.com/t5/image/serverpage/image-id/178826iC2C6CF30358E81CB/image-size/large?v=v2&px=999 "Screenshot_3.png")

Any idea plz? the root cause here was sonarqube host url or another thing?

Best,

Fatma


author: Patrik S
body: Hi [@fatma_elbehi](/t5/user/viewprofilepage/user-id/4100334) ,

Looks like the error is different now, after adding sonarqube plugin in the maven file.

Unfortunately the screenshot you shared with us cut down some part of the error message. Would you please copy the full error as a text here, so we can better understand what is the issue now ?

Thanks, [@fatma_elbehi](/t5/user/viewprofilepage/user-id/4100334) .

Patrik S


Tags: atl-gruland

bitbucket-cloud

bitbucket-pipelines

cloud