Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Sonarqube: java.lang.IllegalStateException: Error status returned by url 401

Solution

Need to add in Sonar-project.prop

sonar.login=admin
sonar.password=admin123

Error

C:\tools\sonarqube\sonar-scanning-examples\sonarqube-scanner>C:\tools\sonarqube\sonar-scanner\bin\sonar-scanner.bat
13:09:29.932 INFO  Scanner configuration file: C:\tools\sonarqube\sonar-scanner\bin\..\conf\sonar-scanner.properties
13:09:29.936 INFO  Project root configuration file: C:\tools\sonarqube\sonar-scanning-examples\sonarqube-scanner\sonar-project.properties
13:09:29.955 INFO  SonarScanner CLI 6.1.0.4477
13:09:29.958 INFO  Java 17.0.11 Eclipse Adoptium (64-bit)
13:09:29.959 INFO  Windows 11 10.0 amd64
13:09:29.981 INFO  User cache: C:\Users\rajes\.sonar\cache
13:09:31.177 INFO  JRE provisioning: os[windows], arch[amd64]
13:09:31.383 INFO  EXECUTION FAILURE
13:09:31.385 INFO  Total time: 1.456s
13:09:31.385 ERROR Error during SonarScanner CLI execution
java.lang.IllegalStateException: Error status returned by url [http://13.200.74.49:9000/api/v2/analysis/jres?os=windows&arch=amd64]: 401
        at org.sonarsource.scanner.lib.internal.http.ServerConnection.callUrl(ServerConnection.java:182)
        at org.sonarsource.scanner.lib.internal.http.ServerConnection.callApi(ServerConnection.java:145)
        at org.sonarsource.scanner.lib.internal.http.ServerConnection.callRestApi(ServerConnection.java:123)
        at org.sonarsource.scanner.lib.internal.JavaRunnerFactory.getJreMetadata(JavaRunnerFactory.java:159)
        at org.sonarsource.scanner.lib.internal.JavaRunnerFactory.getJreFromServer(JavaRunnerFactory.java:138)
        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)
13:09:31.389 ERROR
13:09:31.390 ERROR Re-run SonarScanner CLI using the -X switch to enable full debug logging.




0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x