Zrips / CMI

117 stars 99 forks source link

SQLSyntaxErrorException - CMI will not create the tables in MySQL #6554

Open Baktus79 opened 2 years ago

Baktus79 commented 2 years ago

Description of issue: When starting up for the first time, CMI will not create the tables in MySQL.


ERROR:

[07:59:34] [Server thread/INFO]: ------------------------------------
[07:59:34] [Server thread/INFO]: [CMI] Enabling CMI v9.1.0.5
[07:59:34] [Server thread/INFO]: ┏━━━┓ ┏━┓┏━┓ ┏━━┓
[07:59:34] [Server thread/INFO]: ┃┏━┓┃ ┃ ┗┛ ┃ ┗┫┣┛
[07:59:34] [Server thread/INFO]: ┃┃ ┗┛ ┃┏┓┏┓┃  ┃┃ 
[07:59:34] [Server thread/INFO]: ┃┃ ┏┓ ┃┃┃┃┃┃  ┃┃ 
[07:59:34] [Server thread/INFO]: ┃┗━┛┃ ┃┃┃┃┃┃ ┏┫┣┓
[07:59:34] [Server thread/INFO]: ┗━━━┛ ┗┛┗┛┗┛ ┗━━┛
[07:59:34] [Server thread/INFO]: _______________________________________________________
[07:59:34] [Server thread/INFO]:   Integrating PaperSpigot async methods
[07:59:34] [Server thread/INFO]:   Citizens found.
[07:59:34] [Server thread/INFO]:   56 Enabled and 0 Disabled modules
[07:59:34] [Server thread/INFO]:   Votifier found. Enabling vote listeners
[07:59:34] [Server thread/INFO]:   Permission plugin: LuckPerms5.3.98
[07:59:34] [Server thread/INFO]:   Initialized Cipher256 AES
[07:59:34] [Server thread/INFO]:   Loaded (59) regular alias into memory. Took 18ms
[07:59:34] [Server thread/INFO]:   Loaded (1) custom text's into memory. Took 0ms
[07:59:34] [Server thread/INFO]:   Detected Java17+35-Ubuntu-120
[07:59:34] [Server thread/INFO]:   8.0.27-0ubuntu0.20.04.1 data base type detected
[07:59:34] [Server thread/INFO]:   Started MySQL data base. Took 242ms
[07:59:34] [Server thread/INFO]: [CMI] Vault was found but economy engine is missing. Use one from list provided in https://dev.bukkit.org/bukkit-plugins/vault/
[07:59:34] [Server thread/INFO]: [CMI] Alternatively you can enable CMI economy in config.yml file
[07:59:34] [Server thread/INFO]:   Vault was found but not economy plugin, you will have limited economy support
[07:59:34] [Server thread/INFO]:   Loaded (5) warning categories into memory. Took 0ms
[07:59:34] [Server thread/INFO]:   Loaded (3) warning commands into memory. Took 0ms
[07:59:34] [Server thread/INFO]:   Loaded (138) custom mob heads into memory. Took 8ms
[07:59:34] [Server thread/INFO]:   Loaded (0) cooldowns into memory. Took 12ms
[07:59:34] [Server thread/INFO]:   Enabling BungeeCord Support
[07:59:34] [Server thread/INFO]:   Initializing BungeeCord
[07:59:34] [Server thread/INFO]:   Loaded (5) kits into memory. Took 9ms
[07:59:34] [Server thread/INFO]:   Loaded (7) ranks into memory. Took 6ms
[07:59:34] [Server thread/INFO]:   Loaded (8) playtime rewards into memory. Took 1ms
[07:59:34] [Server thread/WARN]: java.sql.SQLSyntaxErrorException: Table 'vest118.CMI_users' doesn't exist
[07:59:34] [Server thread/WARN]:    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
[07:59:34] [Server thread/WARN]:    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
[07:59:34] [Server thread/WARN]:    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
[07:59:34] [Server thread/WARN]:    at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1009)
[07:59:34] [Server thread/WARN]:    at CMI9.1.0.5.jar//com.Zrips.CMI.Modules.DataBase.DBDAO.loadAllUsers(DBDAO.java:1211)
[07:59:34] [Server thread/WARN]:    at CMI9.1.0.5.jar//com.Zrips.CMI.PlayerManager.loadData(PlayerManager.java:587)
[07:59:34] [Server thread/WARN]:    at CMI9.1.0.5.jar//com.Zrips.CMI.CMI.onEnable(CMI.java:1516)
[07:59:34] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264)
[07:59:34] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370)
[07:59:34] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500)
[07:59:34] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:564)
[07:59:34] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:478)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:727)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:503)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:313)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1202)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317)
[07:59:34] [Server thread/WARN]:    at java.base/java.lang.Thread.run(Thread.java:833)
[07:59:34] [Server thread/INFO]:   Loaded (0) player data into memory. Took 1ms
[07:59:34] [Server thread/WARN]: java.sql.SQLSyntaxErrorException: Table 'vest118.CMI_playtime' doesn't exist
[07:59:34] [Server thread/WARN]:    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
[07:59:34] [Server thread/WARN]:    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
[07:59:34] [Server thread/WARN]:    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
[07:59:34] [Server thread/WARN]:    at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1009)
[07:59:34] [Server thread/WARN]:    at CMI9.1.0.5.jar//com.Zrips.CMI.Modules.DataBase.DBDAO.loadPlayTimes(DBDAO.java:1235)
[07:59:34] [Server thread/WARN]:    at CMI9.1.0.5.jar//com.Zrips.CMI.PlayerManager.loadData(PlayerManager.java:610)
[07:59:34] [Server thread/WARN]:    at CMI9.1.0.5.jar//com.Zrips.CMI.CMI.onEnable(CMI.java:1516)
[07:59:34] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264)
[07:59:34] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370)
[07:59:34] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500)
[07:59:34] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:564)
[07:59:34] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:478)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:727)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:503)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:313)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1202)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317)
[07:59:34] [Server thread/WARN]:    at java.base/java.lang.Thread.run(Thread.java:833)
[07:59:34] [Server thread/WARN]: java.sql.SQLSyntaxErrorException: Table 'vest118.CMI_playtimereward' doesn't exist
[07:59:34] [Server thread/WARN]:    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
[07:59:34] [Server thread/WARN]:    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
[07:59:34] [Server thread/WARN]:    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
[07:59:34] [Server thread/WARN]:    at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1009)
[07:59:34] [Server thread/WARN]:    at CMI9.1.0.5.jar//com.Zrips.CMI.Modules.DataBase.DBDAO.loadPlayerPlayTimeRewards(DBDAO.java:1369)
[07:59:34] [Server thread/WARN]:    at CMI9.1.0.5.jar//com.Zrips.CMI.PlayerManager.loadData(PlayerManager.java:611)
[07:59:34] [Server thread/WARN]:    at CMI9.1.0.5.jar//com.Zrips.CMI.CMI.onEnable(CMI.java:1516)
[07:59:34] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264)
[07:59:34] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370)
[07:59:34] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500)
[07:59:34] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:564)
[07:59:34] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:478)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:727)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:503)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:313)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1202)
[07:59:34] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317)
[07:59:34] [Server thread/WARN]:    at java.base/java.lang.Thread.run(Thread.java:833)
[07:59:34] [Server thread/INFO]:   Loaded (0) custom alias into memory. Took 1ms
[07:59:35] [Server thread/INFO]:   Registered events. Took 65ms
[07:59:35] [Server thread/INFO]:   Loaded (0) event action commands into memory. Took 2ms
[07:59:35] [Server thread/INFO]:   Updated (EN) language file. Took 65ms
[07:59:35] [Server thread/INFO]:   Loaded (245) worth values into memory. Took 24ms
[07:59:35] [Server thread/INFO]: [PlaceholderAPI] Successfully registered expansion: cmi [9.1.0.5]
[07:59:35] [Server thread/INFO]:   PlaceholderAPI hooked.
[07:59:35] [Server thread/INFO]:   PlaceholderAPI was found - Enabling capabilities.
[07:59:35] [Server thread/INFO]:   McMMO was found - Enabling capabilities.
[07:59:35] [Server thread/INFO]:   Jobs was found - Enabling capabilities.
[07:59:35] [Server thread/INFO]:   Starting world timer.
[07:59:35] [Server thread/INFO]:   Initializing world manager.
[07:59:35] [Server thread/INFO]:   Loaded (5) schedules into memory. Took 3ms
[07:59:35] [Server thread/INFO]:   Loaded GeoIP
[07:59:35] [Server thread/INFO]:   Loaded (0) skin cache entries into memory. Took 0ms
[07:59:35] [Server thread/INFO]:   Found DiscordSRV
[07:59:35] [Server thread/INFO]: [DiscordSRV] API listener com.Zrips.CMI.Modules.DiscordSRV.DiscordSRVListener subscribed (4 methods)
[07:59:35] [Server thread/INFO]:   Version 9.1.0.5 has been enabled
[07:59:35] [Server thread/INFO]: ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

CONFIG SECTION:

storage:
  # storage method, can be MySQL or sqlite
  # ATTENTION! DON'T USE SAME DATABASE TABLES FOR MORE THEN ONE SERVER, YOU WILL HAVE UNEXPECTED ISSUES. EACH SERVER SHOULD HAVE ITS OWN DATABASE TABLE SETUP
  method: MySQL
mysql:
  # Requires Mysql.
  username: Secret
  password: Secret
  hostname: localhost:3306
  database: vest118
  # Valid characters are a-z 0-9 and _
  tablePrefix: CMI_
  # If you have no clue what these values do, then keep it at default values
  autoReconnect: true
  useSSL: false
  verifyServerCertificate: false
# Auto save interval in seconds
# This will define how often to write down data into data base
# Save operation will not be performed if there is no changes to save
# !ATTENTION! Keep it in low numbers, around 60 seconds
# Minimal interval is 10 seconds
AutoSaveInterval: 15
# Player data will be recorded straight after he logs out, without any delay
ForceSaveOnLogOut: false
# EXPERIMENTAL. This is not fully tested yet and some minor issues can happen when ussing on bungee network
# Player data will be loaded from database each time player joins server
# When its set to false then precached data will be uses which is more efficient
ForceLoadOnLogIn: false

Cmi Version (using/cmi version): 9.1.0.5

Server Type (Spigot/Paperspigot/etc): Paper

Server Version (using /ver): Paper-144 (MC: 1.18.1)

TheNylox commented 2 years ago

Had the same problem. Solved by using an old cmi database and truncate tables (not a full soluction but you can turnaround with it for now)

ipozow commented 2 years ago

This might have to do with CMI trying to add a DEFAULT value, while BLOB, TEXT, GEOMETRY or JSON column can't have a default value