# Facing error in prepare analysis task while executing the pipeline

**URL:** <https://community.sonarsource.com/t/facing-error-in-prepare-analysis-task-while-executing-the-pipeline/109420>\
**Category:** SonarQube Server / Community Build\
**Created:** [February 19, 2024, 10:01am UTC](https://community.sonarsource.com/t/facing-error-in-prepare-analysis-task-while-executing-the-pipeline/109420 "2024-02-19T10:01:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asawari](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/asawari/32/58956_2.png) [@Asawari](https://community.sonarsource.com/u/Asawari)\
**Post date:** [February 19, 2024, 10:01am UTC](https://community.sonarsource.com/t/facing-error-in-prepare-analysis-task-while-executing-the-pipeline/109420/1 "2024-02-19T10:01:13Z")

</div>

Hi,

Facing below error in Prepare Analysis Task in Azure Devops React Pipeline.  
Tried below solutions:  
New SonarQube endpoint connection.  
Tried with new self hosted agent.  
Still facing same issue.

##[error][SQ] API GET ‘/api/server/version’ failed, error is request to [https://sonar.com/api/server/version](https://sonar.com/api/server/version) failed, reason: unable to verify the first certificate

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 21, 2024, 1:41pm UTC](https://community.sonarsource.com/t/facing-error-in-prepare-analysis-task-while-executing-the-pipeline/109420/3 "2024-02-21T13:41:14Z")

</div>

Hi,

Welcome to the community!

Is that literally the error you’re seeing? Given the domain in the error is `https://sonar.com`, I suspect your SonarQube server URL has been misconfigured somewhere.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![Asawari](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/asawari/32/58956_2.png) [@Asawari](https://community.sonarsource.com/u/Asawari)\
**Post date:** [February 26, 2024, 6:19am UTC](https://community.sonarsource.com/t/facing-error-in-prepare-analysis-task-while-executing-the-pipeline/109420/4 "2024-02-26T06:19:42Z")

</div>

Hi,

URL is correct. It is [https://sonar.xyz.com](https://sonar.xyz.com).

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 26, 2024, 12:50pm UTC](https://community.sonarsource.com/t/facing-error-in-prepare-analysis-task-while-executing-the-pipeline/109420/5 "2024-02-26T12:50:09Z")

</div>

Hi,

Your SonarQube domain is `https://sonar.xyz.com` but what shows up in the error is `https://sonar.com`. Again, I think you’ve misconfigured your SonarQube server URL somewhere.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![ryto9344](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@ryto9344](https://community.sonarsource.com/u/ryto9344)\
**Post date:** [February 29, 2024, 5:56pm UTC](https://community.sonarsource.com/t/facing-error-in-prepare-analysis-task-while-executing-the-pipeline/109420/6 "2024-02-29T17:56:29Z")

</div>

I am also getting this error with Azure Dev Ops.  
##[error][SQ] API GET ‘/api/server/version’ failed, error is request to [https://sonarqube-sre.apps.ocptest.NAME.com/api/server/version](https://sonarqube-sre.apps.ocptest.NAME.com/api/server/version) failed, reason: unable to verify the first certificate

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 29, 2024, 7:21pm UTC](https://community.sonarsource.com/t/facing-error-in-prepare-analysis-task-while-executing-the-pipeline/109420/7 "2024-02-29T19:21:20Z")

</div>

Hi @ryto9344,

Welcome to the community!

[This](https://stackoverflow.com/a/60020493/2662707) may help.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![ryto9344](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@ryto9344](https://community.sonarsource.com/u/ryto9344)\
**Post date:** [February 29, 2024, 9:44pm UTC](https://community.sonarsource.com/t/facing-error-in-prepare-analysis-task-while-executing-the-pipeline/109420/8 "2024-02-29T21:44:19Z")

</div>

I dont believe that is the issue. I am able to make the curl command in a script without any ssl issues right before the task is triggered without any ssl errors.  
- task: SonarQubePrepare@5  
What all is this task actually doing? Maybe I can recreate it with a script to find exactly the problem

---

<div class="post-metadata">

**Author:** ![ryto9344](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@ryto9344](https://community.sonarsource.com/u/ryto9344)\
**Post date:** [March 1, 2024, 12:08am UTC](https://community.sonarsource.com/t/facing-error-in-prepare-analysis-task-while-executing-the-pipeline/109420/9 "2024-03-01T00:08:58Z")

</div>

As a work around I am just using the cli and I noticed it also had cert issues. What I ended up doing is installing the keystore to the jvm that comes with the cli. I then thought maybe that needs to be done with the java on the agent already so I did this but still getting a cert issue. Is there anything else that can be hiding?

- script: |  
sudo keytool -import -alias sonarqube-sre -keystore /usr/lib/jvm/temurin-11-jdk-amd64/lib/security/cacerts -file .azuredevops/sonarqube\_cert.pem -storepass changeit -noprompt

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 1, 2024, 12:36pm UTC](https://community.sonarsource.com/t/facing-error-in-prepare-analysis-task-while-executing-the-pipeline/109420/10 "2024-03-01T12:36:25Z")

</div>

Hi,

All I can recommend is making sure, as the SO answer I linked to describes, that the entire chain is in the keystore. Or you could stop using self-signed certs.

&nbsp;  
Ann
