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

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.

Greetings Arnab,

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

Alex.

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

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.

Thanks, Alex.

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

Arnab.

Arnab,

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

Alex.

Alex,

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

Arnab

Hi Alex,

Did you get chance to analyse the logs?

-Arnab

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.

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.

Alex,

Following is the detailed log:

-Arnab

Alex,

The issue looks from the AWS instance DB size limit. Basically we are able to push certain small sized reports, but it returns an error when we try pushing the entire project report. We have raised the concern with our AWS team and waiting for a resolution.

However, the connectivity issue still persists. We are able to push (smaller-sized) reports only from an open network (only). From within our office network we aren’t able to reach the Sonar instance.

-Arnab