Skip to content

Error loading backup: Field 'user_id' doesn't have a default value #367

Open
@earlhsjks

Description

@earlhsjks

Server software and version

Paper 1.21.4

Expected behavior

  • The plugin should load the backup data fully and restore player skills/stats without SQL exceptions.

  • All necessary fields (like user_id) should be populated automatically from either:

    • The backup data,
    • A default value set in the table schema,
    • Or handled gracefully by the plugin to prevent failure.

Actual behavior

  • The plugin attempts to insert/update a database record without supplying a value for user_id.
  • The SQL query fails because the table enforces that user_id must not be null and has no default value.
  • The backup fails to load entirely as a result.

How to reproduce

  1. Use AuraSkills v2.3.2 on a Bukkit-based Minecraft server.
  2. Set up SQL storage for the plugin (MySQL).
  3. Run the command:
    /skills backup load <backup_file>
  4. Watch the console/logs for the error.

Additional information

[04:51:43 INFO]: [Skills] Error loading backup: Field 'user_id' doesn't have a default value
[04:51:43 WARN]: java.sql.SQLException: Field 'user_id' doesn't have a default value
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:121)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:114)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:988)
	...
	at AuraSkills-2.3.2.jar//dev.aurelium.auraskills.common.storage.sql.SqlStorageProvider.applyState(SqlStorageProvider.java:226)
	at AuraSkills-2.3.2.jar//dev.aurelium.auraskills.common.storage.backup.BackupProvider.loadV2(BackupProvider.java:167)
	at AuraSkills-2.3.2.jar//dev.aurelium.auraskills.common.storage.backup.BackupProvider.loadBackup(BackupProvider.java:114)

Link to Full Log:
https://mclo.gs/iWHMgiX

Agreements

Metadata

Metadata

Assignees

Labels

bugSomething is not working as intended

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions