Team-Inceptus / Novaconomy

🌟 The Economy Plugin as big as a star.
https://team-inceptus.github.io/Novaconomy/
GNU General Public License v3.0
14 stars 8 forks source link

Typo in SQL syntax causes errors #114

Closed ajh123 closed 1 year ago

ajh123 commented 1 year ago

Bug Type

Performance / Memory Leak / Server Crash, Console Errors, Other Unexpected Behavior

Minecraft Version

1.20.1 (any MC version that can run Novaconomy 1.8.1-SNAPSHOT)

Description

Due to a typo in the name of the businesses table the following error is produced (looks like every tick)

[19:17:00] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: java.base/java.lang.Thread.run(Thread.java:833)
stop[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: SQLSyntaxErrorException
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: -----------
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: Table 'novaconomy.businessess' doesn't exist
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: LAYER SERVICE//com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:121)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: LAYER SERVICE//com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: LAYER SERVICE//com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:763)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: LAYER SERVICE//com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: us.teaminceptus.novaconomy.api.business.Business.checkTable(Business.java:893)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: us.teaminceptus.novaconomy.api.business.Business.getBusinesses(Business.java:1391)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: us.teaminceptus.novaconomy.Novaconomy$5.run(Novaconomy.java:353)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: TRANSFORMER/arclight@1.20.1-1.0.0-053d747/org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:82)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: TRANSFORMER/arclight@1.20.1-1.0.0-053d747/org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: java.base/java.lang.Thread.run(Thread.java:833)

Steps to Reproduce

  1. Install a server capable of running Novaconomy normally (like Paper or Arclight)
  2. Download the jar by pressing that blue button on the spigot page. For me I get "novaconomy-1.8.1-SNAPSHOT.jar"
  3. Copy the jar to the server's plugin folder
  4. Start the server so config files are made then close it
  5. Modify the config.yml so the plugin connects to a MySQL database
  6. Start the server again
  7. Once the world has loaded see the error every tick (or so)

Expected Behavior

Plugin runs correctly without and console spam.

Actual Behavior

Error is produced every tick (or so)

[19:17:00] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: java.base/java.lang.Thread.run(Thread.java:833)
stop[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: SQLSyntaxErrorException
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: -----------
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: Table 'novaconomy.businessess' doesn't exist
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: LAYER SERVICE//com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:121)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: LAYER SERVICE//com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: LAYER SERVICE//com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:763)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: LAYER SERVICE//com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: us.teaminceptus.novaconomy.api.business.Business.checkTable(Business.java:893)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: us.teaminceptus.novaconomy.api.business.Business.getBusinesses(Business.java:1391)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: us.teaminceptus.novaconomy.Novaconomy$5.run(Novaconomy.java:353)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: TRANSFORMER/arclight@1.20.1-1.0.0-053d747/org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:82)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: TRANSFORMER/arclight@1.20.1-1.0.0-053d747/org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[19:17:01] [Craft Scheduler Thread - 3/ERROR] [Novaconomy/]: java.base/java.lang.Thread.run(Thread.java:833)

Additional Info

https://github.com/Team-Inceptus/Novaconomy/blob/520b3faabb3cab5b6c02e143710976a7423c7bf0/api/src/main/java/us/teaminceptus/novaconomy/api/business/Business.java#L893

The cause of the error is the incorrect spelling of "businessess" it should be spelt "businesses"

ajh123 commented 1 year ago

I'm making a PR for this :)

gmitch215 commented 1 year ago

Merged your PR. If you'd like to try out the experimental version, see this page.

ajh123 commented 1 year ago

Thanks!