DNS not resolving for quality gate with sonarqube 8.2 on Jenkins CI pipeline

SonarQube version: (Developer Edition)
Platform: Docker Image official Developer Edition from Docker Hub
Jenkins Sonar plugin: 2.11
Jenkins version: 2.150.3 (Docker image)

Jenkins container starts in a swarm stack and resolves dns itself.

docker exec -it 3be96065a05f /bin/bash
jenkins@3be96065a05f:/$ ping xxxx.xxxx.xxxx
PING xxx.xxxx.xxx (xxxx) 56(84) bytes of data.
64 bytes from xxxx.xxxx.xxxx(xxxx): icmp_seq=1 ttl=63 time=0.338 ms
64 bytes from xxxx.xxxx.xxxx (xxxx): icmp_seq=2 ttl=63 time=0.399 ms
[1]+ Stopped ping xxxxx.xxx.xxxx

However when using hosname for sonarqube plugin it fails at the quality gate stage.

Checking status of SonarQube task ‘AXF59fw50CzZyg1RS2KY’ on server ‘SQUBE8’

Error 504 on http://xxxx.xxxx.xxxxx:9000/api/ce/task?id=AXF59fw50CzZyg1RS2KY : <!-- IE friendly error message walkround.

 if error message from server is less than   

 512 bytes IE v5+ will use its own error     

 message instead of the one returned by      

 server.                                 --> 
html,body{height:100%;padding:0;margin:0;}.oc{display:table;width:100%;height:100%;}.ic{display:table-cell;vertical-align:middle;height:100%;}div.msg{display:block;border:1px solid #30c;padding:0;width:500px;font-family:helvetica,sans-serif;margin:10px auto;}h1{font-weight:bold;color:#fff;font-size:14px;margin:0;padding:2px;text-align:center;background: #30c;}p{font-size:12px;margin:15px auto;width:75%;font-family:helvetica,sans-serif;text-align:left;}504 DNS look up failed

504 DNS look up failed

The webserver reported that an error occurred while trying to access the website. Please click here to return to the previous page.

URL: http://xxxx.xxxx.xxxx:9000/api/ce/task?id=AXF59fw50CzZyg1RS2KY<br />

<br/>User name: 

<br/>Group name: 

IP address works.


This isn’t a SonarQube issue. You need to talk to your network folks.


Fixed as the nonproxy was set incorrectly.

It was trying to reach the sqube server via the proxy.

Not a network problem as suggested.

If that was the case the ping as shown above would not work as that using the hostname via dns.

It was more to do with the way the jenkins plugins interface with the non-proxy settings.

1 Like