mc1arke / sonarqube-community-branch-plugin

A plugin that allows branch analysis and pull request decoration in the Community version of Sonarqube
GNU Lesser General Public License v3.0
2.26k stars 526 forks source link

{"errors":[{"msg":"Current edition does not support branch feature"}]} #980

Closed EvgeniyKhodos closed 1 month ago

EvgeniyKhodos commented 1 month ago

Hello. I can't configure merge request verification. I get message in log: {"errors":[{"msg":"Current edition does not support branch feature"}]} when executing stage Sonarqube check

In my values.yaml:

plugins:
  install: 
    - "https://nexus.company.local/repository/sonar-l10n-ru-plugin-10.3.jar"
    - "https://nexus.company.local/repository/sonarqube-community-branch-plugin-1.20.0.jar"

SONAR_WEB_JAVAOPTS: "-javaagent:/opt/sonarqube/extensions/sonarqube-community-branch-plugin-1.20.0.jar=web"
SONAR_CE_JAVAOPTS: "-javaagent:/opt/sonarqube/extensions/sonarqube-community-branch-plugin-1.20.0.jar=ce"

an in my app.yaml

Sonarqube check:
  stage: Sonar  
  variables:
    SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" 
    MAVEN_OPTS: "-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true -Dsonar.pullrequest.id=$CI_MERGE_REQUEST_IID -Dsonar.pullrequest.sourceBranch=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME -Dsonar.branch.name=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME -Dsonar.pullrequest.targetBranch=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"

What else needs to be added ?

mc1arke commented 1 month ago

You're missing a lot of detail here: I presume this is Helm given you're referring to values.yaml but you've not specified which chart you're using, or which version of Sonarqube it's running, and would typically need to provide things like the compute engine and web startup logs and check the plugins screen in the admin section to show the plugin was reporting as installed

EvgeniyKhodos commented 1 month ago

I use helm, SonarQube version 10.5.1+2816, plugin version 1.20.0. The web interface displays the installed plugin in the plugins.
Community Branch PluginEnables branch and pull request analysis in SonarQube Community Edition, without having to upgrade to Developer Edition | 1.20.0 installed In the logs:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@2783717b-com.github.mc1arke.sonarqube.plugin.almclient.github.v3.RestApplicationAuthenticationProvider': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.github.mc1arke.sonarqube.plugin.almclient.github.v3.RestApplicationAuthenticationProvider] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@2783717b]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:289)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1302)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1219)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
    ... 86 common frames omitted
Caused by: java.lang.IllegalStateException: Failed to introspect Class [com.github.mc1arke.sonarqube.plugin.almclient.github.v3.RestApplicationAuthenticationProvider] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@2783717b]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:485)
    at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:321)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:267)
    ... 99 common frames omitted
Caused by: java.lang.NoClassDefFoundError: io/jsonwebtoken/security/SecureDigestAlgorithm
    at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
    at java.base/java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.base/java.lang.Class.getDeclaredMethods(Unknown Source)
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:467)
    ... 101 common frames omitted
Caused by: java.lang.ClassNotFoundException: io.jsonwebtoken.security.SecureDigestAlgorithm
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    ... 105 common frames omitted
2024.10.15 17:33:03 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process
2024.10.15 17:33:03 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown initiated...
2024.10.15 17:33:03 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown completed.
2024.10.15 17:33:03 INFO  app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2024.10.15 17:33:03 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2024.10.15 17:33:03 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 143
2024.10.15 17:33:03 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
EvgeniyKhodos commented 1 month ago

I solved this problem myself. It turned out that I have Sonarqube version 10.3, not 10.5. I was looking at another line on the chart. You should have looked at this

image:
  repository: sonarqube
  tag: 10.3.0-{{ .Values.edition }}

After installing the 1.18.0 plugin, everything worked quite quickly.