org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".

Atlassian JIRA | George Barnett | 7 years ago
  1. 0

    Foreign Key violation on upgrade from 3.0 to trunk. See https://bamboo.extranet.atlassian.com/browse/PERFENG-PERFTOMCAT6PGSQL16-783/artifact/Output-Logs/target/output.log {noformat} 2009-10-10 22:40:35,047 INFO [main] [springframework.web.context.ContextLoader] initWebApplicationContext Root WebApplicationContext: initialization completed in 14720 ms create table IMAGEDETAILS (ATTACHMENTID int8 not null, HEIGHT int4, WIDTH int4, MIMETYPE varchar(30), primary key (ATTACHMENTID)) alter table IMAGEDETAILS add constraint FKA768048734A4917E foreign key (ATTACHMENTID) references ATTACHMENTS 2009-10-10 22:40:36,155 INFO [main] [atlassian.confluence.upgrade.AbstractUpgradeManager] upgradeStarted Starting automatic upgrade of Confluence 2009-10-10 22:40:36,495 ERROR [main] [atlassian.confluence.upgrade.AbstractUpgradeManager] doUpgrade Upgrade failed: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:332) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:324) at com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:1006) at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:369) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:343) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask$1.doInTransactionWithoutResult(RemoveDuplicatePersonalInformationUpgradeTask.java:48) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask.doUpgrade(RemoveDuplicatePersonalInformationUpgradeTask.java:43) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:115) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:54) at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.upgrade(DefaultUpgradeManager.java:71) at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:27) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 2009-10-10 22:40:36,532 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". com.atlassian.confluence.upgrade.UpgradeException: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:138) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:54) at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.upgrade(DefaultUpgradeManager.java:71) at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:27) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:110) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:276) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:354) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask$1.doInTransactionWithoutResult(RemoveDuplicatePersonalInformationUpgradeTask.java:48) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask.doUpgrade(RemoveDuplicatePersonalInformationUpgradeTask.java:43) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:115) ... 18 more Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:332) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:324) at com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:1006) at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:369) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:343) ... 24 more 2009-10-10 22:40:36,536 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized 1 errors were encountered during upgrade: 2009-10-10 22:40:36,536 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized 1: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". {noformat}

    Atlassian JIRA | 7 years ago | George Barnett
    org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".
  2. 0

    Foreign Key violation on upgrade from 3.0 to trunk. See https://bamboo.extranet.atlassian.com/browse/PERFENG-PERFTOMCAT6PGSQL16-783/artifact/Output-Logs/target/output.log {noformat} 2009-10-10 22:40:35,047 INFO [main] [springframework.web.context.ContextLoader] initWebApplicationContext Root WebApplicationContext: initialization completed in 14720 ms create table IMAGEDETAILS (ATTACHMENTID int8 not null, HEIGHT int4, WIDTH int4, MIMETYPE varchar(30), primary key (ATTACHMENTID)) alter table IMAGEDETAILS add constraint FKA768048734A4917E foreign key (ATTACHMENTID) references ATTACHMENTS 2009-10-10 22:40:36,155 INFO [main] [atlassian.confluence.upgrade.AbstractUpgradeManager] upgradeStarted Starting automatic upgrade of Confluence 2009-10-10 22:40:36,495 ERROR [main] [atlassian.confluence.upgrade.AbstractUpgradeManager] doUpgrade Upgrade failed: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:332) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:324) at com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:1006) at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:369) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:343) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask$1.doInTransactionWithoutResult(RemoveDuplicatePersonalInformationUpgradeTask.java:48) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask.doUpgrade(RemoveDuplicatePersonalInformationUpgradeTask.java:43) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:115) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:54) at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.upgrade(DefaultUpgradeManager.java:71) at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:27) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 2009-10-10 22:40:36,532 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". com.atlassian.confluence.upgrade.UpgradeException: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:138) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:54) at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.upgrade(DefaultUpgradeManager.java:71) at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:27) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:110) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:276) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:354) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask$1.doInTransactionWithoutResult(RemoveDuplicatePersonalInformationUpgradeTask.java:48) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask.doUpgrade(RemoveDuplicatePersonalInformationUpgradeTask.java:43) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:115) ... 18 more Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:332) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:324) at com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:1006) at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:369) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:343) ... 24 more 2009-10-10 22:40:36,536 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized 1 errors were encountered during upgrade: 2009-10-10 22:40:36,536 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized 1: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". {noformat}

    Atlassian JIRA | 7 years ago | George Barnett
    org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".
  3. 0

    Foreign Key violation on upgrade from 3.0 to trunk. See https://bamboo.extranet.atlassian.com/browse/PERFENG-PERFTOMCAT6PGSQL16-783/artifact/Output-Logs/target/output.log {noformat} 2009-10-10 22:40:35,047 INFO [main] [springframework.web.context.ContextLoader] initWebApplicationContext Root WebApplicationContext: initialization completed in 14720 ms create table IMAGEDETAILS (ATTACHMENTID int8 not null, HEIGHT int4, WIDTH int4, MIMETYPE varchar(30), primary key (ATTACHMENTID)) alter table IMAGEDETAILS add constraint FKA768048734A4917E foreign key (ATTACHMENTID) references ATTACHMENTS 2009-10-10 22:40:36,155 INFO [main] [atlassian.confluence.upgrade.AbstractUpgradeManager] upgradeStarted Starting automatic upgrade of Confluence 2009-10-10 22:40:36,495 ERROR [main] [atlassian.confluence.upgrade.AbstractUpgradeManager] doUpgrade Upgrade failed: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:332) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:324) at com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:1006) at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:369) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:343) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask$1.doInTransactionWithoutResult(RemoveDuplicatePersonalInformationUpgradeTask.java:48) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask.doUpgrade(RemoveDuplicatePersonalInformationUpgradeTask.java:43) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:115) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:54) at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.upgrade(DefaultUpgradeManager.java:71) at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:27) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 2009-10-10 22:40:36,532 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". com.atlassian.confluence.upgrade.UpgradeException: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:138) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:54) at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.upgrade(DefaultUpgradeManager.java:71) at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:27) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:110) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:276) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:354) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask$1.doInTransactionWithoutResult(RemoveDuplicatePersonalInformationUpgradeTask.java:48) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask.doUpgrade(RemoveDuplicatePersonalInformationUpgradeTask.java:43) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:115) ... 18 more Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:332) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:324) at com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:1006) at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:369) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:343) ... 24 more 2009-10-10 22:40:36,536 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized 1 errors were encountered during upgrade: 2009-10-10 22:40:36,536 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized 1: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". {noformat}

    Atlassian JIRA | 7 years ago | George Barnett
    org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Foreign Key violation on upgrade from 3.0 to trunk. See https://bamboo.extranet.atlassian.com/browse/PERFENG-PERFTOMCAT6PGSQL16-783/artifact/Output-Logs/target/output.log {noformat} 2009-10-10 22:40:35,047 INFO [main] [springframework.web.context.ContextLoader] initWebApplicationContext Root WebApplicationContext: initialization completed in 14720 ms create table IMAGEDETAILS (ATTACHMENTID int8 not null, HEIGHT int4, WIDTH int4, MIMETYPE varchar(30), primary key (ATTACHMENTID)) alter table IMAGEDETAILS add constraint FKA768048734A4917E foreign key (ATTACHMENTID) references ATTACHMENTS 2009-10-10 22:40:36,155 INFO [main] [atlassian.confluence.upgrade.AbstractUpgradeManager] upgradeStarted Starting automatic upgrade of Confluence 2009-10-10 22:40:36,495 ERROR [main] [atlassian.confluence.upgrade.AbstractUpgradeManager] doUpgrade Upgrade failed: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:332) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:324) at com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:1006) at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:369) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:343) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask$1.doInTransactionWithoutResult(RemoveDuplicatePersonalInformationUpgradeTask.java:48) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask.doUpgrade(RemoveDuplicatePersonalInformationUpgradeTask.java:43) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:115) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:54) at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.upgrade(DefaultUpgradeManager.java:71) at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:27) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 2009-10-10 22:40:36,532 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". com.atlassian.confluence.upgrade.UpgradeException: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:138) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:54) at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.upgrade(DefaultUpgradeManager.java:71) at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:27) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:110) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:276) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:354) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask$1.doInTransactionWithoutResult(RemoveDuplicatePersonalInformationUpgradeTask.java:48) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127) at com.atlassian.confluence.upgrade.upgradetask.RemoveDuplicatePersonalInformationUpgradeTask.doUpgrade(RemoveDuplicatePersonalInformationUpgradeTask.java:43) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:115) ... 18 more Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:332) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:324) at com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:1006) at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:369) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:343) ... 24 more 2009-10-10 22:40:36,536 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized 1 errors were encountered during upgrade: 2009-10-10 22:40:36,536 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized 1: StatementCallback; SQL [DELETE from CONTENT where CONTENTTYPE = 'USERINFO' and (CONTENTID not in (select min(c1.CONTENTID) from CONTENT c1 where c1.CONTENTTYPE = 'USERINFO' group by c1.USERNAME) or USERNAME is null)]; ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent". {noformat}

    Atlassian JIRA | 7 years ago | George Barnett
    org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".
  6. 0

    [CONF-12735] Drafts: Foreign key exception on saving page - Atlassian JIRA

    atlassian.com | 1 year ago
    org.postgresql.util.PSQLException: ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1664222305) is still referenced from table "bodycontent".

    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. org.postgresql.util.PSQLException

      ERROR: update or delete on table "content" violates foreign key constraint "fka898d4778dd41734" on table "bodycontent" Detail: Key (contentid)=(1420) is still referenced from table "bodycontent".

      at com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade()
    2. com.atlassian.confluence
      UpgradeLauncherServletContextListener.contextInitialized
      1. com.atlassian.confluence.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:138)
      2. com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:54)
      3. com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.upgrade(DefaultUpgradeManager.java:71)
      4. com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:27)
      4 frames
    3. Glassfish Core
      Catalina.start
      1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830)
      2. org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
      3. org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      4. org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
      5. org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      6. org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
      7. org.apache.catalina.core.StandardService.start(StandardService.java:516)
      8. org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
      9. org.apache.catalina.startup.Catalina.start(Catalina.java:566)
      9 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    5. Glassfish Core
      Bootstrap.main
      1. org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
      2. org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
      2 frames