Problem in Jenkins waiting for Quality Gate

Hi same here,

CONTEXT
Sonarqube 7.9.1 / Jenkins 2.176.3 / SonarQube-Scanner 4.1.0.1829

FROM SONARQUE

[sonar@sonarqube ~]$ curl -vvv -X POST -H “Content-Type:application/json” -d ‘PAYLOAD I already past’ http://{jenkins hostname}/sonarqube-webhook

  • About to connect() to {jenkins hostname} port 80 (#0)
  • Trying xx.xxx.xxx.xxx
  • Connected to {jenkins hostname} (XX.XXX.XXX.XXX) port 80 (#0)

POST /sonarqube-webhook HTTP/1.1
User-Agent: curl/7.29.0
Host: {jenkins hostname}
Accept: /
Content-Type:application/json
Content-Length: 22

  • upload completely sent off: 22 out of 22 bytes
    < HTTP/1.1 302 Found
    < Date: Mon, 07 Oct 2019 13:39:03 GMT
    < Server: Jetty(9.4.z-SNAPSHOT)
    < X-Content-Type-Options: nosniff
    < Location: http://{jenkins hostname}/sonarqube-webhook/
    < Content-Length: 0
    <
  • Connection #0 to host {jenkins hostname left intact

Bur pipeline is KO =>
[Pipeline] waitForQualityGate
Checking status of SonarQube task ‘AW2mc0Hl6dR3aYJQYI5h’ on server ‘Sonarqube 7’
SonarQube task ‘AW2mc0Hl6dR3aYJQYI5h’ status is ‘PENDING’

Cancelling nested steps due to timeout
“Pipeline Extract” -->
stage(“Quality Gate”) {
steps {
timeout(time: 10, unit: ‘MINUTES’) {
waitForQualityGate abortPipeline: true
}
}
}

FROM WEBHOOK RESULT

Response: 403

Duration: 31ms

Payload:

{
“serverUrl”: “http://{sonarqube hostname}”,
“taskId”: “AW2mc0Hl6dR3aYJQYI5h”,
“status”: “SUCCESS”,
“analysedAt”: “2019-10-07T15:40:30+0200”,
“revision”: “6ec0decf56cdfcb691e261c86dbab4d6b18a9c7f”,
“changedAt”: “2019-10-07T15:40:30+0200”,
“project”: {
“key”: “java”,
“name”: “java”,
“url”: “http://{sonarqube hostname}/dashboard?id=java”
},
“branch”: {
“name”: “master”,
“type”: “LONG”,
“isMain”: true,
“url”: “http://{sonarqube hostname}/dashboard?id=java”
},
“qualityGate”: {
“name”: “Sonar way”,
“status”: “OK”,
“conditions”: [
{
“metric”: “new_reliability_rating”,
“operator”: “GREATER_THAN”,
“value”: “1”,
“status”: “OK”,
“errorThreshold”: “1”
},
{
“metric”: “new_security_rating”,
“operator”: “GREATER_THAN”,
“value”: “1”,
“status”: “OK”,
“errorThreshold”: “1”
},
{
“metric”: “new_maintainability_rating”,
“operator”: “GREATER_THAN”,
“value”: “1”,
“status”: “OK”,
“errorThreshold”: “1”
},
{
“metric”: “new_coverage”,
“operator”: “LESS_THAN”,
“status”: “NO_VALUE”,
“errorThreshold”: “80”
},
{
“metric”: “new_duplicated_lines_density”,
“operator”: “GREATER_THAN”,
“value”: “0.0”,
“status”: “OK”,
“errorThreshold”: “3”
}
]
},
“properties”: {}
}

Log from Nexus
2019.10.07 15:40:36 INFO ce[AW2mc0Hl6dR3aYJQYI5h][o.s.c.t.s.ComputationStepExecutor] Publish task results | status=SUCCESS | time=0ms
2019.10.07 15:40:36 INFO ce[AW2mc0Hl6dR3aYJQYI5h][o.s.c.t.s.ComputationStepExecutor] Trigger refresh of Portfolios and Applications | refreshes=0 | status=SUCCESS | time=6ms
2019.10.07 15:40:36 INFO ce[AW2mc0Hl6dR3aYJQYI5h][o.s.c.t.CeWorkerImpl] Executed task | project=java | type=REPORT | id=AW2mc0Hl6dR3aYJQYI5h | submitter=sonar.analyze.scanner | status=SUCCESS | time=629ms

Log from Jenkins
GOT CONTEXT FOR Quality Gate
oct. 07, 2019 3:50:35 PM org.jenkinsci.plugins.workflow.job.WorkflowRun finish
INFOS: EXEMPLES/pipeline_maven_with_tools #28 completed: ABORTED

LOG from jenkins pipeline
Checking status of SonarQube task ‘AW2mc0Hl6dR3aYJQYI5h’ on server ‘Sonarqube 7’
SonarQube task ‘AW2mc0Hl6dR3aYJQYI5h’ status is ‘PENDING’
Cancelling nested steps due to timeout
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Timeout has been exceeded
Finished: ABORTED

Thank you in advance
Best regards

Hi,

Welcome to the community!

I’ve split your post off from the thread you added it to because that thread was more than a year old and seemingly resolved.

It’s not clear to me from your post exactly what your problem is. You say:

And then you give a webhook result that

  1. shows a 403 error code
  2. contains all the expected data.

So…where are you seeing this “webhook result”?

 
Ann

Hi Ann,
thank you.

I receive this result from jenkins.

But i found how to :slight_smile:

To resolve my issue:

Due to corporate proxy.

  1. Error when sonarqube notify jenkins’ pipeline from quality gate’s result availability through sonarqube webhook, sonarqube receive an HTTP 403 error.
    Issue is to exclude jenkins’ domain in sonar.properties

http.nonProxyHosts=*.domain

Thank you for your help.
Best regards

1 Like