java.sql.BatchUpdateException: 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 (?, ?)

GitHub | cartman-2000 | 7 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    [Sponge SQL] Foreign key error on using set group.

    GitHub | 7 months ago | cartman-2000
    java.sql.BatchUpdateException: 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 (?, ?)
  2. 0

    Oops, cannot start the serve. / ERROR executing DML bindLog[] error[CONSTRAINT...

    GitHub | 3 months ago | enchantor
    javax.persistence.PersistenceException: ERROR executing DML bindLog[] error[CONSTRAINT 'ck_n4user_state' failed for 'yona'.'n4user']
  3. 0

    Exceceptions seen when instances are started.

    GitHub | 1 year ago | sangeethah
    org.jooq.exception.DataAccessException: SQL [update `config_item_status` set `config_item_status`.`requested_version` = (`config_item_status`.`requested_version` + ?), `config_item_status`.`requested_updated` = ? where (`config_item_status`.`name` = ? and `config_item_status`.`resource_type` = ? and `config_item_status`.`resource_id` = ?)]; Deadlock found when trying to get lock; try restarting transaction
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    "Deadlock found when trying to get lock; try restarting transaction" seen in logs.

    GitHub | 12 months ago | sangeethah
    org.jooq.exception.DataAccessException: SQL [update `host` set `host`.`data` = ? where `host`.`id` = ?]; Deadlock found when trying to get lock; try restarting transaction
  6. 0

    Deadlock found when trying to get lock; try restarting transaction errors found when trying to update hosts.

    GitHub | 12 months ago | sangeethah
    org.jooq.exception.DataAccessException: SQL [update `host` set `host`.`data` = ? where `host`.`id` = ?]; Deadlock found when trying to get lock; try restarting transaction
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.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()
  2. org.mariadb.jdbc
    AbstractQueryProtocol.executePreparedQuery
    1. org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:939)[AbstractQueryProtocol.class:1.10.2-2052-5.0.0-BETA-1670]
    2. org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executePreparedQuery(AbstractQueryProtocol.java:377)[AbstractQueryProtocol.class:1.10.2-2052-5.0.0-BETA-1670]
    2 frames
  3. mariadb-java-client
    MariaDbServerPreparedStatement.executeUpdate
    1. org.mariadb.jdbc.MariaDbServerPreparedStatement.executeInternal(MariaDbServerPreparedStatement.java:326)[MariaDbServerPreparedStatement.class:1.10.2-2052-5.0.0-BETA-1670]
    2. org.mariadb.jdbc.MariaDbServerPreparedStatement.execute(MariaDbServerPreparedStatement.java:304)[MariaDbServerPreparedStatement.class:1.10.2-2052-5.0.0-BETA-1670]
    3. org.mariadb.jdbc.MariaDbServerPreparedStatement.executeUpdate(MariaDbServerPreparedStatement.java:293)[MariaDbServerPreparedStatement.class:1.10.2-2052-5.0.0-BETA-1670]
    3 frames
  4. HikariCP-java6
    HikariProxyPreparedStatement.executeUpdate
    1. com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)[ProxyPreparedStatement.class:1.10.2-2052-5.0.0-BETA-1670]
    2. com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)[HikariProxyPreparedStatement.class:1.10.2-2052-5.0.0-BETA-1670]
    2 frames
  5. ninja.leaping.permissionsex
    Util.lambda$asyncFailableFuture$1
    1. ninja.leaping.permissionsex.backend.sql.SqlDao.addParent(SqlDao.java:643)[SqlDao.class:?]
    2. ninja.leaping.permissionsex.backend.sql.Segment.lambda$withAddedParent$9(Segment.java:166)[Segment.class:?]
    3. ninja.leaping.permissionsex.backend.sql.Segment.doUpdates(Segment.java:199)[Segment.class:?]
    4. ninja.leaping.permissionsex.backend.sql.SqlSubjectData.lambda$newWithUpdated$3(SqlSubjectData.java:81)[SqlSubjectData.class:?]
    5. ninja.leaping.permissionsex.backend.sql.SqlSubjectData.lambda$doUpdates$17(SqlSubjectData.java:293)[SqlSubjectData.class:?]
    6. ninja.leaping.permissionsex.backend.sql.SqlDao.executeInTransaction(SqlDao.java:224)[SqlDao.class:?]
    7. ninja.leaping.permissionsex.backend.sql.SqlSubjectData.doUpdates(SqlSubjectData.java:289)[SqlSubjectData.class:?]
    8. ninja.leaping.permissionsex.backend.sql.SqlDataStore.lambda$setDataInternal$4(SqlDataStore.java:227)[SqlDataStore.class:?]
    9. ninja.leaping.permissionsex.util.Util.lambda$asyncFailableFuture$1(Util.java:93)[Util.class:?]
    9 frames
  6. org.spongepowered.api
    Task$Builder.lambda$execute$0
    1. org.spongepowered.api.scheduler.Task$Builder.lambda$execute$0(Task.java:138)[Task$Builder.class:1.10.2-2052-5.0.0-BETA-1670]
    1 frame
  7. org.spongepowered.common
    SchedulerBase.lambda$startTask$0
    1. org.spongepowered.common.scheduler.SchedulerBase.lambda$startTask$0(SchedulerBase.java:177)[SchedulerBase.class:1.10.2-2052-5.0.0-BETA-1670]
    1 frame
  8. Java RT
    Thread.run
    1. java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)[?:1.8.0_91]
    2. java.util.concurrent.FutureTask.run(Unknown Source)[?:1.8.0_91]
    3. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)[?:1.8.0_91]
    4. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)[?:1.8.0_91]
    5. java.lang.Thread.run(Unknown Source)[?:1.8.0_91]
    5 frames