java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("jiradb"."AO_78C957_NOTIFICATION_HIST"."ID")

atlassian.net | 2 months ago
  1. 0

    Common Problems - JIRA Enterprise Message Handler - Plugin People WIki

    atlassian.net | 2 months ago
    java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("jiradb"."AO_78C957_NOTIFICATION_HIST"."ID")
  2. 0

    During the migration of Confluence from a server to another server I faced the following errors, and managed to resolve them dropping a table and a sequence. h2. Migration process applied - export full XML backup from source installation + data directory - install confluence on new server - import source backup in new confluence using normal import tool h2. Error / Issue description * After migrating, no plugin would not update (the "update" box is shown and either the progress bar would get stuck or finish correctly, but after a full Confluence stop/start it would show that the plugin is still in the same version). * In the log, I identified 2 oracle errors : ORA-01400 (regarding the table) and ORA-00955 (regarding the sequence associated to this table). * The table identified by ORA-01400 was empty. h2. Solution applied * Look in the logs and identify the Table and it's Sequence (look for ORA-00955 error for the Sequence number) . * Stop confluence * Drop the culprit table & sequence : {noformat} select * from AO_6384AB_FEATURE_METADATA_AO DROP TABLE AO_6384AB_FEATURE_METADATA_AO; DROP SEQUENCE AO_6384AB_FEATURE_M675681913; COMMIT; {noformat} * Start confluence * Check : ** if logs still show the same error ** if Confluence filled correctly the table after the restart ** if plugins update correctly h2. Error logs h3. ERROR : ORA-01400 The culprit table is empty and needs to be reconstructed. {noformat} 2016-03-02 11:25:07,717 ERROR [localhost-startStop-1] [atlassian.event.internal.AsynchronousAbleEventDispatcher] run There was an exception thrown trying to dispatch event [com.atlassian.config.lifecycle.events.ApplicationStartedEvent@407a742d] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.plugins.featurediscovery.PluginModuleEventListener.onApplicationStart(com.atlassian.config.lifecycle.events.ApplicationStartedEvent), listener=com.atlassian.confluence.plugins.featurediscovery.PluginModuleEventListener@1cc7b1ba}] java.lang.RuntimeException: There was a SQL exception thrown by the Active Objects library: Database: - name:Oracle - version:Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options - minor version:1 - major version:12 Driver: - name:Oracle JDBC driver - version:12.1.0.2.0 java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("CONFPROD"."AO_6384AB_FEATURE_METADATA_AO"."ID") at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107) at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160) at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79) at com.atlassian.confluence.event.TimingEventPublisher.publish(TimingEventPublisher.java:73) at com.atlassian.config.lifecycle.DefaultLifecycleManager.startUp(DefaultLifecycleManager.java:43) at com.atlassian.config.lifecycle.LifecycleServletContextListener.contextInitialized(LifecycleServletContextListener.java:17) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: {noformat} And the sequence error : {noformat} 2016-03-03 09:50:30,209 ERROR [active-objects-init-system tenant-0] [net.java.ao.sql] handleUpdateError Exception executing SQL update <CREATE SEQUENCE "AO_6384AB_FEATURE_M675681913" INCREMENT BY 1 START WITH 1 NOMAXVALUE MINVALUE 1> java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object {noformat} h2. References this solution was inspired by the following 2 pages : * https://confluence.atlassian.com/confkb/unable-to-install-add-ons-in-upm-due-to-duplicate-key-value-in-ao_6384ab_feature_metadata-table-741999240.html ==> confirmed that I could "safely" delete this table. * https://confluence.atlassian.com/confkb/comments-and-likes-fail-with-internal-server-error-319390100.html ==> confirmed that I could "safely" delete this table, and shown that the "Sequence" also needed to be dropped.

    Atlassian JIRA | 9 months ago | Corentin Mehat
    java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("CONFPROD"."AO_6384AB_FEATURE_METADATA_AO"."ID")
  3. 0

    Changing JBoss BRMS (Drools) to use Oracle 11g: Unable to build package

    Stack Overflow | 4 years ago | ScreamingMage
    java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("DROOLS"."PM_WS_DEFAULT_NAMES"."ID")
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    During the migration of Confluence from a server to another server I faced the following errors, and managed to resolve them dropping a table and a sequence. h2. Migration process applied - export full XML backup from source installation + data directory - install confluence on new server - import source backup in new confluence using normal import tool h2. Error / Issue description * After migrating, no plugin would not update (the "update" box is shown and either the progress bar would get stuck or finish correctly, but after a full Confluence stop/start it would show that the plugin is still in the same version). * In the log, I identified 2 oracle errors : ORA-01400 (regarding the table) and ORA-00955 (regarding the sequence associated to this table). * The table identified by ORA-01400 was empty. h2. Solution applied * Look in the logs and identify the Table and it's Sequence (look for ORA-00955 error for the Sequence number) . * Stop confluence * Drop the culprit table & sequence : {noformat} select * from AO_6384AB_FEATURE_METADATA_AO DROP TABLE AO_6384AB_FEATURE_METADATA_AO; DROP SEQUENCE AO_6384AB_FEATURE_M675681913; COMMIT; {noformat} * Start confluence * Check : ** if logs still show the same error ** if Confluence filled correctly the table after the restart ** if plugins update correctly h2. Error logs h3. ERROR : ORA-01400 The culprit table is empty and needs to be reconstructed. {noformat} 2016-03-02 11:25:07,717 ERROR [localhost-startStop-1] [atlassian.event.internal.AsynchronousAbleEventDispatcher] run There was an exception thrown trying to dispatch event [com.atlassian.config.lifecycle.events.ApplicationStartedEvent@407a742d] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.plugins.featurediscovery.PluginModuleEventListener.onApplicationStart(com.atlassian.config.lifecycle.events.ApplicationStartedEvent), listener=com.atlassian.confluence.plugins.featurediscovery.PluginModuleEventListener@1cc7b1ba}] java.lang.RuntimeException: There was a SQL exception thrown by the Active Objects library: Database: - name:Oracle - version:Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options - minor version:1 - major version:12 Driver: - name:Oracle JDBC driver - version:12.1.0.2.0 java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("CONFPROD"."AO_6384AB_FEATURE_METADATA_AO"."ID") at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107) at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160) at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79) at com.atlassian.confluence.event.TimingEventPublisher.publish(TimingEventPublisher.java:73) at com.atlassian.config.lifecycle.DefaultLifecycleManager.startUp(DefaultLifecycleManager.java:43) at com.atlassian.config.lifecycle.LifecycleServletContextListener.contextInitialized(LifecycleServletContextListener.java:17) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: {noformat} And the sequence error : {noformat} 2016-03-03 09:50:30,209 ERROR [active-objects-init-system tenant-0] [net.java.ao.sql] handleUpdateError Exception executing SQL update <CREATE SEQUENCE "AO_6384AB_FEATURE_M675681913" INCREMENT BY 1 START WITH 1 NOMAXVALUE MINVALUE 1> java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object {noformat} h2. References this solution was inspired by the following 2 pages : * https://confluence.atlassian.com/confkb/unable-to-install-add-ons-in-upm-due-to-duplicate-key-value-in-ao_6384ab_feature_metadata-table-741999240.html ==> confirmed that I could "safely" delete this table. * https://confluence.atlassian.com/confkb/comments-and-likes-fail-with-internal-server-error-319390100.html ==> confirmed that I could "safely" delete this table, and shown that the "Sequence" also needed to be dropped.

    Atlassian JIRA | 9 months ago | Corentin Mehat
    java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("CONFPROD"."AO_6384AB_FEATURE_METADATA_AO"."ID")
  6. 0

    At IU we have a handful of users who have an entity record but no principal (they're an employee but they don't have an IT account). When the IdentityArchiveServiceImpl tries to save the user into the cache it throws an exception like the following: {noformat} [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: * SQLException during execution of sql-statement: * sql statement was 'INSERT INTO KRIM_ENTITY_CACHE_T (PRNCPL_ID,PRNCPL_NM,ENTITY_ID,ENTITY_TYP_CD,FIRST_NM,MIDDLE_NM,LAST_NM,PRSN_NM,CAMPUS_CD,PRMRY_DEPT_CD,EMP_ID,LAST_UPDT_TS,OBJ_ID) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?) ' * Exception message is [ORA-01400: cannot insert NULL into ("KR"."KRIM_ENTITY_CACHE_T"."PRNCPL_ID") ] * Vendor error code [1400] * SQL state code [23000=INTEGRITY CONSTRAINT VIOLATION] * Target class is 'org.kuali.rice.kim.impl.identity.EntityDefaultInfoCacheBo' * PK of the target object is [principalId=null] * Source object: org.kuali.rice.kim.impl.identity.EntityDefaultInfoCacheBo@561338c6[versionNumber=<null>,principalId=<null>,principalName=<null>,entityId=0003072212,entityTypeCode=PERSON,firstName=Danny,middleName=L.,lastName=Senn,name=Senn, Danny L.,campusCode=EA,primaryDepartmentCode=EA-GRAF,employeeId=0003072212,lastUpdateTimestamp=2013-07-11 05:12:23.686,versionNumber=<null>,objectId=504370a9-00b5-442d-81b6-8f7d81263c79,newCollectionRecord=false] * The root stack trace is --> * java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("KR"."KRIM_ENTITY_CACHE_T"."PRNCPL_ID") at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207) at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1044) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3665) at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1352) at org.enhydra.jdbc.core.CorePreparedStatement.executeUpdate(CorePreparedStatement.java:102) at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source) at org.springmodules.orm.ojb.PersistenceBrokerTemplate$9.doInPersistenceBroker(PersistenceBrokerTemplate.java:246) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:141) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.store(PersistenceBrokerTemplate.java:244) at org.kuali.rice.krad.dao.impl.BusinessObjectDaoOjb.save(BusinessObjectDaoOjb.java:258) at org.kuali.rice.krad.dao.proxy.BusinessObjectDaoProxy.save(BusinessObjectDaoProxy.java:254) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.sun.proxy.$Proxy37.save(Unknown Source) at org.kuali.rice.krad.service.impl.BusinessObjectServiceImpl.save(BusinessObjectServiceImpl.java:77) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.sun.proxy.$Proxy38.save(Unknown Source) at org.kuali.rice.kim.service.impl.IdentityArchiveServiceImpl$EntityArchiveWriter$3.doInTransaction(IdentityArchiveServiceImpl.java:380) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at org.kuali.rice.kim.service.impl.IdentityArchiveServiceImpl$EntityArchiveWriter.call(IdentityArchiveServiceImpl.java:353) at org.kuali.rice.kim.service.impl.IdentityArchiveServiceImpl$PreLogCallableWrapper.call(IdentityArchiveServiceImpl.java:449) at org.kuali.rice.kim.service.impl.IdentityArchiveServiceImpl$CallableAdapter.run(IdentityArchiveServiceImpl.java:470) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) {noformat} This problem appears to be coming from the EntityArchiveWriter private class inside of the IdentityArchiveServiceImpl class. That class has a call method which inserts information into the entity cache table but it doesn't handle the case when an entity doesn't have a principal. I believe that we need to modify the code so it doesn't try to insert the information for the user into the cache if they don't have any principals associated with the entity.

    Kuali JIRA | 3 years ago | James Bennett
    java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("KR"."KRIM_ENTITY_CACHE_T"."PRNCPL_ID")

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.sql.SQLIntegrityConstraintViolationException

      ORA-01400: cannot insert NULL into ("jiradb"."AO_78C957_NOTIFICATION_HIST"."ID")

      at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.create()
    2. com.atlassian.activeobjects
      TenantAwareActiveObjects.create
      1. com.atlassian.activeobjects.internal.EntityManagedActiveObjects.create(EntityManagedActiveObjects.java:113)
      2. com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.create(TenantAwareActiveObjects.java:299)
      2 frames
    3. Java RT
      GeneratedMethodAccessor1889.invoke
      1. sun.reflect.GeneratedMethodAccessor1889.invoke(Unknown Source)
      1 frame