ERROR: SonarCloud server [] can not be reached

I am quite new to sonarcloud . I used to be able to use the sonar-scanner for ant to scan our java code for SonarQube (installed inhouse).

Now our company switched to use and our LINUX machine does not have internet access directly. It has to go through a proxy server

in my environment, there is

env | grep http

if I do a “wget” , the output is

–2024-03-08 23:07:25--
Connecting to… connected.
Proxy request sent, awaiting response… 301 Moved Permanently
Location: [following]
–2024-03-08 23:07:25--
Connecting to… connected.
Proxy request sent, awaiting response… 307 Temporary Redirect
Location: SonarCloud Online Code Review as a Service Tool [following]
–2024-03-08 23:07:25-- SonarCloud Online Code Review as a Service Tool
Connecting to… connected.
Proxy request sent, awaiting response… 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html.1’

[ <=>                                                                                       ] 252,063     --.-K/s   in 0.06s

2024-03-08 23:07:25 (3.83 MB/s) - ‘index.html.1’ saved [252063]

It seems the proxy is working and it can connect to

But when I tried to run the sonar-scanner command, it always says
ERROR: SonarCloud server [] can not be reached

I have tried different variations of the command with or without specifying https.proxyHost and https.proxyPort

  1. sonar-scanner -Dsonar.token=xxxxxxxx -X
  2. sonar-scanner -Dsonar.token=xxxxxxxx -Dhttps.proxyHost= -Dhttps.proxyPort=yyyy -X
  3. sonar-scanner -Dsonar.token=xxxxxxxx -Dhttps.proxyPort=yyyy

and their results are look alike

22:45:24.309 INFO: SonarScanner
22:45:24.310 INFO: Java Eclipse Adoptium (64-bit)
22:45:24.310 INFO: Linux 3.10.0-1160. amd64
22:45:24.427 DEBUG: keyStore is :
22:45:24.427 DEBUG: keyStore type is : pkcs12
22:45:24.427 DEBUG: keyStore provider is :
22:45:24.427 DEBUG: init keystore
22:45:24.427 DEBUG: init keymanager of type SunX509
22:45:24.526 DEBUG: Create: pwd/.sonar/cache
22:45:24.528 INFO: User cache: pwd/.sonar/cache
22:45:24.528 DEBUG: Create: pwd/.sonar/cache/_tmp
22:45:24.530 DEBUG: Extract sonar-scanner-api-batch in temp…
22:45:24.533 DEBUG: Get bootstrap index…
22:45:24.533 DEBUG: Download:
22:47:24.766 ERROR: SonarCloud server [] can not be reached
22:47:24.766 INFO: ------------------------------------------------------------------------
22:47:24.766 INFO: ------------------------------------------------------------------------
22:47:24.766 INFO: Total time: 2:00.492s
22:47:24.783 INFO: Final Memory: 3M/40M
22:47:24.784 INFO: ------------------------------------------------------------------------
22:47:24.784 ERROR: Error during SonarScanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysis
Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from server
Caused by: connect timed out
the file in my project is very basic


And i did not configure the file

Hope someone with more knowledge can point out what I have been missing in my setup


Hello James,

Can you confirm your proxy server, firewall, or network infrastructure is not blocking downloads of jar files? In the 22:45:24.533 DEBUG: Download: step, there is a download of a jar file.

Thanks Joe, I will have to check with the IT network security people.

I am having the same issue when trying to pass it through a proxy.

The flags do not appear to have an effect on Azure Devops pipeline task(Windows 10 custom agents), nor the sonarcloud-cli JAR. (windows 11 and WSL )
Conversely I tested the URL with curl to verify it works with the proxy. Other threads on this issue never seem to reach resolution…

Can you show your logs showing the error? What version of the ADO tasks are you using?

Our IT said the proxy should allow download of jar, so I tried the curl command and it is showing this


does it mean it can connect and dowloaded the jar file with the index??


No, that curl of that /batch/index does not download a jar. That fetches a string of the jar to download with a checksum to check the download.

You need to curl for that jar from your Linux machine or build agent or wherever your pipeline is:

curl '' -o output.jar   

Thank you Joe for the curl command, I ran it in the LINUX box and I see the output.jar file is downloaded/created.

so looks like the proxy is not blocking the download. And I will need to find out why the sonar-scanner command cannot perform the download

Does anyone know how to skip the download of the jar file when running the sonar-scanner CLI ?

No, you can’t do that if you want to scan a project.

Are you still having issues with connection time out? Can you ask your network team to temporarily disable the firewall on that LINUX box and see what happens? If it works, then its the network team’s problem. If it doesn’t work, there’s something else you need to check.

Want to report back that the sonar support team helped solved the probem.

The commandline option -Dhttps.proxyHost and -Dhttps.proxyPort could not be used directly in the commandline. Instead we need to do the following :

export SONAR_SCANNER_OPTS=“ -Dhttps.proxyPort=xxxx”

And then run the sonar-scanner command with the token, organization and projectKey

And it finally scanned successfully.

Thanks to them and also thanks to everyone who gave me suggestions


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.