SonarQube api/v2/analysis/jres/XXXXX HTTP error 500

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Maven: 3.8.8
    SonarQube: 10.7
    Scanner CLI 6.1.0.4477
    Java Version: 17

  • how is SonarQube deployed: zip, Docker, Helm
    Zip

  • what are you trying to achieve
    Scan a Project

When running I get following error:

16:49:20.100 INFO Scanner configuration file: /azp/_work/_tasks/SonarQubeAnalyze_x-x-x-x/6.3.2/sonar-scanner/conf/sonar-scanner.properties
16:49:20.115 INFO Project root configuration file: /azp/_work/1/s/sonar-project.properties
16:49:20.142 INFO SonarScanner CLI 6.1.0.4477
16:49:20.145 INFO Java 17.0.11 Ubuntu (64-bit)
16:49:20.147 INFO Linux 5.10.226-214.879.amzn2.x86_64 amd64
16:49:20.157 DEBUG Scanner max available memory: 1 GB
16:49:20.189 DEBUG uname -m returned 'x86_64'
16:49:20.191 DEBUG Create: /root/.sonar/cache
16:49:20.193 INFO User cache: /root/.sonar/cache
16:49:20.193 DEBUG Create: /root/.sonar/cache/_tmp
16:49:20.649 DEBUG Loaded [411] system trusted certificates
16:49:20.920 DEBUG --> GET https://URL/sonarqube/api/v2/analysis/version
16:49:21.478 DEBUG <-- 200 https://URL/sonarqube/api/v2/analysis/version (557ms, 12-byte body)
16:49:21.484 INFO JRE provisioning: os[linux], arch[x86_64]
16:49:21.487 DEBUG --> GET https://URL/sonarqube/api/v2/analysis/jres?os=linux&arch=x86_64
16:49:21.570 DEBUG <-- 200 https://URL/sonarqube/api/v2/analysis/jres?os=linux&arch=x86_64 (82ms, unknown-length body)
16:49:21.596 DEBUG Download https://URL/sonarqube/api/v2/analysis/jres/x-x-x-x to /root/.sonar/cache/_tmp/fileCache955428319435128236.tmp
16:49:21.597 DEBUG --> GET https://URL/sonarqube/api/v2/analysis/jres/x-x-x-x
16:49:21.794 DEBUG <-- 500 https://URL/sonarqube/api/v2/analysis/jres/x-x-x-x (196ms, 36-byte body)
16:49:21.797 INFO EXECUTION FAILURE
16:49:21.801 INFO  Total time: 1.785s
##[error]16:49:21.802 ERROR Error during SonarScanner CLI execution
java.lang.IllegalStateException: Error status returned by url [https://URL/sonarqube/api/v2/analysis/jres/x-x-x-x]: 500
	at org.sonarsource.scanner.lib.internal.http.ServerConnection.callUrl(ServerConnection.java:182)
	at org.sonarsource.scanner.lib.internal.http.ServerConnection.downloadFile(ServerConnection.java:109)
	at org.sonarsource.scanner.lib.internal.http.ServerConnection.downloadFromRestApi(ServerConnection.java:79)
	at org.sonarsource.scanner.lib.internal.JavaRunnerFactory$JreDownloader.download(JavaRunnerFactory.java:255)
	at org.sonarsource.scanner.lib.internal.cache.FileCache.download(FileCache.java:101)
	at org.sonarsource.scanner.lib.internal.cache.FileCache.getOrDownload(FileCache.java:88)
	at org.sonarsource.scanner.lib.internal.JavaRunnerFactory.getJreFromServer(JavaRunnerFactory.java:143)
	at org.sonarsource.scanner.lib.internal.JavaRunnerFactory.createRunner(JavaRunnerFactory.java:85)
	at org.sonarsource.scanner.lib.internal.ScannerEngineLauncherFactory.createLauncher(ScannerEngineLauncherFactory.java:53)
	at org.sonarsource.scanner.lib.ScannerEngineBootstrapper.bootstrap(ScannerEngineBootstrapper.java:118)
	at org.sonarsource.scanner.cli.Main.analyze(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:63)
16:49:21.802 ERROR Error during SonarScanner CLI execution
java.lang.IllegalStateException: Error status returned by url [https://URL/sonarqube/api/v2/analysis/jres/x-x-x-x]: 500
	at org.sonarsource.scanner.lib.internal.http.ServerConnection.callUrl(ServerConnection.java:182)
	at org.sonarsource.scanner.lib.internal.http.ServerConnection.downloadFile(ServerConnection.java:109)
	at org.sonarsource.scanner.lib.internal.http.ServerConnection.downloadFromRestApi(ServerConnection.java:79)
	at org.sonarsource.scanner.lib.internal.JavaRunnerFactory$JreDownloader.download(JavaRunnerFactory.java:255)
	at org.sonarsource.scanner.lib.internal.cache.FileCache.download(FileCache.java:101)
	at org.sonarsource.scanner.lib.internal.cache.FileCache.getOrDownload(FileCache.java:88)
	at org.sonarsource.scanner.lib.internal.JavaRunnerFactory.getJreFromServer(JavaRunnerFactory.java:143)
	at org.sonarsource.scanner.lib.internal.JavaRunnerFactory.createRunner(JavaRunnerFactory.java:85)
	at org.sonarsource.scanner.lib.internal.ScannerEngineLauncherFactory.createLauncher(ScannerEngineLauncherFactory.java:53)
	at org.sonarsource.scanner.lib.ScannerEngineBootstrapper.bootstrap(ScannerEngineBootstrapper.java:118)
	at org.sonarsource.scanner.cli.Main.analyze(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:63)
##[error]16:49:21.811 ERROR 

Why is it returning a 500 Internal Server Error the SQ? Whcih logs to look on cause I have check all logs and do not identify any printing logs at all.

This has to do more with the ALB that is in the middle more then the SQ itself, as I use docker-compose to bring the same instance bach and the above URL was OK not giving an error 500.

So just leaving the case here just in case anyone finds it useful.

1 Like