Unable to resolve host URL of SonarQube hosted on AWS (Can reach local instance fine)

scanner
sonarqube

(Arnab) #1

My build server is a MacMini through on which I am trying to run a Sonar scan. My SonarQube server is an AWS EC2 instance. I am able to browse and login fine. I am able to traceroute that server, however, when I run the Sonar scan, I keep getting unable to reach Sonar server.

I have tried the exact same config with a different SonarQube server that is hosted internally on our internal network - the results are published fine.

So, is there a port setting that needs to be opened or anything that needs to be enabled - either in the Sonar properties file or on the AWS setting?

Do let me know if you need logs or anything?

Thanks in advance.


(Alexandre Frigout) #2

Greetings Arnab,

Thank you for posting the logs of the analysis and the content of your sonar.properties file.

Alex.


(Arnab) #3

Greetings Alex,

Thanks for reverting. Here is a screen grab from my detailed logs…

Also, Here is my SonarScan property file:-

#http.proxyHost=165.225.104.34
#http.proxyPort=9480
#https.proxyHost=165.225.104.34
#https.proxyPort=9480 #--with and without proxy gives same error.


sonar.projectKey=BreatheMapper:BreatheMapper
sonar.projectVersion=1.0
sonar.projectName=BreatheMapperAndroid

sonar.scm.disabled=false

sonar.sources=/Users/breathemapper/Desktop/Android/Source/BreatheMapper/app/src

#----- Local SonarQube server that works fine
#sonar.host.url=http://ingbtcpic5dtn82:9000   

# sonar.host.url=https://sonarqube-mobile.sapphirepri.com/sonar
sonar.host.url=https://52.22.201.252/sonar  ###IP address of above URL. 


#----- Default source code encoding
#sonar.sourceEncoding=UTF-8

#sonar credentials
sonar.login=admin
sonar.password=xxxx

Do let me know if any other information is required.

Thanks,
Arnab


(Alexandre Frigout) #4

Arnab,

The url you provided into your sonar.properties file is an https connection.
Trying to browse https://52.22.201.252/sonar we get a certificate error and then need to manually bypass the certificate validation by the browser.

Do you have a DNS name for this instance ?
If so, is it referenced into the common name or in the alternative names of the certificate you installed on the sevrer ?

Alex.


(Arnab) #5

Thanks, Alex.

The proper URL that I tried earlier and commented, https://sonarqube-mobile.sapphirepri.com/sonar.

Arnab.


(Alexandre Frigout) #6

Arnab,

Is the analysis working well with this url ?
If not please attach the logs of the failure.

Alex.


(Arnab) #7

Alex,

Nope. The URL returns similar errors. Attaching the logs screenshot…

Arnab


(Arnab) #8

Hi Alex,

Did you get chance to analyse the logs?

-Arnab


(Alexandre Frigout) #9

Arnab,

I can reach the https://sonarqube-mobile.sapphirepri.com/sonar from my workstation, it means that the server from which you are running the analysis cannot.
Can you try to ping sonarqube-mobile.sapphirepri.com from your analysis server ?

Alex.


(Arnab) #10

Alex,

Pings are disabled from the build server. I am able to traceroute the URL. Also, telnet works when my analysis server is outside internal network.

Arnab.


(Arnab) #11

Alex,

Following is the detailed log:

-Arnab