Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upon death, inventories don't always save (for years) #9525

Open
3 tasks done
RSLuke opened this issue Mar 4, 2025 · 6 comments
Open
3 tasks done

Upon death, inventories don't always save (for years) #9525

RSLuke opened this issue Mar 4, 2025 · 6 comments
Labels
bug report Reports of bugs/inconsistencies

Comments

@RSLuke
Copy link

RSLuke commented Mar 4, 2025

Description of Issue

When players die, their inventory is supposed to be saved. However, for several years, there have been issues with this. Not all players are affected—some only have one save slot despite it being configured to 15, for instance, while others' inventories are not saved at all upon their death

Version Information

[13:13:08 INFO]: --------------------------------------------------
[13:13:08 INFO]: CMI: 9.7.8.3 Velocity CMIB  MySQL-> 9.7.10.0
[13:13:08 INFO]: CMILib: 1.5.3.4 
[13:13:08 INFO]: Server: Paper(318) 1.20.2-R0.1-SNAPSHOT-
[13:13:08 INFO]: CMI economy: Activé Vault: 1.6.10(+) CMI Chat: Activé 
[13:13:08 INFO]: Modules -> 57 enabled 10 disabled: spawnerProximity, mirror, tablist, votifier, skin, elytraBoost, spawnerCharge, namePlates, playerChatTag, bossBarCompass
[13:13:08 INFO]: --------------------------------------------------

Errors

no errors

Relevant Config Sections

inv:
  # Do you want to save the player's inventory on his death
  SaveOnDeath: true
  # When set to true, empty inventories (no items in inventory) will not be saved on players death
  IgnoreEmpty: true
  # If set to true then player should have cmi.saveinv permission node for inventory to be saved on death
  RequiresPermission: false
  # How many inventories, we will keep for each player
  SavedInventories: 20
  restore:
    # Set to false if you don't want to restore hp state on inventory load with /cmi invload command
    HP: false
    # Set to false if you don't want to restore players experience points
    XP: true
    # Set to false if you don't want to restore food state
    Food: true
    # Set to false if you don't want to restore saturation level
    Saturation: true
    # Set to false if you don't want to restore potion effects
    Potions: true
    # Set to false if you don't want to restore items
    Items: true
    # List of materials we should not save
    # Keep in mind that you might need to include all materials for colored items, like wool or shulker boxes
    BlackListedItems:
    - ''

Relevant Plugins

No response

Agreements

  • My server is supported by CMI.
  • My version of CMI at the time of this report is up to date.
  • I have searched the github and asked around before making this report.
@RSLuke RSLuke added the bug report Reports of bugs/inconsistencies label Mar 4, 2025
@RSLuke
Copy link
Author

RSLuke commented Mar 17, 2025

Update, I have this error when someone dies :

[18:57:04 WARN]: java.sql.BatchUpdateException: Field 'id' doesn't have a default value
[18:57:04 WARN]: at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224)
[18:57:04 WARN]: at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:816)
[18:57:04 WARN]: at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:418)
[18:57:04 WARN]: at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:795)
[18:57:04 WARN]: at CMI-9.7.8.3.jar//com.Zrips.CMI.Modules.DataBase.DBDAO.executeTempBatch(DBDAO.java:1008)
[18:57:04 WARN]: at CMI-9.7.8.3.jar//com.Zrips.CMI.Modules.DataBase.DBManager.saveBatch(DBManager.java:521)
[18:57:04 WARN]: at CMI-9.7.8.3.jar//com.Zrips.CMI.Modules.DataBase.DBManager$1.lambda$0(DBManager.java:347)
[18:57:04 WARN]: at CMILib1.5.3.5.jar//net.Zrips.CMILib.Version.Schedulers.CMIBukkitImpl.lambda$runTaskAsynchronously$1(CMIBukkitImpl.java:48)
[18:57:04 WARN]: at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftTask.run(CraftTask.java:101)
[18:57:04 WARN]: at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57)
[18:57:04 WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[18:57:04 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[18:57:04 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[18:57:04 WARN]: at java.base/java.lang.Thread.run(Thread.java:833)
[18:57:04 WARN]: Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
[18:57:04 WARN]: at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:130)
[18:57:04 WARN]: at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
[18:57:04 WARN]: at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:916)
[18:57:04 WARN]: at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1061)
[18:57:04 WARN]: at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:795)
[18:57:04 WARN]: ... 12 more

@Zrips
Copy link
Owner

Zrips commented Mar 18, 2025

Is there any common thing between players with bugged inventory saving? Like numeric names. And, can you initiate inventory saving manually on those who only have one or no saved inventories and their inventory isn't being saved automatically on death?

@RSLuke
Copy link
Author

RSLuke commented Mar 18, 2025

I can /invsave manually
I'm not sure there are common things between players, maybe that they arrived on the server on the past recent years. But nothing regarding names, it happens to names with or without numbers, special characters..
Old players have all their inventories kept correctly I think, up to 15 as configured

@RSLuke
Copy link
Author

RSLuke commented Mar 18, 2025

I think inventories saved that are "bugged" are removed upon a reboot

@Zrips
Copy link
Owner

Zrips commented Mar 25, 2025

Does still an issue with latest versions as it received some updates relating to inventory saving

@RSLuke
Copy link
Author

RSLuke commented Mar 26, 2025

Tested with latest release, didn't fix it

After some testing, I am now sure all saved inventories from "newer" players (probably since an old CMI release published years ago) are wiped after a server restart EVEN manually saved inventories.

I'll open a new issue for the /cmi server command not working anymore since lastest release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Reports of bugs/inconsistencies
Projects
None yet
Development

No branches or pull requests

2 participants