com.atlassian.confluence.upgrade.UpgradeException: Upgrade task com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsUpgradeTask@c384f5 failed during the SCHEMA_UPGRADE phase due to: PreparedStatementCallback; SQL [DELETE FROM CONTENT_PERM_SET WHERE ID = ?]; Cannot delete or update a parent row: a foreign key constraint fails (`confluence40`.`content_perm`, CONSTRAINT `FKBD74B31676E33274` FOREIGN KEY (`CPS_ID`) REFERENCES `content_perm_set` (`ID`)); nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`confluence40`.`content_perm`, CONSTRAINT `FKBD74B31676E33274` FOREIGN KEY (`CPS_ID`) REFERENCES `content_perm_set` (`ID`))

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,

Check whether privilege has the "not null" restriction. If so it always has to have a value and can never be null.

A different reason could be a wrong implementation of a foreign key. Check whether you always correctly insert/update in both tables.

Solutions on the web

via Atlassian JIRA by Husein Alatas [Atlassian], 1 year ago
Upgrade task com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsUpgradeTask@c384f5 failed during the SCHEMA_UPGRADE phase due to: PreparedStatementCallback; SQL [DELETE FROM CONTENT_PERM_SET WHERE ID = ?]; Cannot delete or
via Atlassian JIRA by Sergei ZH, 1 year ago
` (`CONTENTID`)); nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`bassdb`.`ATTACHMENTS`, CONSTRAINT `FK54475F908C38FBEA` FOREIGN KEY (`PAGEID`) REFERENCES `CONTENT` (`CONTENTID`))
via Atlassian JIRA by Sergei ZH, 1 year ago
` (`CONTENTID`)); nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`bassdb`.`ATTACHMENTS`, CONSTRAINT `FK54475F908C38FBEA` FOREIGN KEY (`PAGEID`) REFERENCES `CONTENT` (`CONTENTID`))
via Atlassian JIRA by Amalia Sanusi [Atlassian], 1 year ago
Upgrade task com.atlassian.confluence.upgrade.upgradetask.ReferencedUsersUserMappingUpgradeTask@6be9ac06 failed during the SCHEMA_UPGRADE phase due to: Unable to complete user mapping creation.
via Atlassian JIRA by Jing Hwa [Atlassian], 1 year ago
Upgrade task com.atlassian.confluence.upgrade.upgradetask.DropSpaceGroupTablesUpgradeTask@27091f57 failed during the SCHEMA_UPGRADE phase due to: null
via Atlassian JIRA by Husein Alatas [Atlassian], 1 year ago
Upgrade task com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsUpgradeTask@1d849ae failed during the SCHEMA_UPGRADE phase due to: StatementCallback; uncategorized SQLException for SQL [alter table CONTENT_PERM modify CPS_ID
com.atlassian.confluence.upgrade.UpgradeException: Upgrade task com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsUpgradeTask@c384f5 failed during the SCHEMA_UPGRADE phase due to: PreparedStatementCallback; SQL [DELETE FROM CONTENT_PERM_SET WHERE ID = ?]; Cannot delete or update a parent row: a foreign key constraint fails (`confluence40`.`content_perm`, CONSTRAINT `FKBD74B31676E33274` FOREIGN KEY (`CPS_ID`) REFERENCES `content_perm_set` (`ID`)); nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`confluence40`.`content_perm`, CONSTRAINT `FKBD74B31676E33274` FOREIGN KEY (`CPS_ID`) REFERENCES `content_perm_set` (`ID`))
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1038)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3563)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3495)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2693)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2102)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2395)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2313)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2298)
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:798)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:792)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:850)
at com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsCleaner$2.processRow(ContentPermissionConstraintsCleaner.java:166)
at org.springframework.jdbc.core.JdbcTemplate$RowCallbackHandlerResultSetExtractor.extractData(JdbcTemplate.java:1368)
at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:448)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:396)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:458)
at com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsCleaner.removeDuplicateContentPermissionSetEntries(ContentPermissionConstraintsCleaner.java:177)
at com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsCleaner.cleanUp(ContentPermissionConstraintsCleaner.java:70)
at com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsCleaner$$FastClassByCGLIB$$42f4de60.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsCleaner$$EnhancerByCGLIB$$2b62c167.cleanUp()
at com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsUpgradeTask.doPreUpgradeCleanup(ContentPermissionConstraintsUpgradeTask.java:175)
at com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsUpgradeTask.doUpgrade(ContentPermissionConstraintsUpgradeTask.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at undefined.$Proxy33.doUpgrade(Unknown Source)
at com.atlassian.confluence.upgrade.AbstractUpgradeManager$UpgradeStep$3.execute(AbstractUpgradeManager.java:479)
at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeStep(AbstractUpgradeManager.java:188)
at com.atlassian.confluence.upgrade.AbstractUpgradeManager.runSchemaUpgradeTasks(AbstractUpgradeManager.java:137)
at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:94)
at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:29)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Once, 4 months ago
Once, 1 year ago
2 times, 3 months ago
7 times, 6 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.