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. ,

    It was a database inconsistency issue in the integration test dataset.

Solutions on the web

via GitHub by cartman-2000
, 1 year ago
Cannot add or update a child row: a foreign key constraint fails (`mc_pex`.`pex_inheritance`, CONSTRAINT `inheritance_segment_fk` FOREIGN KEY (`segment`) REFERENCES `pex_segments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) Query is: INSERT INTO pex_inheritance (`segment`, `parent`) VALUES (?, ?)
via GitHub by schmeic
, 1 year ago
Could not read resultset: unexpected end of stream, read 0 bytes from 4 And here is the relevant portion of the stack trace:
org.mariadb.jdbc.internal.util.dao.QueryException: Cannot add or update a child row: a foreign key constraint fails (`mc_pex`.`pex_inheritance`, CONSTRAINT `inheritance_segment_fk` FOREIGN KEY (`segment`) REFERENCES `pex_segments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)
Query is: INSERT INTO pex_inheritance (`segment`, `parent`) VALUES (?, ?)	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:939)	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executePreparedQuery(AbstractQueryProtocol.java:377)	at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeInternal(MariaDbServerPreparedStatement.java:326)	at org.mariadb.jdbc.MariaDbServerPreparedStatement.execute(MariaDbServerPreparedStatement.java:304)	at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeUpdate(MariaDbServerPreparedStatement.java:293)	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)	at ninja.leaping.permissionsex.backend.sql.SqlDao.addParent(SqlDao.java:643)	at ninja.leaping.permissionsex.backend.sql.Segment.lambda$withAddedParent$9(Segment.java:166)	at ninja.leaping.permissionsex.backend.sql.Segment.doUpdates(Segment.java:199)	at ninja.leaping.permissionsex.backend.sql.SqlSubjectData.lambda$newWithUpdated$3(SqlSubjectData.java:81)	at ninja.leaping.permissionsex.backend.sql.SqlSubjectData.lambda$doUpdates$17(SqlSubjectData.java:293)	at ninja.leaping.permissionsex.backend.sql.SqlDao.executeInTransaction(SqlDao.java:224)	at ninja.leaping.permissionsex.backend.sql.SqlSubjectData.doUpdates(SqlSubjectData.java:289)	at ninja.leaping.permissionsex.backend.sql.SqlDataStore.lambda$setDataInternal$4(SqlDataStore.java:227)	at ninja.leaping.permissionsex.util.Util.lambda$asyncFailableFuture$1(Util.java:93)	at org.spongepowered.api.scheduler.Task$Builder.lambda$execute$0(Task.java:138)	at org.spongepowered.common.scheduler.SchedulerBase.lambda$startTask$0(SchedulerBase.java:177)	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)	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)