ChestShop-authors / ChestShop-3

ChestShop - the chest & sign shop plugin for Minecraft Servers running Bukkit/Spigot/Paper
https://dev.bukkit.org/projects/chestshop
GNU Lesser General Public License v2.1
271 stars 177 forks source link

1.15.1 - Getting [ChestShop] Unable to convert item with ID XX #285

Open DmitryRendov opened 4 years ago

DmitryRendov commented 4 years ago

Plugin Version

3.10 (build 165)

Plugin Config

Server Version

git-Paper-25 (MC: 1.15.1) (Implementing API version 1.15.1-R0.1-SNAPSHOT)

Server Log

[10:58:44] [Server thread/ERROR]: [ChestShop] Unable to convert item with ID 1i (80)
java.sql.SQLException: Unable to run update stmt on object com.Acrobot.ChestShop.Database.Item@497e630d: UPDATE `items` SET `code` = ? WHERE `id` = ?
        at com.Acrobot.ChestShop.ORMlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:25) ~[?:?]
        at com.Acrobot.ChestShop.ORMlite.stmt.mapped.MappedUpdate.update(MappedUpdate.java:129) ~[?:?]
        at com.Acrobot.ChestShop.ORMlite.stmt.StatementExecutor.update(StatementExecutor.java:472) ~[?:?]
        at com.Acrobot.ChestShop.ORMlite.dao.BaseDaoImpl.update(BaseDaoImpl.java:410) ~[?:?]
        at com.Acrobot.ChestShop.Metadata.ItemDatabase.lambda$updateMetadataVersion$0(ItemDatabase.java:102) ~[?:?]
        at com.Acrobot.ChestShop.ORMlite.stmt.StatementExecutor.doCallBatchTasks(StatementExecutor.java:649) ~[?:?]
        at com.Acrobot.ChestShop.ORMlite.stmt.StatementExecutor.doCallBatchTasks(StatementExecutor.java:619) ~[?:?]
        at com.Acrobot.ChestShop.ORMlite.stmt.StatementExecutor.callBatchTasks(StatementExecutor.java:598) ~[?:?]
        at com.Acrobot.ChestShop.ORMlite.dao.BaseDaoImpl.callBatchTasks(BaseDaoImpl.java:724) ~[?:?]
        at com.Acrobot.ChestShop.Metadata.ItemDatabase.updateMetadataVersion(ItemDatabase.java:91) ~[?:?]
        at com.Acrobot.ChestShop.Metadata.ItemDatabase.handleMetadataUpdate(ItemDatabase.java:57) ~[?:?]
        at com.Acrobot.ChestShop.Metadata.ItemDatabase.<init>(ItemDatabase.java:44) ~[?:?]
        at com.Acrobot.ChestShop.ChestShop.onEnable(ChestShop.java:119) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.15.1.jar:git-Paper-25]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:338) ~[patched_1.15.1.jar:git-Paper-25]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:420) ~[patched_1.15.1.jar:git-Paper-25]
        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugin(CraftServer.java:468) ~[patched_1.15.1.jar:git-Paper-25]
        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugins(CraftServer.java:382) ~[patched_1.15.1.jar:git-Paper-25]
        at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:481) ~[patched_1.15.1.jar:git-Paper-25]
        at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:290) ~[patched_1.15.1.jar:git-Paper-25]
        at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:884) ~[patched_1.15.1.jar:git-Paper-25]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_221]
Caused by: org.sqlite.SQLiteException: [SQLITE_CONSTRAINT]  Abort due to constraint violation (UNIQUE constraint failed: items.code)
        at org.sqlite.core.DB.newSQLException(DB.java:941) ~[patched_1.15.1.jar:git-Paper-25]
        at org.sqlite.core.DB.newSQLException(DB.java:953) ~[patched_1.15.1.jar:git-Paper-25]
        at org.sqlite.core.DB.execute(DB.java:854) ~[patched_1.15.1.jar:git-Paper-25]
        at org.sqlite.core.DB.executeUpdate(DB.java:895) ~[patched_1.15.1.jar:git-Paper-25]
        at org.sqlite.jdbc3.JDBC3PreparedStatement.executeUpdate(JDBC3PreparedStatement.java:102) ~[patched_1.15.1.jar:git-Paper-25]
        at com.Acrobot.ChestShop.ORMlite.jdbc.JdbcDatabaseConnection.update(JdbcDatabaseConnection.java:294) ~[?:?]
        at com.Acrobot.ChestShop.ORMlite.jdbc.JdbcDatabaseConnection.update(JdbcDatabaseConnection.java:217) ~[?:?]
        at com.Acrobot.ChestShop.ORMlite.stmt.mapped.MappedUpdate.update(MappedUpdate.java:101) ~[?:?]
        ... 20 more

What other plugins are you running?

AntiAFKPlus, AntiWorldDownloader, AutoMessage, BlockPluginz, BungeeTabListPlus, ChatGuard, ChestShop, ChunkSpawnerLimiter, ClearLag, DiscordSRV, dynmap, Essentials, EssentialsChat, EssentialsSpawn, FishinRoulette, GraviTree, GriefPrevention, GriefPreventionFlags, HolographicDisplays, IllegalStack, JDynmapGriefPrevention, Jobs, LagMonitor, LimitPillagers, LogBlock, LuckPerms, Matrix, Multiverse-Core, Multiverse-Portals, NoSpawnerChange, PhantomAdmin, PlaceholderAPI, PlayTime, ProtocolLib, TitleManager, TogglePvp*, Vault, VillagerOptimiser, WorldBorder, WorldEdit, WorldGuard, XrayInformer

What is happening?

Errors in the console. Admin shop is working, players - are not working.

What did you expect to happen?

Migration is succesfully users.zip items.zip

done

Additional context

DmitryRendov commented 4 years ago

The plugin seems to be working fine, sorry. Just these errors in the console when the migration is going: [10:58:44] [Server thread/INFO]: [ChestShop] Enabling ChestShop v3.10 (build 165) [10:58:44] [Server thread/INFO]: [ChestShop] Data version change detected! Previous version was 1976 [10:58:44] [Server thread/INFO]: [ChestShop] Updating Item Metadata database to data version 2227... [10:58:44] [Server thread/ERROR]: [ChestShop] Unable to convert item with ID 1i (80) low priority, thank you!

Phoenix616 commented 4 years ago

As far as I can tell that looks like an expected error. Basically you have two items in your database that have the same metadata after conversion. This might break shops that use the duplicate ID but this limitation is kinda required to make it work properly and ideally the issue would only occur on first conversion as future ones already worked based on that limitation. I guess I should add a more detailed error message to the log in such a case and see if there is maybe a way around throwing such an error there.