[SOLVED] I needed to generate a User Token in the Admin → Security and add it to the sonar-scanner.properties file
Hi All,
I’ve been trying to get SonarQube to run locally on my Win11 machine.
Commands run (so you can see versions as well)
“C:\Program Files\SonarQube\sonarqube-10.5.1.90531\bin\windows-x86-64\StartSonar.bat”
“C:\Program Files\SonarQube\sonarqube-10.5.1.90531\sonarscannermsbuild\SonarScanner.MSBuild.exe” begin /k:“Arena-Client-CSharp” /d:“sonar.verbose=true”
“C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe” “C:\Builds\Perforce\MDN\MDN.sln” /t:Rebuild /p:TargetFramework=net47
“C:\Program Files\SonarQube\sonarqube-10.5.1.90531\sonarscannermsbuild\SonarScanner.MSBuild.exe” end
Shortened error log when running the last command:
13:18:06.892 DEBUG: GET 403 http://localhost:9000/api/plugins/installed | time=4ms
13:18:06.893 DEBUG: Error response content: {“errors”:[{“msg”:“Insufficient privileges”}]}, headers: {connection=[keep-alive], content-type=[application/json], date=[Thu, 20 Jun 2024 20:18:06 GMT], keep-alive=[timeout=60], transfer-encoding=[chunked], vary=[accept-encoding]}
13:18:06.905 INFO: ------------------------------------------------------------------------
13:18:06.905 INFO: EXECUTION FAILURE
13:18:06.905 INFO: ------------------------------------------------------------------------
13:18:06.905 INFO: Total time: 1.046s
13:18:06.914 INFO: Final Memory: 6M/96M
13:18:06.914 INFO: ------------------------------------------------------------------------
12:27:59.848 ERROR: Error during SonarQube Scanner execution
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.sonarsource.scanner.api.internal.IsolatedClassloader@646007f4-org.sonar.scanner.bootstrap.ScannerPluginRepository’: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Fail to parse response of api/plugins/installed
…
Caused by: java.lang.IllegalStateException: Fail to parse response of api/plugins/installed
…
Caused by: You’re not authorized to analyze this project or the project doesn’t exist on SonarQube and you’re not authorized to create it. Please contact an administrator.
Process returned exit code 1
The SonarQube Scanner did not complete successfully
12:27:59.902 Post-processing failed. Exit code: 1
Things I’ve Tried:
- I run all of the commands with CMD.exe as an Admin
- In project permissions on my LocalHost I have given “Administrator” all the permissions.
- In global permissions I have given “Administrator” all the permissions.
- I have also tried adding sonar.projectKey of the project to the “sonar-scanner.properties” since I saw others had success with it. I also then tried to add sonar.organization to the file but I’m not a 100% sure this is correct as I can’t find that string anywhere on the localhost website.
Additional:
- When I open http://localhost:9000/api/plugins/installed in Chrome it loads. When I open it in MS Edge I get {“errors”: [{“msg”: “Insufficient privileges”}]}
- I created a BAT file with the last command in it and Right-Click->Run As Admin to see if it would help (it does not.)
Thanks for any help!