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 9.7.1 On one of the environments, the plugin is not functioning. #774

Closed
nicolaizav93 opened this issue May 25, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@nicolaizav93
Copy link

Hello Community !
I have a problem with SonarQube 9.7.1 and the community-branch-plugin version 1.13.0. I have three environments: PROD, UAT, and DEV. The configurations are the same across all environments, but the plugin doesn't work on DEV. The test passes (the test is performed on Jenkins), but the dropdown in the SonarQube project doesn't work (it only shows the master branch), while on UAT and PROD, there is the option to view other branches (master/test_branch).

To Reproduce
Steps to reproduce the behavior:

  1. Navigate to the project, in my case JMT.
  2. Click on the branch next to the project name.
  3. Switch the branch from master to another one (test_branch).
  4. Error: Unable to switch to another branch.

Expected behavior
Expected behavior: The dropdown should be functional, allowing the selection of at least two different branches.

Screenshots

uat environment

dev environment

Software Versions

  • SonarQube Version: Community EditionVersion 9.7.1 (build 62043)
  • Plugin Version: sonarqube-community-branch-plugin-1.13.0

Additional context
An attempt was made to test it on SonarQube versions 10.0 and 9.9.0 using the plugin version sonarqube-community-branch-plugin-1.14.0, but the result was the same. The plugin was installed strictly following the documentation provided in your instructions.
No warnings or errors related to the plugin were found in the sonar.log/web.log.

@nicolaizav93 nicolaizav93 added the bug Something isn't working label May 25, 2023
@Appelpitje
Copy link

Appelpitje commented May 25, 2023

Same issue here with sonarqube Version 9.7.1 (build 62043) and plugin version 1.13.0

While in the administration section we can see the plugin is installed:
Community Branch Plugin 1.13.0 installed

Server logs:

INFO web[][o.s.s.p.ServerPluginManager] Deploy Community Branch Plugin / 1.13.0 / null
...

java.lang.IllegalStateException: Current edition does not support branch feature at com.google.common.base.Preconditions.checkState(Preconditions.java:502) at org.sonar.server.ce.queue.BranchSupport.createComponentKey(BranchSupport.java:52) at org.sonar.server.ce.queue.ReportSubmitter.submit(ReportSubmitter.java:81) at org.sonar.server.ce.ws.SubmitAction.handle(SubmitAction.java:100) at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:111) at org.sonar.server.platform.web.WebServiceFilter.doFilter(WebServiceFilter.java:84) at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:139) at org.sonar.server.platform.web.SonarLintConnectionFilter.doFilter(SonarLintConnectionFilter.java:66) at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:139) at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:108) at jdk.internal.reflect.GeneratedMethodAccessor21.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:280) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/javax.security.auth.Subject.doAsPrivileged(Subject.java:550) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:253) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:187) at org.apache.catalina.core.ApplicationFilterChain.lambda$doFilter$0(ApplicationFilterChain.java:145) at java.base/java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:143)
...

@nicolaizav93
Copy link
Author

I was able to fix it with the help of the developer's response (mc1arke):
#523
... so you'll need to manually specify the sonar.branch or sonar.pullrequest parameters. ...
Now the line with -Dsonar.branch.name looks like this:
"-Dsonar.branch.name=${params.Branch}"
instead of:
"-Dsonar.branch.name=test_branch"
Thank you, mc1arke!

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