Sonarqube下载插件后重启就一直报错服务停机

电脑:MacBook Pro
环境:本地安装,未使用docker镜像安装,sonarqube社区版本:sonarqube-9.4.0.54424
描述:正常安装打开后,下载插件,点击重启使用插件就开始报错服务停机

相关logs:
sonar.20220505.log (7.4 KB)

es.log (17.1 KB)

web.log (67.0 KB)

access.log (5.4 KB)

更改过conf下的wrapper的内容,指定了jdk的版本:

其他暂无改动了,不知道什么原因影响,之前还是能正常打开并且使用 的,docker之前好像也是这种问题

然后刚刚试了新增了数据库postgresql
这是新的日志:
access.log (7.1 KB)
es.log (41.4 KB)
sonar.20220505.log (18.3 KB)
web.log (112.0 KB)

这个是在sonar.properties新加的:
sonar.jdbc.url=jdbc:postgresql://localhost/sonar?currentSchema=public # sonar表示数据库名字

sonar.host.url=http://localhost:9000/sonarqube
sonar.jdbc.username=sonar #数据库用户名
sonar.jdbc.password=123456 # 密码
sonar.login=admin #登陆sonarqube的名字
sonar.password=admin #登陆sonarqube的密码

这段日志说明启动web server的时候出问题了。

2022.05.05 21:16:06 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2022.05.05 21:16:21 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2022.05.05 21:16:21 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [/usr/local/Cellar/sonarqube-9.4.0.54424]: /Library/Java/JavaVirtualMachines/jdk-11.0.15.1.jdk/Contents/Home/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/usr/local/Cellar/sonarqube-9.4.0.54424/temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-9.4.0.54424.jar:/usr/local/Cellar/sonarqube-9.4.0.54424/lib/jdbc/h2/h2-2.1.210.jar org.sonar.server.app.WebServer /usr/local/Cellar/sonarqube-9.4.0.54424/temp/sq-process7381299969285871252properties
2022.05.05 21:16:39 INFO  app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped

查看web server的log,发现是这个原因导致的。

2022.05.05 21:16:32 INFO  web[][o.s.s.s.RegisterMetrics] Register metrics
2022.05.05 21:16:32 INFO  web[][o.s.s.r.RegisterRules] Register rules
2022.05.05 21:16:38 INFO  web[][o.s.s.q.b.BuiltInQProfileRepositoryImpl] Load quality profiles
2022.05.05 21:16:38 WARN  web[][o.s.c.a.AnnotationConfigApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@4b85612c-org.sonar.server.qualityprofile.builtin.BuiltInQProfileLoader': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Rule with key 'checkstyle:com.puppycrawl.tools.checkstyle.checks.TranslationCheck' not found
2022.05.05 21:16:38 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@4b85612c-org.sonar.server.qualityprofile.builtin.BuiltInQProfileLoader': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Rule with key 'checkstyle:com.puppycrawl.tools.checkstyle.checks.TranslationCheck' not found
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:628)
	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.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:187)
	at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:80)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup.access$001(PlatformLevelStartup.java:51)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup$1.doPrivileged(PlatformLevelStartup.java:119)
	at org.sonar.server.user.DoPrivileged.execute(DoPrivileged.java:45)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup.start(PlatformLevelStartup.java:116)
	at org.sonar.server.platform.PlatformImpl.executeStartupTasks(PlatformImpl.java:183)
	at org.sonar.server.platform.PlatformImpl$1.lambda$doRun$1(PlatformImpl.java:107)
	at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.runIfNotAborted(PlatformImpl.java:344)
	at org.sonar.server.platform.PlatformImpl$1.doRun(PlatformImpl.java:107)
	at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.run(PlatformImpl.java:328)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: Rule with key 'checkstyle:com.puppycrawl.tools.checkstyle.checks.TranslationCheck' not found
	at com.google.common.base.Preconditions.checkState(Preconditions.java:590)
	at org.sonar.server.qualityprofile.builtin.BuiltInQProfileRepositoryImpl.lambda$updateOrCreateBuilder$6(BuiltInQProfileRepositoryImpl.java:206)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085)
	at org.sonar.server.qualityprofile.builtin.BuiltInQProfileRepositoryImpl.updateOrCreateBuilder(BuiltInQProfileRepositoryImpl.java:203)
	at org.sonar.server.qualityprofile.builtin.BuiltInQProfileRepositoryImpl.lambda$toQualityProfileBuilders$5(BuiltInQProfileRepositoryImpl.java:182)
	at java.base/java.util.HashMap.compute(HashMap.java:1229)
	at org.sonar.server.qualityprofile.builtin.BuiltInQProfileRepositoryImpl.toQualityProfileBuilders(BuiltInQProfileRepositoryImpl.java:180)
	at org.sonar.server.qualityprofile.builtin.BuiltInQProfileRepositoryImpl.lambda$toFlatList$2(BuiltInQProfileRepositoryImpl.java:138)
	at org.sonar.core.util.stream.MoreCollectors.lambda$uniqueIndex$9(MoreCollectors.java:258)
	at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
	at java.base/java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1763)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
	at org.sonar.server.qualityprofile.builtin.BuiltInQProfileRepositoryImpl.toFlatList(BuiltInQProfileRepositoryImpl.java:136)
	at org.sonar.server.qualityprofile.builtin.BuiltInQProfileRepositoryImpl.initialize(BuiltInQProfileRepositoryImpl.java:90)
	at org.sonar.server.qualityprofile.builtin.BuiltInQProfileLoader.start(BuiltInQProfileLoader.java:37)
	at org.sonar.core.platform.StartableBeanPostProcessor.postProcessBeforeInitialization(StartableBeanPostProcessor.java:33)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
	... 20 common frames omitted
2022.05.05 21:16:39 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process
2022.05.05 21:16:39 INFO  web[][o.s.s.n.NotificationDaemon] Notification service stopped
2022.05.05 21:16:39 INFO  web[][o.s.s.p.d.EmbeddedDatabase] Embedded database stopped

你得去看看,你怎么把这个规则搞坏了。

java.lang.IllegalStateException: Rule with key 'checkstyle:com.puppycrawl.tools.checkstyle.checks.TranslationCheck' not found

结合你的这一句,我怀疑是你的插件可能没安装成功导致报错,可以先把插件删除,通过sonarqube的下载目录去删除就行了。大概在 /opt/sonarqube/extensions/plugins/

确实是插件的问题,插件连整个sonarqube删掉就好了,每次插件一多重启的时候就跪了,也不知道咋回事,为什么插件下载多了重启就直接宕机了

我觉得应该插件没下载完整导致的

关闭