TechnicallyCoded / Inventory-Rollback-Plus

Spigot/Bukkit plugin that allows server moderators to restore player items and data from backups.
https://www.spigotmc.org/resources/85811/
Other
78 stars 44 forks source link

Bug report: [Back Ups Aren't Saving] #27

Closed nicholasveronico closed 3 years ago

nicholasveronico commented 3 years ago

Bug description:

Whenever a player joins, quits, etc. or when I try to force save a player, I get the following error:

[11:33:00 WARN]: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'ender_chest' at row 1
[11:33:00 WARN]:        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3931)
[11:33:00 WARN]:        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3869)
[11:33:00 WARN]:        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
[11:33:00 WARN]:        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2675)
[11:33:00 WARN]:        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465)
[11:33:00 WARN]:        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1915)
[11:33:00 WARN]:        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2136)
[11:33:00 WARN]:        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2070)
[11:33:00 WARN]:        at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5187)
[11:33:00 WARN]:        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2055)
[11:33:00 WARN]:        at me.danjono.inventoryrollback.data.MySQL.saveData(MySQL.java:425)
[11:33:00 WARN]:        at me.danjono.inventoryrollback.data.PlayerData.lambda$saveData$0(PlayerData.java:407)
[11:33:00 WARN]:        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:99)
[11:33:00 WARN]:        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:58)
[11:33:00 WARN]:        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[11:33:00 WARN]:        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[11:33:00 WARN]:        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[11:33:00 WARN]:        at java.base/java.lang.Thread.run(Thread.java:831)

Server details:

How to reproduce:

A player having an ender chest filled with all shulkers, which causes a sql error in the console whenever they leave, join, die or they are force saved.

What was expected:

I expect there not to be a sql error and for the inventories, as well as the ender chests to be saved when the player leaves, joins, dies, or is force saved.

Screenshots, logs & other:

https://pastebin.com/BjJHj4Fd

Additional info:

N/A

TechnicallyCoded commented 3 years ago

Can you log into your database and send me the table structure that you are currently using for the rollbacks?

nicholasveronico commented 3 years ago

Can you log into your database and send me the table structure that you are currently using for the rollbacks?

Is this what you mean? Capture

TechnicallyCoded commented 3 years ago

Yes, that is almost it. I need the structure of one of the tables. Like for example, backup_deaths. Once viewing the table, click on this tab and show me what you see there. image

nicholasveronico commented 3 years ago

Yes, that is almost it. I need the structure of one of the tables. Like for example, backup_deaths. Once viewing the table, click on this tab and show me what you see there. image

Oh my bad. Here's all of them: Force Backups backup_force_backups Joins backup_joins Quits backup_quits World Changes backup_world_changes Deaths backup_deaths

TechnicallyCoded commented 3 years ago

Yes, this is what I guessed hence why I asked for the table structure: you have been using the plugin since before the latest update which fixed this potential issue. The inventory saves now use LONGTEXT instead of TEXT when creating a table. (reference commit: https://github.com/TechnicallyCoded/Inventory-Rollback-Plus/commit/e65f1e2181e25e28203938e597fc4dfa67eef1ca).

If you know how to modify table structures you can switch them over. Otherwise, makes sure you have a backup of all important data and you can delete the tables for the IRP plugin. Upon creation you should see that the main_inv, armour, ender_chest, etc.. are now LONGTEXT.

nicholasveronico commented 3 years ago

Yes, this is what I guessed hence why I asked for the table structure: you have been using the plugin since before the latest update which fixed this potential issue. The inventory saves now use LONGTEXT instead of TEXT when creating a table. (reference commit: e65f1e2).

If you know how to modify table structures you can switch them over. Otherwise, makes sure you have a backup of all important data and you can delete the tables for the IRP plugin. Upon creation you should see that the main_inv, armour, ender_chest, etc.. are now LONGTEXT.

Alright I have altered the tables and I think that fixed it. I should also mention that my backups still save with the GMT timezone when I have it set to EST in the config. Any idea why?

TechnicallyCoded commented 3 years ago

All backups should save using universal unix timestamps. However, when displaying the time to the user, it should translate that. Make sure there is no mention of defaulting back to GMT in your log file. (Search for GMT in latest.log)

nicholasveronico commented 3 years ago

Getting this in the logs:

[07:59:43] [Server thread/WARN]: [InventoryRollbackPlus] Time zone ID "EST" in config.yml is not valid. Defaulting to "GMT"

Edit: Didn't realize it was GMT+/-# for the timezone. Figured it out now. Thanks so much for all the help! :)

srnyx commented 3 years ago

Didn't realize it was GMT+/-# for the timezone

I think this should be made more clear (maybe a little note in the config). @TechnicallyCoded