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

SonarQube 10.6/Plugin 1.22 Bug: Current edition does not support branch feature #993

Open
s123lin opened this issue Nov 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@s123lin
Copy link

s123lin commented Nov 12, 2024

Describe the bug
I set up the community plugin (v 1.22.0) for my SonarQube server (v10.6.0) and I am running into an error when trying to use the sonar.branch.name=${BRANCH_NAME} in my sonar commandline.

To Reproduce
Steps to reproduce the behavior:

  1. I spun up an AWS EC2 instance with following image:
    bitnami-sonarqube-10.6.0-0-r02-linux-debian-12-x86_64-hvm-ebs-nami
  2. I ssh into the instance in order to install the JAR file for the plugin into extensions/plugins/ directory. I downloaded sonarqube-community-branch-plugin-1.22.0.jar
  3. I updated the conf/sonar.properties file with the following contents
sonar.web.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.22.0.jar=web
sonar.ce.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.22.0.jar=ce
  1. I restarted the server with sudo /opt/bitnami/ctlscript.sh restart
  2. I go to the sonarqube server on my web browser and accepted the warning about third-party plugins.
  3. In a AWS CodeBuild buildspec, I have a commandline to submit the project like so to the SonarQube server in the EC2 instance
      - |
        java -jar sonar-scanner-5.0.0.2966/lib/sonar-scanner-cli-5.0.0.2966.jar \
        -Dsonar.projectKey=${REPO_NAME} \
        -Dsonar.host.url=${SONAR_URL} \
        -Dsonar.login=${SONAR_USERNAME} \
        -Dsonar.password=${SONAR_PASSWORD} \
        -Dsonar.branch.name=${BRANCH_NAME} \
        -Dsonar.python.coverage.reportPaths=coverage.xml

Expected behavior
I expected no errors and that my project would show up in the server

Screenshots
Happy to share more, if needed. The error log says the following

ERROR: Error during SonarScanner execution
--
2626 | java.lang.IllegalStateException: Failed to upload report: Error 500 on ***/api/ce/submit?projectKey=paas-pb_edi_etl&characteristic=branch%3Dmaster&characteristic=branchType%3DBRANCH : {"errors":[{"msg":"Current edition does not support branch feature"}]}
2627 | at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:239)
2628 | at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:163)
2629 | at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:181)
2630 | at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
2631 | at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
2632 | at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:351)
2633 | at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
2634 | at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
2635 | at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:144)
2636 | at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
2637 | at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
2638 | at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
2639 | at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
2640 | at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
2641 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2642 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
2643 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2644 | at java.base/java.lang.reflect.Method.invoke(Method.java:569)
2645 | at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
2646 | at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
2647 | at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
2648 | at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
2649 | at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
2650 | at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
2651 | at org.sonarsource.scanner.cli.Main.main(Main.java:62)
2652 | Caused by: org.sonarqube.ws.client.HttpException: Error 500 on ***/api/ce/submit?projectKey=paas-pb_edi_etl&characteristic=branch%3Dmaster&characteristic=branchType%3DBRANCH : {"errors":[{"msg":"Current edition does not support branch feature"}]}
2653 | at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:36)
2654 | at org.sonar.scanner.http.DefaultScannerWsClient.failIfUnauthorized(DefaultScannerWsClient.java:129)
2655 | at org.sonar.scanner.http.DefaultScannerWsClient.call(DefaultScannerWsClient.java:88)
2656 | at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:237)
2657 | ... 24 more
2658 | ERROR:
2659 | ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Software Versions

  • SonarQube Version: 10.6.0
  • Plugin Version: 1.22.0
  • Sonar Cli Version: 5.0.0.2966

Additional context
This was a brand new EC2 instance that I spun up with hopes of setting up a new SonarQube server. After I ran into that error, I proceeded to try the command line without the sonar.branch.name=${BRANCH_NAME}, and (not surprisingly) it works.

@s123lin s123lin added the bug Something isn't working label Nov 12, 2024
@mc1arke
Copy link
Owner

mc1arke commented Nov 16, 2024

Can you retry this with the snapshot version available for download in the Artifcts section of https://github.com/mc1arke/sonarqube-community-branch-plugin/actions/runs/11872851541 ? This version is the build from #1000 and will prevent Sonarqube starting in the plugin isn't installed properly, which is what I think your issue is.

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

2 participants