Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin 1.10 does not work with SonarQube 9.3.0.51899 #562

Closed
alfarowil opened this issue Mar 11, 2022 · 6 comments
Closed

Plugin 1.10 does not work with SonarQube 9.3.0.51899 #562

alfarowil opened this issue Mar 11, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@alfarowil
Copy link

Describe the bug

  • I have Installed Sonarqube Community 9.3.0.51899, I have integrated in my Azure devops pipeline for Xamarin project.

  • I have analized succesfully for master branch, pipeline ends with no errors, but it fails when I try to analyze another branch.

  • sonar branch name property is present in project path -> sonar-project.properties, and the value is set according to branch name that is being analized: sonar.branch.name = develop-azure-pipelines

  • When I try to analyze another branch I'm getting the error:

http://XXXXXXXX.eastus.cloudapp.azure.com:9000/api/ce/submit?projectKey=XXXXXX&characteristic=branch%3Ddevelop-azure-pipelines&characteristic=branchType%3DBRANCH : {"errors":[{"msg":"An error has occurred. Please contact your administrator"}]}

  • Validating my web.log, I'm getting:

2022.03.11 17:59:37 ERROR web[AX95ZvE7an1m4R3yAAE6][o.s.s.w.WebServiceEngine] Fail to process request http://XXXXXXXX.eastus.cloudapp.azure.com:9000/api/ce/submit?projectKey=XXXXXX&characteristic=branch%3Ddevelop-azure-pipelines&characteristic=branchType%3DBRANCH
java.lang.IllegalStateException: Current edition does not support branch feature
at com.google.common.base.Preconditions.checkState(Preconditions.java:508)

  • Plugin was installed properly according instructions:
  1. download correct jar version and paste it into extensions/plugins/
  2. configure config/sonar.properties file.
  3. accept warning about using third party plugin

Expected behavior
I Expected when I run a new analysis from another branches, ends with no errors

Screenshots

servers configuration:
server_configs

failed analysis
develop-azure-branch_failed

success master analysis
master_success

Software Versions

  • SonarQube Version: 9.3.0.51899
  • Plugin Version: 1.10.0

Additional context
I reinstalled the server, included deploying a new server and starting from zero, and same results.
I tried without sonar-project.properties file in project path and same results.
I tried setting sonar.branch.name inside of the azure task and same result.

@alfarowil alfarowil added the bug Something isn't working label Mar 11, 2022
@lastlink
Copy link

Also didn't work for me using same version. got branch not supported message

Version 9.3 (build 51899)

do we have to use an older version?

@usmonster
Copy link

It works fine for me, but instead of using the sonar.web.javaAdditionalOpts and sonar.web.javaAdditionalOpts properties I had to set the equivalent environment variables. See #522 (comment). (Depending on some things, you may also need to specify a different path to the JAR—see also Oteemo/charts#333 (comment).)

@alfarowil
Copy link
Author

alfarowil commented Mar 22, 2022

It works fine for me, but instead of using the sonar.web.javaAdditionalOpts and sonar.web.javaAdditionalOpts properties I had to set the equivalent environment variables. See #522 (comment). (Depending on some things, you may also need to specify a different path to the JAR—see also Oteemo/charts#333 (comment).)

@usmonster, This is in my understanding if you are using docker, in my case I deployed Sonar over windows directly in my VM, those properties are not required in my deploy.

@zhenyu-lan
Copy link

sonarqube 9.2.4 (build 50792)也出现了同样的问题;
INFO: SCM Publisher is disabled INFO: CPD Executor Calculating CPD for 0 files INFO: CPD Executor CPD calculation finished (done) | time=1ms INFO: Analysis report generated in 104ms, dir size=109.4 kB INFO: Analysis report compressed in 40ms, zip size=13.1 kB INFO: ------------------------------------------------------------------------ INFO: EXECUTION FAILURE INFO: ------------------------------------------------------------------------ INFO: Total time: 8.684s INFO: Final Memory: 8M/30M INFO: ------------------------------------------------------------------------ ERROR: Error during SonarScanner execution java.lang.IllegalStateException: Failed to upload report: Error 500 on http://sonarqube.zhenyu.host/api/ce/submit?projectKey=vue-adminqq11q&characteristic=branch%3Dmain&characteristic=branchType%3DBRANCH : {"errors":[{"msg":"An error has occurred. Please contact your administrator"}]} at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:207) at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:142) at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:357) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123) at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:136) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123) at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72) at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66) at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) at com.sun.proxy.$Proxy0.execute(Unknown Source) at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189) at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138) at org.sonarsource.scanner.cli.Main.execute(Main.java:112) at org.sonarsource.scanner.cli.Main.execute(Main.java:75) at org.sonarsource.scanner.cli.Main.main(Main.java:61) Caused by: org.sonarqube.ws.client.HttpException: Error 500 on http://sonarqube.zhenyu.host/api/ce/submit?projectKey=vue-adminqq11q&characteristic=branch%3Dmain&characteristic=branchType%3DBRANCH : {"errors":[{"msg":"An error has occurred. Please contact your administrator"}]} at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:36) at org.sonar.scanner.bootstrap.DefaultScannerWsClient.failIfUnauthorized(DefaultScannerWsClient.java:112) at org.sonar.scanner.bootstrap.DefaultScannerWsClient.call(DefaultScannerWsClient.java:75) at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:205) ... 21 more ERROR: ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

@mc1arke
Copy link
Owner

mc1arke commented Apr 4, 2022

Your problem is that your configuration has sonar.ce.javaAdditionalOpts listed twice, the first one should be sonar.web.javaAdditionalOpts. Without this, the plugin will not bind to the web component of Sonarqube so the webservices will not have appropriate implementations of some endpoints in them, and the CE component will probably attempt to load classes without appropriate modification of bytecode.

@mc1arke mc1arke closed this as completed Apr 4, 2022
@alfarowil
Copy link
Author

Yeah!!
that was my entire fault... Now it is working so well.
thanks a lot for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants