Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

SonarQube server [http://localhost:9000] can not be reached

Yogesh Ravichandran February 5, 2023

I am using gitlab ci for connecting sonarqube to my code.

Followed the same instructions as given in sonarqube portal to connect with gitlab CI.

but getting the following error.

 

INFO: User cache: /builds/development-caracal/caracal/.sonar/cache
32ERROR: SonarQube server [http://localhost:9000] can not be reached
33INFO: ------------------------------------------------------------------------
34INFO: EXECUTION FAILURE
35INFO: ------------------------------------------------------------------------
36INFO: Total time: 0.752s
37INFO: Final Memory: 3M/15M
ERROR: Error during SonarScanner execution
40org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysis

1 answer

0 votes
Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2023

Hi!

Is your gitlab build agent running on the same machine as SonarQube?

You are using localhost:9000 so if SonarQube runs on another machine you should use the correct hostname.

Yogesh Ravichandran February 6, 2023

Even if i try to put that ip i am getting same issue..

SonarQube server [http://18.183.117.92:9000] can not be reached

 

If i try to run the docker image of sonarqube i am getting following error..

root@ip-172-31-11-139:/# docker run -it a5403b12a988
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.8.0.2856
INFO: Java 11.0.18 Alpine (64-bit)
INFO: Linux 5.15.0-1028-aws amd64
INFO: User cache: /opt/sonar-scanner/.sonar/cache
ERROR: SonarQube server [http://localhost:9000] can not be reached
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.769s
INFO: Final Memory: 3M/15M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
org.sonarsource.sc

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2023

Does the firewall allow the connections?

Or maybe you need to use some proxy settings?

Yogesh Ravichandran February 6, 2023

Everything seems to be fine...

can u suggest any other way

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2023

Have you tried using curl to test the connection to SonarQube from the same build agent? Maybe it will give you a better error.

It's difficult for me or other community members to troubleshoot network related issues.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events