SonarQube version:8.8.42792
SonarScanner version: 4.5/4.6
code analysis: C code project
Hi all,
My sonarQube server had run perfectly for a while, till I try to add LDAP setting for authentication yesterday, and then, all analysis execute by Sonar-scanner failed.
Even after I revers the configuration then, SonarQube still returns with fail.
the log output here is
14:01:20.049 INFO: Project root configuration file: NONE
14:01:20.087 INFO: SonarScanner 4.6.0.2311
14:01:20.087 INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
14:01:20.088 INFO: Linux 4.15.0-128-generic amd64
14:01:20.282 DEBUG: keyStore is :
14:01:20.282 DEBUG: keyStore type is : pkcs12
14:01:20.283 DEBUG: keyStore provider is :
14:01:20.283 DEBUG: init keystore
14:01:20.283 DEBUG: init keymanager of type SunX509
14:01:20.432 DEBUG: Create: /home/sonar/.sonar/cache
14:01:20.433 INFO: User cache: /home/sonar/.sonar/cache
14:01:20.433 DEBUG: Create: /home/sonar/.sonar/cache/_tmp
14:01:20.436 DEBUG: Extract sonar-scanner-api-batch in temp...
14:01:20.440 DEBUG: Get bootstrap index...
14:01:20.440 DEBUG: Download: http://localhost/sq/batch/index
14:01:20.513 DEBUG: Get bootstrap completed
14:01:20.519 DEBUG: Download http://localhost/sq/batch/file?name=template.jar to /home/sonar/.sonar/cache/_tmp/fileCache13789044267675696040.tmp
14:01:20.528 ERROR: SonarQube server [http://localhost/sq] can not be reached
14:01:20.529 INFO: ------------------------------------------------------------------------
14:01:20.530 INFO: EXECUTION FAILURE
14:01:20.530 INFO: ------------------------------------------------------------------------
14:01:20.530 INFO: Total time: 0.515s
14:01:20.547 INFO: Final Memory: 3M/17M
14:01:20.547 INFO: ------------------------------------------------------------------------
14:01:20.547 ERROR: Error during SonarScanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysis
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:85)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:74)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:70)
at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:73)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Status returned by url [http://localhost/sq/batch/file?name=template.jar] is not valid: [404]
at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:118)
at org.sonarsource.scanner.api.internal.ServerConnection.downloadFile(ServerConnection.java:80)
at org.sonarsource.scanner.api.internal.JarDownloader$ScannerFileDownloader.download(JarDownloader.java:73)
at org.sonarsource.scanner.api.internal.cache.FileCache.download(FileCache.java:98)
at org.sonarsource.scanner.api.internal.cache.FileCache.get(FileCache.java:84)
at org.sonarsource.scanner.api.internal.JarDownloader.lambda$getScannerEngineFiles$0(JarDownloader.java:60)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
at org.sonarsource.scanner.api.internal.JarDownloader.getScannerEngineFiles(JarDownloader.java:61)
at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:53)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:76)
... 7 more
Seems the problem occurred when the scanner tries to get the .jar file with batch/index, but there are two lines when browsing http://localhost/batch/index like this:
template.jar|****
scanner-developer-8.8.0.42792-all.jar|****
If use wget to grab the first template.jar
file ,I got 404 error
wget http://localhost/sq/batch/file?name=template.jar
Guess sonar-scanner couldn’t download the correct file from the URL and cause the error.
With followed command, I can successfully download the .jar file.
wget http://localhost/sq/batch/file?name=scanner-developer-8.8.0.42792-all.jar
how to fix this problem??