PicoJobs

PicoJobs

13.1k Downloads

[BUG] Unique index or primary key violation

LeonMaximal1 opened this issue ยท 4 comments

commented

Describe the bug
A clear and concise description of what the bug is.

Screenshots and Logs
[15:52:31 WARN]: Error connecting to the storage. The plugin will not work correctly.
[15:52:31 WARN]: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Unique index or primary key violation: "PUBLIC.PRIMARY_KEY_3 ON PUBLIC.JOBPLAYERS(UUID) VALUES 2"; SQL statement:
[15:52:31 WARN]: INSERT INTO jobplayers (uuid) VALUES (?) [23505-200]
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.message.DbException.getJdbcSQLException(DbException.java:459)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.message.DbException.get(DbException.java:205)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.message.DbException.get(DbException.java:181)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:103)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.mvstore.db.MVSecondaryIndex.checkUnique(MVSecondaryIndex.java:221)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.mvstore.db.MVSecondaryIndex.add(MVSecondaryIndex.java:196)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.mvstore.db.MVTable.addRow(MVTable.java:531)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.command.dml.Insert.insertRows(Insert.java:195)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.command.dml.Insert.update(Insert.java:151)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.command.CommandContainer.update(CommandContainer.java:198)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.command.Command.executeUpdate(Command.java:251)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:191)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:152)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//com.gmail.picono435.picojobs.storage.sql.file.FlatfileStorageFactory.createPlayer(FlatfileStorageFactory.java:54)
[15:52:31 WARN]: at PicoJobs-1.0-beta-5.jar//com.gmail.picono435.picojobs.api.managers.PlayersManager.lambda$getJobPlayerFromStorage$2(PlayersManager.java:102)
[15:52:31 WARN]: at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftTask.run(CraftTask.java:101)
[15:52:31 WARN]: at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57)
[15:52:31 WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[15:52:31 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[15:52:31 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[15:52:31 WARN]: at java.base/java.lang.Thread.run(Thread.java:833)

Software Details:

  • Server Software: Paper
  • Server Software Version: 1.18.1-RO.1-SNAPSHOT
  • Plugin Version: 1.0-beta-5
  • Java Version: 1.8.0_311

Additional context
Add any other context about the problem here.

commented

Hello when does this happen?

commented

each time I start the server, to each player who enters

commented

Please test in the latest development build by clicking in Actions.

commented

Fixed issue in the lastest commit, thank you for reporting it. Be free to create another issue or re-open this one if the issue persists.