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

  1. ,

    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.

  2. ,

    Nothing is wrong with the database. When it gives you those errors, it's telling you that you are trying to input "nothing" (null) into a column that doesn't allow it. Fix it by removing the not null constraint or by passing a value to that field.

Solutions on the web

via Atlassian JIRA by Sergei ZH, 1 year ago
, ATTACHMENT_COMMENT, ATTVERSION, PREVVER from ATTACHMENTS where ATTACHMENTID = ?]; Cannot add or update a child row: a foreign key constraint fails (`bassdb`.`ATTACHMENTS`, CONSTRAINT `FK54475F908C38FBEA` FOREIGN KEY (`PAGEID`) REFERENCES `CONTENT
via Atlassian JIRA by Sergei ZH, 2 years ago
, ATTACHMENT_COMMENT, ATTVERSION, PREVVER from ATTACHMENTS where ATTACHMENTID = ?]; Cannot add or update a child row: a foreign key constraint fails (`bassdb`.`ATTACHMENTS`, CONSTRAINT `FK54475F908C38FBEA` FOREIGN KEY (`PAGEID`) REFERENCES `CONTENT
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 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
com.atlassian.confluence.upgrade.UpgradeException: Upgrade task com.atlassian.confluence.upgrade.upgradetask.attachmentceo.AttachmentToCeoConversionUpgradeTask@5e822356 failed during the SCHEMA_UPGRADE phase due to: PreparedStatementCallback; SQL [insert into ATTACHMENTS(ATTACHMENTID, TITLE, CONTENTTYPE, PAGEID, CREATOR, CREATIONDATE, LASTMODIFIER, LASTMODDATE, FILESIZE, MINOR_EDIT, ATTACHMENT_COMMENT, ATTVERSION, PREVVER)select ? as ATTACHMENTID, TITLE, CONTENTTYPE, PAGEID, CREATOR, CREATIONDATE, LASTMODIFIER, LASTMODDATE, FILESIZE, MINOR_EDIT, ATTACHMENT_COMMENT, ATTVERSION, PREVVER from ATTACHMENTS where ATTACHMENTID = ?]; Cannot add or update a child row: a foreign key constraint fails (`bassdb`.`ATTACHMENTS`, CONSTRAINT `FK54475F908C38FBEA` FOREIGN KEY (`PAGEID`) REFERENCES `CONTENT` (`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`)) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeStep(AbstractUpgradeManager.java:273) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.runSchemaUpgradeTasks(AbstractUpgradeManager.java:217) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:169) at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:51) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5528) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)Caused by: org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [insert into ATTACHMENTS(ATTACHMENTID, TITLE, CONTENTTYPE, PAGEID, CREATOR, CREATIONDATE, LASTMODIFIER, LASTMODDATE, FILESIZE, MINOR_EDIT, ATTACHMENT_COMMENT, ATTVERSION, PREVVER)select ? as ATTACHMENTID, TITLE, CONTENTTYPE, PAGEID, CREATOR, CREATIONDATE, LASTMODIFIER, LASTMODDATE, FILESIZE, MINOR_EDIT, ATTACHMENT_COMMENT, ATTVERSION, PREVVER from ATTACHMENTS where ATTACHMENTID = ?]; Cannot add or update a child row: a foreign key constraint fails (`bassdb`.`ATTACHMENTS`, CONSTRAINT `FK54475F908C38FBEA` FOREIGN KEY (`PAGEID`) REFERENCES `CONTENT` (`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`)) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:228) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:792) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:850) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:858) at com.atlassian.confluence.upgrade.upgradetask.attachmentceo.AttachmentIdClashResolver.cloneAttachmentWithNewId(AttachmentIdClashResolver.java:221) at com.atlassian.confluence.upgrade.upgradetask.attachmentceo.AttachmentIdClashResolver.remapAttachmentIds(AttachmentIdClashResolver.java:157) at com.atlassian.confluence.upgrade.upgradetask.attachmentceo.AttachmentIdClashResolver.resolveAttachmentIdClashes(AttachmentIdClashResolver.java:113) at com.atlassian.confluence.upgrade.upgradetask.attachmentceo.AttachmentToCeoConversionUpgradeTask.doUpgrade(AttachmentToCeoConversionUpgradeTask.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.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:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy29.doUpgrade(Unknown Source) at com.atlassian.confluence.upgrade.AbstractUpgradeManager$UpgradeStep$3.execute(AbstractUpgradeManager.java:761) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeTask(AbstractUpgradeManager.java:293) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeStep(AbstractUpgradeManager.java:264) ... 12 moreCaused by: 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`)) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.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 com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:798) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591) ... 33 more