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

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

  • which versions are you using (SonarQube : 7.7, Scanner :3.3.0.1492, Plugin:Reactjs-code, and any relevant extension)

  • what are you trying to achieve : Trying to run Scanner after staring the server. But got the below error.

megs@LM-BGL-40518024 macosx-universal-64 % ./sonar.sh start
Starting SonarQube…
Started SonarQube.
megs@LM-BGL-40518024 macosx-universal-64 % ./sonar.sh start
Starting SonarQube…
SonarQube is already running.
megs@LM-BGL-40518024 grc-react-redux % sonar-scanner
INFO: Scanner configuration file: /Users/megs/Documents/sonar-scanner-3.3.0.1492-macosx/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/megs/Desktop/GRC/Uplift/grc-react-redux/sonar-project.properties
INFO: SonarQube Scanner 3.3.0.1492
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Mac OS X 10.15.7 x86_64
INFO: User cache: /Users/megs/.sonar/cache
ERROR: SonarQube server [http://localhost:9000] can not be reached
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 8:20.246s
INFO: Final Memory: 6M/491M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Unable to execute SonarQube
ERROR: Caused by: Fail to get bootstrap index from server
ERROR: Caused by: timeout
ERROR: Caused by: Read timed out
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.

server is running in my local: (screenshot)


Please help me to resolve this issue.

Thanks and Regards,
Megha

Hi Megha,

SonarQube 7.7 and sonar-scanner 3.3.0 are both quite old; please consider upgrading to at least the 7.9 LTS release and latest scanner version.

Did you wait for the server to finish starting up before you invoked the scanner? It looks like you tried it immediately after issuing the start command. Try again after confirming the UI is accessible.

What port is your server configured to listen on? Maybe it’s not 9000. Had you modified the sonar.properties file previously? Look for the value sonar.web.port. If you’re not running on the standard port, the scanner must be configured to be aware of the address of your SonarQube instance. See examples of setting sonar.host.url here.