Sonarqube can not start due to DB-Error (10.6.0.92116)

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    —>sonarqube-10.6.0.92116
    —>sonar-scanner-6.0.0.4432-linux
  • how is SonarQube deployed: zip, Docker, Helm
    –>zip
  • what are you trying to achieve
    –>Run Sonarqube after update from sonarqube-10.5.1.90531
  • what have you tried so far to achieve this
    –>ask here in this Forum
    Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
--->
    ('MEDIUM')) was aborted: FEHLER: doppelter Schlüsselwert verletzt Unique-Constraint »uniq_rul_uuid_sof_qual«
  Detail: Schlüssel »(rule_uuid, software_quality)=(AXZnt-n50cHWapxSdKY-, MAINTAINABILITY)« existiert bereits.  Call getNextException to see other errors in the batch.
        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:156)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142)
        at org.sonar.db.DbSessionImpl.selectList(DbSessionImpl.java:87)
        at org.sonar.db.BatchSession.selectList(BatchSession.java:82)
        at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147)
        at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80)
        at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:141)
        at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)
        at jdk.proxy2/jdk.proxy2.$Proxy134.selectByRuleUuid(Unknown Source)
        at org.sonar.db.qualityprofile.ActiveRuleDao.selectByRuleUuid(ActiveRuleDao.java:68)
        at org.sonar.server.rule.registration.QualityProfileChangesUpdater.findQualityProfilesForRule(QualityProfileChangesUpdater.java:79)
        at org.sonar.server.rule.registration.QualityProfileChangesUpdater.lambda$createQprofileChangesForRuleUpdates$1(QualityProfileChangesUpdater.java:58)
        at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273)
        at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1707)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
        at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
        at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
        at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
        at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
        at org.sonar.server.rule.registration.QualityProfileChangesUpdater.createQprofileChangesForRuleUpdates(QualityProfileChangesUpdater.java:60)
        at org.sonar.server.rule.registration.RulesRegistrant.start(RulesRegistrant.java:118)
        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)

Hi there,

after upgrading Sonarqube from sonarqube-10.5.1.90531 to sonarqube-10.6.0.92116 the start of SonarQube fails with the Error-Message above. What can I do to eliminate this error?

Best Regards
David

Hey there.

Can you share what’s happening in the logs before you get this error?

Of course,m if you need more information, let me know!

2024.07.09 09:51:43 INFO  web[][o.s.p.ProcessEntryPoint] Starting Web Server
2024.07.09 09:51:43 INFO  web[][o.s.s.a.TomcatHttpConnectorFactory] Starting Tomcat on port 9000
2024.07.09 09:51:46 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 10.6.0.92116 / 832b6f0491b9d7775943b0e7fcc09ef936d23007
2024.07.09 09:51:46 INFO  web[][o.s.d.DefaultDatabase] Create JDBC data source for jdbc:postgresql://localhost/postgres
2024.07.09 09:51:46 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Starting...
2024.07.09 09:51:46 INFO  web[][c.z.h.p.HikariPool] HikariPool-1 - Added connection org.postgresql.jdbc.PgConnection@4bdc8b5d
2024.07.09 09:51:46 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Start completed.
2024.07.09 09:51:50 INFO  web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /home/chili/sonarqube-10.6.0.92116
2024.07.09 09:51:50 INFO  web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy C# Code Quality and Security / 9.27.0.93347 / f6dd2dc674ed47c3c3b2d54f0dbb1f1e2010ac73
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy CVS / 1.2-SNAPSHOT / 0
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Clean as You Code / 2.3.0.1782 / 1db4e32c08cf9d0b999498e7ba4fd5849583dfdd
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Flex Code Quality and Security / 2.12.0.4568 / e8b2821a05db57b79b8ae85e3db1571f5b744273
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Go Code Quality and Security / 1.15.0.4655 / 28938525c4093d5e9fa4e858535bbcb60af7f066
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy HTML Code Quality and Security / 3.16.0.5274 / 423029a90fcbbd65b86d3b4e9c3e4bc686449a75
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy IaC Code Quality and Security / 1.31.0.10579 / null
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy JaCoCo / 1.3.0.1538 / 74a7798c7cea687c72ed9df40c93eb7ea2a58c49
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Java Advanced Code Quality Analyzer / 8.0.1.36337 / 06cf4ed6298da3ae634677c5eff8bba46f2498a5
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Java Code Quality and Security / 8.0.1.36337 / 06cf4ed6298da3ae634677c5eff8bba46f2498a5
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy JavaScript/TypeScript/CSS Code Quality and Security / 10.14.0.26080 / 1ac0884e4f4afdd4a46add2f1208ee832dc43c87
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Kotlin Code Quality and Security / 2.20.0.4382 / eb22cc4ed915de84e358135dd3f2ea2080de1441
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy PHP Code Quality and Security / 3.36.0.11813 / 5b885f10c336e98e29f269308a4975487b7bdb3b
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Python Code Quality and Security / 4.19.0.15616 / b456a29c1c3b9af03aa6262b6f8264e5a12d019f
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Ruby Code Quality and Security / 1.15.0.4655 / 28938525c4093d5e9fa4e858535bbcb60af7f066
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Scala Code Quality and Security / 1.15.0.4655 / 28938525c4093d5e9fa4e858535bbcb60af7f066
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Text Code Quality and Security / 2.12.1.2905 / null
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy VB.NET Code Quality and Security / 9.27.0.93347 / f6dd2dc674ed47c3c3b2d54f0dbb1f1e2010ac73
2024.07.09 09:51:52 INFO  web[][o.s.s.p.ServerPluginManager] Deploy XML Code Quality and Security / 2.10.0.4108 / 34b16ba369117f6befc0b1e0866a069a80f6db2e
2024.07.09 09:52:16 INFO  web[][o.s.s.p.d.m.c.PostgresCharsetHandler] Verify that database charset supports UTF8
2024.07.09 09:52:17 INFO  web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [http://localhost:9001]
2024.07.09 09:52:18 WARN  web[][o.s.a.s.w.WebService$Action] Description is not set on action api/monitoring/metrics
2024.07.09 09:52:18 WARN  web[][o.s.a.s.w.WebService$Action] Since is not set on action api/monitoring/metrics
2024.07.09 09:52:18 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/monitoring/metrics
2024.07.09 09:52:18 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/system/liveness
2024.07.09 09:52:18 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.WebServiceFilter@130cfc47 [pattern=UrlPattern{inclusions=[/a
pi/system/migrate_db.*, ...], exclusions=[/api/components/update_key, ...]}]
2024.07.09 09:52:18 INFO  web[][o.s.s.p.DetectPluginChange] Detect plugin changes
2024.07.09 09:52:21 INFO  web[][o.h.v.i.util.Version] HV000001: Hibernate Validator null
2024.07.09 09:52:24 INFO  web[][o.s.s.s.LogServerId] Server ID: E176CC90-AXZnt6EB0cHWapxSdJZA
2024.07.09 09:52:24 WARN  web[][o.s.s.a.LogOAuthWarning] For security reasons, OAuth authentication should use HTTPS. You should set the property 'Administration > Configuration > S
erver base URL' to an HTTPS URL.
2024.07.09 09:52:24 INFO  web[][o.s.s.p.UpdateCenterClient] Update center: https://downloads.sonarsource.com/sonarqube/update/update-center.properties
2024.07.09 09:52:29 INFO  web[][o.s.a.l.LdapSettingsManager] User mapping: LdapUserMapping{baseDn=ou=Users,ou=OxObjects,dc=chili-radiology,dc=com, request=(&(objectClass=person)(uid
={0})), realNameAttribute=cn, emailAttribute=mail}
2024.07.09 09:52:29 INFO  web[][o.s.a.l.LdapSettingsManager] Group mapping: LdapGroupMapping{baseDn=ou=OxObjects,dc=chili-radiology,dc=com, idAttribute=cn, requiredUserAttributes=[u
id], request=(&(objectClass=posixGroup)(memberUid={0}))}
2024.07.09 09:52:29 INFO  web[][o.s.a.l.LdapContextFactory] Test LDAP connection on ldap://ldap-srv2: OK
2024.07.09 09:52:32 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action saml/validation_init
2024.07.09 09:52:32 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/system/liveness
2024.07.09 09:52:32 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/plugins/download
2024.07.09 09:52:32 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/analysis_cache/get
2024.07.09 09:52:32 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/check_pat
2024.07.09 09:52:32 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/push/sonarlint_events
2024.07.09 09:52:32 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/dismiss_message/check
2024.07.09 09:52:32 INFO  web[][o.s.s.n.NotificationDaemon] Notification service started (delay 10800 sec.)
2024.07.09 09:52:32 INFO  web[][o.s.s.t.TelemetryDaemon] Sharing of SonarQube statistics is enabled.
2024.07.09 09:52:33 INFO  web[][o.s.s.a.p.ExpiredSessionsCleaner] Purge of expired session tokens has removed 0 elements
2024.07.09 09:52:33 INFO  web[][o.s.s.a.p.ExpiredSessionsCleaner] Purge of expired SAML message ids has removed 0 elements
2024.07.09 09:52:35 INFO  web[][o.s.s.s.RegisterMetrics] Register metrics
2024.07.09 09:52:35 INFO  web[][o.s.s.q.RegisterQualityGates] Sonar way legacy Gate: org.sonar.db.qualitygate.QualityGateDto@2e322fbd
2024.07.09 09:52:35 INFO  web[][o.s.s.r.r.RulesRegistrant] Register rules
2024.07.09 09:53:07 WARN  web[][o.s.c.a.AnnotationConfigApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.bea
ns.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@5ffd2b27-org.sonar.server.rule.registration.RulesRegistrant': Initia
lization of bean failed; nested exception is org.apache.ibatis.exceptions.PersistenceException: \n### Error querying database.  Cause: org.apache.ibatis.executor.BatchExecutorExcept
ion: org.sonar.db.rule.RuleMapper.insertRuleDefaultImpact (batch index #5) failed. 4 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpda
teException: Batch entry 0 INSERT INTO rules_default_impacts (rule_uuid, software_quality, severity)\n    VALUES (\n    ('AXZnt-n50cHWapxSdKY-'),\n    ('MAINTAINABILITY'),\n    ('ME
DIUM')) was aborted: FEHLER: doppelter Schlüsselwert verletzt Unique-Constraint »uniq_rul_uuid_sof_qual«\n  Detail: Schlüssel »(rule_uuid, software_quality)=(AXZnt-n50cHWapxSdKY-, M
AINTAINABILITY)« existiert bereits.  Call getNextException to see other errors in the batch.\n### The error may exist in org.sonar.db.qualityprofile.ActiveRuleMapper\n### The error
may involve org.sonar.db.qualityprofile.ActiveRuleMapper.selectByRuleUuid\n### The error occurred while executing a query\n### Cause: org.apache.ibatis.executor.BatchExecutorExcepti
on: org.sonar.db.rule.RuleMapper.insertRuleDefaultImpact (batch index #5) failed. 4 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdat
eException: Batch entry 0 INSERT INTO rules_default_impacts (rule_uuid, software_quality, severity)\n    VALUES (\n    ('AXZnt-n50cHWapxSdKY-'),\n    ('MAINTAINABILITY'),\n    ('MED
IUM')) was aborted: FEHLER: doppelter Schlüsselwert verletzt Unique-Constraint »uniq_rul_uuid_sof_qual«\n  Detail: Schlüssel »(rule_uuid, software_quality)=(AXZnt-n50cHWapxSdKY-, MA
INTAINABILITY)« existiert bereits.  Call getNextException to see other errors in the batch.
2024.07.09 09:53:07 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@5ffd2b27-org.sonar.server.rule.registration.R
ulesRegistrant': Initialization of bean failed; nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.rule.RuleMapper.insertRuleDefaultImpact (batch index #5) failed. 4 prior sub exe
cutor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO rules_default_impacts (rule_uuid, software_quality, severit
y)
   VALUES (
    ('AXZnt-n50cHWapxSdKY-'),
    ('MAINTAINABILITY'),
    ('MEDIUM')) was aborted: FEHLER: doppelter Schlüsselwert verletzt Unique-Constraint »uniq_rul_uuid_sof_qual«
  Detail: Schlüssel »(rule_uuid, software_quality)=(AXZnt-n50cHWapxSdKY-, MAINTAINABILITY)« existiert bereits.  Call getNextException to see other errors in the batch.
### The error may exist in org.sonar.db.qualityprofile.ActiveRuleMapper
### The error may involve org.sonar.db.qualityprofile.ActiveRuleMapper.selectByRuleUuid
### The error occurred while executing a query
### Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.rule.RuleMapper.insertRuleDefaultImpact (batch index #5) failed. 4 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO rules_default_impacts (rule_uuid, software_quality, severity)
    VALUES (
    ('AXZnt-n50cHWapxSdKY-'),
    ('MAINTAINABILITY'),
    ('MEDIUM')) was aborted: FEHLER: doppelter Schlüsselwert verletzt Unique-Constraint »uniq_rul_uuid_sof_qual«
  Detail: Schlüssel »(rule_uuid, software_quality)=(AXZnt-n50cHWapxSdKY-, MAINTAINABILITY)« existiert bereits.  Call getNextException to see other errors in the batch.
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:628)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)



---------------

sonar.log:


2024.07.09 09:50:49 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /home/chili/sonarqube-10.6.0.92116/temp
2024.07.09 09:50:49 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:34739]
2024.07.09 09:50:49 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [/home/chili/sonarqube-10.6.0.92116/elasticsearch]: /opt/jdk-17.0.6+10/bin/java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=./bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=/home/chili/sonarqube-10.6.0.92116/elasticsearch -Des.path.conf=/home/chili/sonarqube-10.6.0.92116/temp/conf/es -Des.distribution.type=tar -cp /home/chili/sonarqube-10.6.0.92116/elasticsearch/lib/*:/home/chili/sonarqube-10.6.0.92116/elasticsearch/lib/cli-launcher/* org.elasticsearch.launcher.CliToolLauncher
2024.07.09 09:50:49 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2024.07.09 09:51:41 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2024.07.09 09:51:41 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [/home/chili/sonarqube-10.6.0.92116]: /opt/jdk-17.0.6+10/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/home/chili/sonarqube-10.6.0.92116/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 -Xmx1024m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-10.6.0.92116.jar:/home/chili/sonarqube-10.6.0.92116/lib/jdbc/postgresql/postgresql-42.7.3.jar org.sonar.server.app.WebServer /home/chili/sonarqube-10.6.0.92116/temp/sq-process14842992433168662899properties
2024.07.09 09:53:08 INFO  app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2024.07.09 09:53:09 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2024.07.09 09:53:09 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 143
2024.07.09 09:53:09 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped


----------------------
es.log:



2024.07.09 09:50:56 INFO  es[][o.e.n.NativeAccess] Using [jna] native provider and native methods for [Linux]
2024.07.09 09:50:59 INFO  es[][o.e.n.Node] version[8.13.4], pid[8575], build[tar/da95df118650b55a500dcc181889ac35c6d8da7c/2024-05-06T22:04:45.107454559Z], OS[Linux/5.14.21-150400.24.100-default/amd64], JVM[Eclipse Adoptium/OpenJDK 64-Bit Server VM/17.0.6/17.0.6+10]
2024.07.09 09:50:59 INFO  es[][o.e.n.Node] JVM home [/opt/jdk-17.0.6+10], using bundled JDK [false]
2024.07.09 09:50:59 INFO  es[][o.e.n.Node] JVM arguments [-Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -Djava.security.manager=allow, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=SPI,COMPAT, --add-opens=java.base/java.io=org.elasticsearch.preallocate, -XX:ReplayDataFile=logs/replay_pid%p.log, -Des.distribution.type=tar, -XX:+UseG1GC, -Djava.io.tmpdir=/home/chili/sonarqube-10.6.0.92116/temp, -XX:ErrorFile=/home/chili/sonarqube-10.6.0.92116/logs/es_hs_err_pid%p.log, -Xlog:disable, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djna.tmpdir=/home/chili/sonarqube-10.6.0.92116/temp, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=COMPAT, -Des.enforce.bootstrap.checks=true, -Xmx512m, -Xms512m, -XX:MaxDirectMemorySize=256m, -XX:+HeapDumpOnOutOfMemoryError, -XX:G1HeapRegionSize=4m, -XX:InitiatingHeapOccupancyPercent=30, -XX:G1ReservePercent=15, --module-path=/home/chili/sonarqube-10.6.0.92116/elasticsearch/lib, --add-modules=jdk.net, --add-modules=ALL-MODULE-PATH, -Djdk.module.main=org.elasticsearch.server]
2024.07.09 09:50:59 INFO  es[][o.e.n.Node] Default Locale [en_US]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [rest-root]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [reindex]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-core]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-redact]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-security]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-apm-data]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [old-lucene-versions]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [counted-keyword]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [x-pack-inference]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [health-shards-availability]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [apm]
2024.07.09 09:51:05 INFO  es[][o.e.p.PluginsService] loaded module [aggregations]
2024.07.09 09:51:08 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (/dev/sda2)]], net usable_space [20.1gb], net total_space [51gb], types [ext4]
2024.07.09 09:51:08 INFO  es[][o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true]
2024.07.09 09:51:08 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [Tji29yb8Qh-KZHk1mtcRWg], cluster name [sonarqube], roles [data_cold, data, remote_cluster_client, master, data_warm, data_content, transform, data_hot, ml, data_frozen, ingest]
2024.07.09 09:51:21 INFO  es[][o.e.f.FeatureService] Registered local node features [desired_node.version_deprecated, features_supported, health.extended_repository_indicator, usage.data_tiers.precalculate_stats]
2024.07.09 09:51:22 INFO  es[][o.e.x.s.Security] Security is disabled
2024.07.09 09:51:22 INFO  es[][o.e.x.a.APMPlugin] APM ingest plugin is disabled
2024.07.09 09:51:23 INFO  es[][o.e.t.a.APM] Sending apm metrics is disabled
2024.07.09 09:51:23 INFO  es[][o.e.t.a.APM] Sending apm tracing is disabled
2024.07.09 09:51:24 INFO  es[][o.e.t.n.NettyAllocator] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=1mb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=true, g1gc_region_size=4mb, heap_size=512mb}]
2024.07.09 09:51:24 INFO  es[][o.e.i.r.RecoverySettings] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]
2024.07.09 09:51:24 INFO  es[][o.e.d.DiscoveryModule] using discovery type [single-node] and seed hosts providers [settings]
2024.07.09 09:51:26 INFO  es[][o.e.n.Node] initialized
2024.07.09 09:51:26 INFO  es[][o.e.n.Node] starting ...
2024.07.09 09:51:27 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:34739}, bound_addresses {127.0.0.1:34739}
2024.07.09 09:51:28 INFO  es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
2024.07.09 09:51:28 INFO  es[][o.e.c.c.ClusterBootstrapService] this node is locked into cluster UUID [7dXf8SCxTLySC0P1dGV1cA] and will not attempt further cluster bootstrapping
2024.07.09 09:51:29 INFO  es[][o.e.c.s.MasterService] elected-as-master ([1] nodes joined in term 7)[_FINISH_ELECTION_, {sonarqube}{Tji29yb8Qh-KZHk1mtcRWg}{KkWAzVwXT_q84xzW78avqA}{sonarqube}{127.0.0.1}{127.0.0.1:34739}{cdfhilmrstw}{8.13.4}{7000099-8503000} completing election], term: 7, version: 128, delta: master node changed {previous [], current [{sonarqube}{Tji29yb8Qh-KZHk1mtcRWg}{KkWAzVwXT_q84xzW78avqA}{sonarqube}{127.0.0.1}{127.0.0.1:34739}{cdfhilmrstw}{8.13.4}{7000099-8503000}]}
2024.07.09 09:51:29 INFO  es[][o.e.c.s.ClusterApplierService] master node changed {previous [], current [{sonarqube}{Tji29yb8Qh-KZHk1mtcRWg}{KkWAzVwXT_q84xzW78avqA}{sonarqube}{127.0.0.1}{127.0.0.1:34739}{cdfhilmrstw}{8.13.4}{7000099-8503000}]}, term: 7, version: 128, reason: Publication{term=7, version=128}
2024.07.09 09:51:29 INFO  es[][o.e.c.f.AbstractFileWatchingService] starting file watcher ...
2024.07.09 09:51:29 INFO  es[][o.e.c.f.AbstractFileWatchingService] file settings service up and running [tid=31]
2024.07.09 09:51:29 INFO  es[][o.e.h.AbstractHttpServerTransport] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2024.07.09 09:51:29 INFO  es[][o.e.c.c.NodeJoinExecutor] node-join: [{sonarqube}{Tji29yb8Qh-KZHk1mtcRWg}{KkWAzVwXT_q84xzW78avqA}{sonarqube}{127.0.0.1}{127.0.0.1:34739}{cdfhilmrstw}{8.13.4}{7000099-8503000}] with reason [completing election]
2024.07.09 09:51:29 INFO  es[][o.e.n.Node] started {sonarqube}{Tji29yb8Qh-KZHk1mtcRWg}{KkWAzVwXT_q84xzW78avqA}{sonarqube}{127.0.0.1}{127.0.0.1:34739}{cdfhilmrstw}{8.13.4}{7000099-8503000}{xpack.installed=true, rack_id=sonarqube}
2024.07.09 09:51:30 INFO  es[][o.e.l.ClusterStateLicenseService] license [12f61787-d81d-4448-9cbf-2eeef34bba8b] mode [basic] - valid
2024.07.09 09:51:30 INFO  es[][o.e.g.GatewayService] recovered [6] indices into cluster_state
2024.07.09 09:51:32 INFO  es[][o.e.h.n.s.HealthNodeTaskExecutor] Node [{sonarqube}{Tji29yb8Qh-KZHk1mtcRWg}] is selected as the current health node.
2024.07.09 09:51:41 INFO  es[][o.e.c.r.a.AllocationService] current.health="GREEN" message="Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[metadatas][0]]])." previous.health="RED" reason="shards started [[metadatas][0]]"
2024.07.09 09:53:08 INFO  es[][o.e.n.Node] stopping ...
2024.07.09 09:53:08 INFO  es[][o.e.c.f.AbstractFileWatchingService] shutting down watcher thread
2024.07.09 09:53:08 INFO  es[][o.e.c.f.AbstractFileWatchingService] watcher service stopped
2024.07.09 09:53:09 INFO  es[][o.e.n.Node] stopped
2024.07.09 09:53:09 INFO  es[][o.e.n.Node] closing ...
2024.07.09 09:53:09 INFO  es[][o.e.n.Node] closed

Thanks! I was hoping to see some custom plugins or something as a smoking gun… but that’s not the case.

I’d like to focus on this rule for a moment:

Can you query your Postgres database with this command and return the results?

SELECT * FROM rules WHERE uuid='AXZnt-n50cHWapxSdKY-';

postgres=# select * from rules where uuid =‘AXZnt-n50cHWapxSdKY-’;
name | plugin_rule_key | plugin_key | plugin_config_key | plugin_name | scope | priority | status | language | def_remediation_function | def_remediation_gap_mult | def_remediation_base_effort | gap_description | is_template | description_format | rule_type | security_standards | is_ad_hoc | is_external | created_at | updated_at | uuid | template_uuid | note_data | note_user_uuid | note_created_at | note_updated_at | remediation_function | remediation_gap_mult | remediation_base_effort | ad_hoc_name | ad_hoc_description | ad_hoc_severity | ad_hoc_type | education_principles | clean_code_attribute
------±----------------±-----------±------------------±------------±------±---------±-------±---------±-------------------------±-------------------------±----------------------------±----------------±------------±-------------------±----------±-------------------±----------±------------±-----------±-----------±-----±--------------±----------±---------------±----------------±----------------±---------------------±---------------------±------------------------±------------±-------------------±----------------±------------±---------------------±---------------------
(0 rows)

postgres=#
postgres=#
postgres=#
postgres=# select * from rules where uuid ilike ‘AXZnt-n50cHWapxSdKY%’;
name | plugin_rule_key | plugin_key | plugin_config_key | plugin_name | scope | priority | status | language | def_remediation_function | def_remediation_gap_mult | def_remediation_base_effort | gap_description | is_template | description_format | rule_type | security_standards | is_ad_hoc | is_external | created_at | updated_at | uuid | template_uuid | note_data | note_user_uuid | note_created_at | note_updated_at | remediation_function | remediation_gap_mult | remediation_base_effort | ad_hoc_name | ad_hoc_description | ad_hoc_severity | ad_hoc_type | education_principles | clean_code_attribute
---------------------------------------±----------------±-----------±------------------±----------------±------±---------±-------±---------±-------------------------±-------------------------±----------------------------±----------------±------------±-------------------±----------±-------------------±----------±------------±--------------±--------------±---------------------±--------------±----------±---------------±----------------±----------------±---------------------±---------------------±------------------------±------------±-------------------±----------------±------------±---------------------±---------------------
statement ends with a semicolon | E703 | python | | external_flake8 | MAIN | 2 | READY | py | CONSTANT_ISSUE | | 5min | | f | HTML | 1 | | f | t | 1608057874937 | 1608057874937 | AXZnt-n50cHWapxSdKY- | | | | | | | | | | | | | | CONVENTIONAL
multiple statements on one line (def) | E704 | python | | external_flake8 | MAIN | 2 | READY | py | CONSTANT_ISSUE | | 5min | | f | HTML | 1 | | f | t | 1608057874937 | 1608057874937 | AXZnt-n50cHWapxSdKY_ | | | | | | | | | | | | | | CONVENTIONAL
(2 rows)

I deleted those 2 entries, because I do not need them. After that another error occurs:

2024.07.25 11:25:23 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@5ffd2b27-org.sonar.server.qualityprofile.RegisterQualityProfiles’: Initialization of bean failed; nested exception is BadRequestException{errors=[Rule with UUID AXZnt-gd0cHWapxSdKM_ not found]}
2024.07.25 11:25:23 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@5ffd2b27-org.sonar.server.qualityprofile.RegisterQualityProfiles’: Initialization of bean failed; nested exception is BadRequestException{errors=[Rule with UUID AXZnt-gd0cHWapxSdKM_ not found]}
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:628)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)

The interesting thing ist, that a

postgres=# select name,language from rules where uuid =‘AXZnt-gd0cHWapxSdKM_’;
name | language
------±---------
(0 rows)

does not find any results, but if I execute:

postgres=# select uuid,name,language from rules where uuid ilike ‘AXZnt-gd0cHWapxSdKM%’;
uuid | name | language
----------------------±-----------------------------------------------------------------±---------
AXZnt-gD0cHWapxSdKMS | Creating cookies without the “secure” flag is security-sensitive | js
AXZnt-gd0cHWapxSdKM- | Arithmetic operators should only have numbers as operands | js
AXZnt-gd0cHWapxSdKM_ | Loop counters should not be assigned within the loop body | js
(3 rows)

…find the correct rule.

Is this a sonarqube-internal bug?

Best Regards,
David

Hey there.

It’s a very bad idea to manually delete data from the SonarQube database. I have to ask – do you have a backup from v10.5.1 you can restore to? We should work from a good known state, not manually deleting entries from the database.