SonarQube 9.6 after clean install/upgrade - ORA-01400: cannot insert NULL

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) - 9.6
  • what are you trying to achieve - first start after installation
    We are using OpenJDK 11, with Oracle 19C database, and after the frist install (on LINUX) we can not start the application, always got the following error message:
</>
### Error committing transaction.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.rule.RuleMapper.insertRuleDescriptionSection (batch index #15) failed. 14 prior sub executor(s) complet
ed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("SONAR"."RULE_DESC_SECTIONS"."CONTENT")

### Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.rule.RuleMapper.insertRuleDescriptionSection (batch index #15) failed. 14 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("SONAR"."RULE_DESC_SECTIONS"."CONTENT")
</>`Preformatted text`

and the app trying to restart itself…

Warm welcome @szallev_raifhu ,

Thank you for reporting the issue.

Could you double check what custom plugins are installed in your SQ instance?

hello,
there are no custom plugins, it’s a clean server RHEL8, very first install from original source, without customization, we tried to upgrade the v9.5 to v9.6 (Developer Edition) but it’s the same

1 Like

Thanks. I will kindly ask you to share the logs located in the “logs” folder in the private message and we will take it from there.

We’re having issues upgrading SonarQube 9.4 (Developer EditionVersion 9.4 (build 54424)) to 9.6.
I’ve performed docker image upgrade and database upgrade. All seemed fine but the container keeps restarting. I can see the below errors in the logs. We’re using Oracle as a backend database.
Assistance will be greatly appreciated.

Thanks in advance.

2022.08.17 10:53:21 INFO  web[][o.s.s.s.RegisterMetrics] Register metrics
2022.08.17 10:53:21 INFO  web[][o.s.s.r.RegisterRules] Register rules
2022.08.17 10:53:29 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@277050dc-org.sonar.server.rule.RegisterRules': Initialization of bean failed; nested exception is org.apache.ibatis.exceptions.PersistenceException: \n### Error committing transaction.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.rule.RuleMapper.insertRuleDescriptionSection (batch index #15) failed. 14 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("SONARQUBE_OWNER"."RULE_DESC_SECTIONS"."CONTENT")\n\n### Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.rule.RuleMapper.insertRuleDescriptionSection (batch index #15) failed. 14 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("SONARQUBE_OWNER"."RULE_DESC_SECTIONS"."CONTENT")\n
2022.08.17 10:53:29 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@277050dc-org.sonar.server.rule.RegisterRules': Initialization of bean failed; nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error committing transaction.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.rule.RuleMapper.insertRuleDescriptionSection (batch index #15) failed. 14 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("SONARQUBE_OWNER"."RULE_DESC_SECTIONS"."CONTENT")
 
### Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.rule.RuleMapper.insertRuleDescriptionSection (batch index #15) failed. 14 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("SONARQUBE_OWNER"."RULE_DESC_SECTIONS"."CONTENT")
 
        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:55)
        at org.sonar.server.platform.platformlevel.PlatformLevelStartup$1.doPrivileged(PlatformLevelStartup.java:127)
        at org.sonar.server.user.DoPrivileged.execute(DoPrivileged.java:45)
        at org.sonar.server.platform.platformlevel.PlatformLevelStartup.start(PlatformLevelStartup.java:124)
        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:829)
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error committing transaction.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.rule.RuleMapper.insertRuleDescriptionSection (batch index #15) failed. 14 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("SONARQUBE_OWNER"."RULE_DESC_SECTIONS"."CONTENT")
 
### Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.rule.RuleMapper.insertRuleDescriptionSection (batch index #15) failed. 14 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("SONARQUBE_OWNER"."RULE_DESC_SECTIONS"."CONTENT")
 
        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:223)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:214)
        at org.sonar.db.DbSessionImpl.commit(DbSessionImpl.java:42)
        at org.sonar.db.BatchSession.commit(BatchSession.java:168)
        at org.sonar.server.rule.RegisterRules.start(RegisterRules.java:134)
        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
Caused by: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.rule.RuleMapper.insertRuleDescriptionSection (batch index #15) failed. 14 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("SONARQUBE_OWNER"."RULE_DESC_SECTIONS"."CONTENT")
 
        at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:149)
        at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:129)
        at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:122)
        at org.apache.ibatis.executor.BaseExecutor.commit(BaseExecutor.java:242)
        at org.apache.ibatis.executor.CachingExecutor.commit(CachingExecutor.java:119)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:220)
       ... 28 common frames omitted
Caused by: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("SONARQUBE_OWNER"."RULE_DESC_SECTIONS"."CONTENT")
 
        at oracle.jdbc.driver.OraclePreparedStatement.executeLargeBatch(OraclePreparedStatement.java:9711)
        at oracle.jdbc.driver.T4CPreparedStatement.executeLargeBatch(T4CPreparedStatement.java:1447)
        at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9487)
        at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:237)
        at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:241)
        at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:241)
        at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:123)
        ... 33 common frames omitted
2022.08.17 10:53:29 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process
2022.08.17 10:53:29 INFO  web[][o.s.s.n.NotificationDaemon] Notification service stopped
2022.08.17 10:53:29 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@11.0.15/java.lang.Object.wait(Native Method)\n java.base@11.0.15/java.lang.Object.wait(Object.java:328)\n java.base@11.0.15/java.util.TimerThread.mainLoop(Timer.java:527)\n java.base@11.0.15/java.util.TimerThread.run(Timer.java:506)
2022.08.17 10:53:29 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [oracle.jdbc.driver.BlockSource.ThreadedCachingBlockSource.BlockReleaser] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@11.0.15/java.lang.Object.wait(Native Method)\n app//oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource$BlockReleaser.run(BlockSource.java:331)
2022.08.17 10:53:29 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [InterruptTimer] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@11.0.15/java.lang.Object.wait(Native Method)\n java.base@11.0.15/java.util.TimerThread.mainLoop(Timer.java:553)\n java.base@11.0.15/java.util.TimerThread.run(Timer.java:506)
2022.08.17 10:53:29 INFO  app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2022.08.17 10:53:29 INFO  es[][o.e.n.Node] stopping ...
2022.08.17 10:53:29 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 143
2022.08.17 10:53:29 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2022.08.17 10:53:29 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
~#

@MORT I’ve merged your thread into an existing thread where another user has reported the same issue.

i have the same problem with our enterprise edition, i assume there is an error in the upgrade script for the ruleset? Searching did not result in any way of fixing this, is there a solution to this yet?
best regards
Marc

they confirmed me it is a bug, and they are working on it :smiley: so we have to wait

We managed to reproduce the issue on our end. It seems for now that users using Oracle & SQ 9.6 are affected. You can follow the updates on this bug ticket.

Hello Team,

As we see, bug issue seems to have got closed with fix versions, 9.6.1 / 9.7 only for community vesion. The same is not yet available on dockerhub for enterprise version. We are experiencing the same issue with enterprise version as well.
By when, is the rollout planned, which could be used, as we are experiencing same issue and would like to rollout the new version for our environment?

The fix has been released in 9.6.1 which is now available for download.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.