sonarqubesonarqube-scansonar-runnersonarscanner

Unable to execute SonarScanner analysis due to Time out Exception


Versions : Sonar : 8.8.0.42792 Sonar-scanner : 4.5.0.2216 MacOS : Catalina 10.15.6

sonar-project.properties :

sonar.projectName=camel
sonar.projectKey=camel-key
sonar.projectVersion=1.0
sonar.sources=src
sonar.language=java
sonar.sourceEncoding=UTF-8
sonar.java.binaries=build/classes

sonar-scanner :

  #----- Default SonarQube server
  sonar.host.url=http://localhost:9000 # tried with local IP 127.0.0.1 & network IP too
  
  #----- Default source code encoding
  sonar.sourceEncoding=UTF-8

Sonar Qube is UP, status is running , can access console too.

I have ZScaler security firewall, protected with password so can't modify or stop it.

Now, while executing below command from Project root directory where sonar-project.properties file exists , I am getting following error.

Caused by: java.net.SocketTimeoutException: Read timed out

Any particular reason and how to solve this , please ?


Solution

  • For some reason, the port 9000 is blocked by Zscaler (My machine has Zscaler turned on, I've not made any changes to Zscaler settings). However the solution I found is to change the Sonarqube's port to something else, eg 9090

    Steps

    1. Go to sonarqube-8.7.0.41497/conf (Im using 8.7, so you need to go the version you're using)
    2. Open up sonar.properties
    3. Change sonar.web.port=9000 to sonar.web.port=9090
    4. Launch your sonarqube again by running sonar.sh start
    5. Try scanning your project, by running sonar-scanner where your sonar-project.properties is.