PermissionsEx

PermissionsEx

14M Downloads

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

cartman-2000 opened this issue ยท 1 comments

commented

Trying to set a group to a player, instead of using remove/add will give a Foreign key error when it is ran. MySQL is being used at the backend.

version info:
pex sponge build 140
MySQL 5.5.40.

[13:45:16] [Server thread/INFO] [io.github.hsyyid.essentialcmds]: [Server] executed command pex user cartman2000 parent set group admin
[13:45:16] [pool-3-thread-3/INFO]: Error (BatchUpdateException) occurred while performing command task! Please see console for details: 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 (?, ?)
[13:45:16] [pool-3-thread-3/ERROR] [ninja.leaping.permissionsex]: Error occurred while executing command for user Server
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 (?, ?)
        at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeInternal(MariaDbServerPreparedStatement.java:340) ~[MariaDbServerPreparedStatement.class:1.10.2-2052-5.0.0-BETA-1670]
        at org.mariadb.jdbc.MariaDbServerPreparedStatement.execute(MariaDbServerPreparedStatement.java:304) ~[MariaDbServerPreparedStatement.class:1.10.2-2052-5.0.0-BETA-1670]
        at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeUpdate(MariaDbServerPreparedStatement.java:293) ~[MariaDbServerPreparedStatement.class:1.10.2-2052-5.0.0-BETA-1670]
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[ProxyPreparedStatement.class:1.10.2-2052-5.0.0-BETA-1670]
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[HikariProxyPreparedStatement.class:1.10.2-2052-5.0.0-BETA-1670]
        at ninja.leaping.permissionsex.backend.sql.SqlDao.addParent(SqlDao.java:643) ~[SqlDao.class:?]
        at ninja.leaping.permissionsex.backend.sql.Segment.lambda$withAddedParent$9(Segment.java:166) ~[Segment.class:?]
        at ninja.leaping.permissionsex.backend.sql.Segment.doUpdates(Segment.java:199) ~[Segment.class:?]
        at ninja.leaping.permissionsex.backend.sql.SqlSubjectData.lambda$newWithUpdated$3(SqlSubjectData.java:81) ~[SqlSubjectData.class:?]
        at ninja.leaping.permissionsex.backend.sql.SqlSubjectData.lambda$doUpdates$17(SqlSubjectData.java:293) ~[SqlSubjectData.class:?]
        at ninja.leaping.permissionsex.backend.sql.SqlDao.executeInTransaction(SqlDao.java:224) ~[SqlDao.class:?]
        at ninja.leaping.permissionsex.backend.sql.SqlSubjectData.doUpdates(SqlSubjectData.java:289) ~[SqlSubjectData.class:?]
        at ninja.leaping.permissionsex.backend.sql.SqlDataStore.lambda$setDataInternal$4(SqlDataStore.java:227) ~[SqlDataStore.class:?]
        at ninja.leaping.permissionsex.util.Util.lambda$asyncFailableFuture$1(Util.java:93) ~[Util.class:?]
        at org.spongepowered.api.scheduler.Task$Builder.lambda$execute$0(Task.java:138) ~[Task$Builder.class:1.10.2-2052-5.0.0-BETA-1670]
        at org.spongepowered.common.scheduler.SchedulerBase.lambda$startTask$0(SchedulerBase.java:177) ~[SchedulerBase.class:1.10.2-2052-5.0.0-BETA-1670]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_91]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_91]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_91]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_91]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]
Caused by: java.sql.SQLIntegrityConstraintViolationException: 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.util.ExceptionMapper.get(ExceptionMapper.java:119) ~[ExceptionMapper.class:1.10.2-2052-5.0.0-BETA-1670]
        at org.mariadb.jdbc.internal.util.ExceptionMapper.throwException(ExceptionMapper.java:69) ~[ExceptionMapper.class:1.10.2-2052-5.0.0-BETA-1670]
        at org.mariadb.jdbc.MariaDbStatement.executeQueryEpilog(MariaDbStatement.java:242) ~[MariaDbStatement.class:1.10.2-2052-5.0.0-BETA-1670]
        at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeInternal(MariaDbServerPreparedStatement.java:336) ~[MariaDbServerPreparedStatement.class:1.10.2-2052-5.0.0-BETA-1670]
        ... 20 more
Caused by: 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) ~[AbstractQueryProtocol.class:1.10.2-2052-5.0.0-BETA-1670]
        at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executePreparedQuery(AbstractQueryProtocol.java:377) ~[AbstractQueryProtocol.class:1.10.2-2052-5.0.0-BETA-1670]
        at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeInternal(MariaDbServerPreparedStatement.java:326) ~[MariaDbServerPreparedStatement.class:1.10.2-2052-5.0.0-BETA-1670]
        ... 20 more
>
commented

Unfortunately PermissionsEx is currently unmaintained and no further updates are planned. Because of this, all pull requests are being closed. If you are looking for an actively maintained permissions plugin, take a look at LuckPerms. It is compatible with major server platforms and can import data from PEX.