MyWarp

MyWarp

220k Downloads

[Bug] Plugin freaks out usinf custom aliases.

Remski01 opened this issue ยท 1 comments

commented

Description of the Problem

Plugin freaks out when using Custom Aliases, first plugin in years that does this.

Steps to Reproduce

Set an custom alias of /warpinv for /warp invite.
Invite an player to an warp using /warpinv.
Profit.

Log Output

[20:40:07 WARN]: Exception in thread "pool-74-thread-2" io.github.mywarp.mywarp.internal.jooq.exception.DataAccessException: SQL [insert into "mywarp"."warp_player_map" ("warp_id", "player_id") values ((select "mywarp"."warp"."warp_id" from "mywarp"."warp" where "mywarp"."warp"."name" = cast(? as varchar(32)) limit ?), (select "mywarp"."player"."player_id" from "mywarp"."player" where "mywarp"."player"."uuid" = cast(? as uuid) limit ?))]; (Message 23505 not found); SQL statement:
[20:40:07 WARN]: insert into "mywarp"."warp_player_map" ("warp_id", "player_id") values ((select "mywarp"."warp"."warp_id" from "mywarp"."warp" where "mywarp"."warp"."name" = cast(? as varchar(32)) limit ?), (select "mywarp"."player"."player_id" from "mywarp"."player" where "mywarp"."player"."uuid" = cast(? as uuid) limit ?)) [23505-200]
[20:40:07 WARN]:        at io.github.mywarp.mywarp.internal.jooq_3.14.4.H2.debug(Unknown Source)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.Tools.translate(Tools.java:2904)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:757)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.AbstractQuery.execute(AbstractQuery.java:389)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.AbstractDelegatingQuery.execute(AbstractDelegatingQuery.java:119)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.warp.storage.JooqWarpStorage.lambda$addPlayerInvitation$5(JooqWarpStorage.java:313)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext$3.run(DefaultDSLContext.java:615)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext$3.run(DefaultDSLContext.java:612)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext.lambda$transactionResult0$0(DefaultDSLContext.java:543)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.Tools$35$1.block(Tools.java:5215)
[20:40:07 WARN]:        at java.base/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3465)
[20:40:07 WARN]:        at java.base/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3436)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.Tools$35.get(Tools.java:5212)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext.transactionResult0(DefaultDSLContext.java:595)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext.transactionResult(DefaultDSLContext.java:512)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext.transaction(DefaultDSLContext.java:612)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.warp.storage.JooqWarpStorage.addPlayerInvitation(JooqWarpStorage.java:295)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.warp.storage.JooqWarpStorage.addInvitation(JooqWarpStorage.java:275)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.warp.storage.AsyncWritingWarpStorage.lambda$addInvitation$2(AsyncWritingWarpStorage.java:70)
[20:40:07 WARN]:        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[20:40:07 WARN]:        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[20:40:07 WARN]:        at java.base/java.lang.Thread.run(Thread.java:833)
[20:40:07 WARN]: Caused by: io.github.mywarp.mywarp.internal.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: (Message 23505 not found); SQL statement:
[20:40:07 WARN]: insert into "mywarp"."warp_player_map" ("warp_id", "player_id") values ((select "mywarp"."warp"."warp_id" from "mywarp"."warp" where "mywarp"."warp"."name" = cast(? as varchar(32)) limit ?), (select "mywarp"."player"."player_id" from "mywarp"."player" where "mywarp"."player"."uuid" = cast(? as uuid) limit ?)) [23505-200]
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.h2.message.DbException.getJdbcSQLException(DbException.java:459)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.h2.message.DbException.getJdbcSQLException(DbException.java:429)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.h2.message.DbException.get(DbException.java:205)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.h2.message.DbException.get(DbException.java:181)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:103)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.h2.mvstore.db.MVSecondaryIndex.checkUnique(MVSecondaryIndex.java:221)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.h2.mvstore.db.MVSecondaryIndex.add(MVSecondaryIndex.java:196)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.h2.mvstore.db.MVTable.addRow(MVTable.java:531)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.h2.command.dml.Insert.insertRows(Insert.java:195)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.h2.command.dml.Insert.update(Insert.java:151)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.h2.command.CommandContainer.update(CommandContainer.java:198)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.h2.command.Command.executeUpdate(Command.java:251)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:240)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.tools.jdbc.DefaultPreparedStatement.execute(DefaultPreparedStatement.java:214)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.AbstractQuery.execute(AbstractQuery.java:458)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.AbstractDMLQuery.execute(AbstractDMLQuery.java:947)
[20:40:07 WARN]:        at mywarp-bukkit-3.1.1-all.jar//io.github.mywarp.mywarp.internal.jooq.impl.AbstractQuery.execute(AbstractQuery.java:375)
[20:40:07 WARN]:        ... 18 more

Affected Version

  • MyWarp: 3.1.1+GitHub_Action-b16.git-d80ddf2ca9
  • Minecraft and Bukkit Implementation: git-Paper-196 (MC: 1.20.1)

Additional context

  • Using /warp invite normally doesnt result in this error. Regardless, it shouldnt act like this.
  • This causes the following issue too, player will be enable to re-invite the player. However, the player can use it anyways.
  • The plugin i use is MyCommand.
warpuninv:
  command: /warpuninv
  type: alias
  alias: /warp uninvite
  permission-required: false
  register: true

This is also only happening with the invite function, any other command works fine.
As example, this is an other custom alias command.

setwarp:
command: /setwarp
type: alias
alias: /warp pcreate
permission-required: false
register: true
commented

Closed because of #489, realized the function was broken, not the custom alias. (an alias should break the database... right?)