[Angular] Error during SonarQube Scanner execution

Hi Team,

When I am trying to run sonar scanner locally for Angular, I’m getting below, Earlier this was working fine, I am not sure what went wrong.

INFO: Scanner configuration file: /Users/abdulrehman/sonar-scanner-4.2.0.1873-macosx/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 4.2.0.1873
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Mac OS X 10.14.4 x86_64
INFO: User cache: /Users/abdulrehman/.sonar/cache
ERROR: SonarQube server [http://localhost:9000] can not be reached
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1.169s
INFO: Final Memory: 3M/10M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
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: Fail to get bootstrap index from server
at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:42)
at org.sonarsource.scanner.api.internal.JarDownloader.getScannerEngineFiles(JarDownloader.java:58)
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
Caused by: java.lang.IllegalStateException: Status returned by url [http://localhost:9000/batch/index] is not valid: [404]
at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:115)
at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:98)
at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:39)
… 10 more
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! going-to-school-web@0.0.0 sonar: sonar-scanner
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the going-to-school-web@0.0.0 sonar script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

The problem seems pretty clear; the scanner is unable to reach your SonarQube instance during its execution. Is your SonarQube instance still up?

yes, my SonarQube instance is up and running, I have scanned my android code which is working fine.

If you see I had last scanned on 4th June 2020.

Error message and stack trace misguides, should be rectified by SonarQube developers.

I got my SonarQube running by running it with complete argument.

sonar-scanner -X -Dsonar.projectKey=XXX -Dsonar.sources=. -Dsonar.host.url=http://localhost:9000/sonarqube

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