EpicEricEE / ShopChest

ShopChest - Spigot/Bukkit Plugin
MIT License
45 stars 57 forks source link

ShopChest database error, unable to use mysql or sqlite #305

Closed XXY233 closed 4 years ago

XXY233 commented 4 years ago

SQLITE:

[23:57:29] [Craft Scheduler Thread - 8/INFO]: [de.epiceric.shopchest.dependencies.hikari.HikariDataSource] HikariPool-1 - Shutdown initiated...
[23:57:29] [Craft Scheduler Thread - 5/ERROR]: [ShopChest] Failed to get shops from database
[23:57:29] [Craft Scheduler Thread - 24/ERROR]: [ShopChest] Failed to log last logout to database
[23:57:29] [Craft Scheduler Thread - 15/ERROR]: [ShopChest] Failed to get last logout from database
[23:57:29] [Craft Scheduler Thread - 16/ERROR]: [ShopChest] Failed to get last logout from database
[23:57:29] [Craft Scheduler Thread - 12/INFO]: [Vault] Checking for Updates ... 
[23:57:29] [Craft Scheduler Thread - 22/ERROR]: [ShopChest] Failed to log last logout to database
[23:57:29] [Craft Scheduler Thread - 8/INFO]: [de.epiceric.shopchest.dependencies.hikari.HikariDataSource] HikariPool-1 - Shutdown completed.
[23:57:29] [Craft Scheduler Thread - 8/INFO]: [de.epiceric.shopchest.dependencies.hikari.HikariDataSource] HikariPool-2 - Starting...
[23:57:29] [Server thread/ERROR]: [ShopChest] No database access. Disabling ShopChest
[23:57:29] [Server thread/ERROR]: [ShopChest] HikariDataSource HikariDataSource (HikariPool-1) has been closed.
[23:57:29] [Server thread/INFO]: [ShopChest] Disabling ShopChest v1.13-SNAPSHOT

MYSQL:

[00:03:18] [Craft Scheduler Thread - 13/ERROR]: [de.epiceric.shopchest.dependencies.hikari.pool.HikariPool] HikariPool-1 - Exception during pool initialization.
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_241]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_241]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_241]
    at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_241]
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.Util.getInstance(Util.java:408) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2095) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2020) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:768) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) ~[patched_1.15.2.jar:git-Paper-105]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_241]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_241]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_241]
    at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_241]
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:385) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:323) ~[patched_1.15.2.jar:git-Paper-105]
    at de.epiceric.shopchest.dependencies.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[?:?]
    at de.epiceric.shopchest.dependencies.hikari.pool.PoolBase.newConnection(PoolBase.java:353) ~[?:?]
    at de.epiceric.shopchest.dependencies.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[?:?]
    at de.epiceric.shopchest.dependencies.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473) ~[?:?]
    at de.epiceric.shopchest.dependencies.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562) ~[?:?]
    at de.epiceric.shopchest.dependencies.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[?:?]
    at de.epiceric.shopchest.dependencies.hikari.HikariDataSource.<init>(HikariDataSource.java:81) ~[?:?]
    at de.epiceric.shopchest.sql.MySQL.getDataSource(MySQL.java:29) ~[?:?]
    at de.epiceric.shopchest.sql.Database$1.run(Database.java:258) ~[?:?]
    at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:84) ~[patched_1.15.2.jar:git-Paper-105]
    at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[patched_1.15.2.jar:git-Paper-105]
    at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.15.2.jar:git-Paper-105]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_241]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_241]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_241]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_241]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_241]
    at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_241]
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:335) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2187) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2036) ~[patched_1.15.2.jar:git-Paper-105]
    ... 25 more
Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) ~[?:1.8.0_241]
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) ~[?:1.8.0_241]
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) ~[?:1.8.0_241]
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) ~[?:1.8.0_241]
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[?:1.8.0_241]
    at java.net.PlainSocketImpl.connect(Unknown Source) ~[?:1.8.0_241]
    at java.net.SocksSocketImpl.connect(Unknown Source) ~[?:1.8.0_241]
    at java.net.Socket.connect(Unknown Source) ~[?:1.8.0_241]
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:299) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2187) ~[patched_1.15.2.jar:git-Paper-105]
    at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2036) ~[patched_1.15.2.jar:git-Paper-105]
    ... 25 more
[00:03:23] [Server thread/ERROR]: [ShopChest] No database access. Disabling ShopChest
[00:03:23] [Server thread/ERROR]: [ShopChest] Failed to initialize pool: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
[00:03:23] [Server thread/INFO]: [ShopChest] Disabling ShopChest v1.13-SNAPSHOT

I have tried deleting all files, but even with the built-in sqlite I get errors

EpicEricEE commented 4 years ago

There seem to be two separate issues here.

SQLite: If you have any kind of multiverse plugin installed, this issue may be related to #297. (The connection to the database is mistakenly closed while shops are being loaded; the plugin disables itself to prevent further issues)

MySQL: The plugin failed to connect to your database, did you set the right host, port, username and password?

XXY233 commented 4 years ago

There seem to be two separate issues here.

SQLite: If you have any kind of multiverse plugin installed, this issue may be related to #297. (The connection to the database is mistakenly closed while shops are being loaded; the plugin disables itself to prevent further issues)

MySQL: The plugin failed to connect to your database, did you set the right host, port, username and password?

Thank you for your help, there is only one issue now, when I use PlotSquared, ShopChest cannot be enabled.

EpicEricEE commented 4 years ago

Any unusual console messages? Which version of PlotSquared are you using?

XXY233 commented 4 years ago

The PlotSquared version is 4.453. debug.log latest.log

EpicEricEE commented 4 years ago
[19:23:58] [Server thread/INFO]: [P2] Detected world load for 'plot'
[19:23:58] [Server thread/INFO]: [P2]  - generator: PlotSquared>PlotSquared
[19:23:58] [Server thread/INFO]: [P2]  - plotworld: com.github.intellectualsites.plotsquared.plot.generator.HybridPlotWorld
[19:23:58] [Server thread/INFO]: [P2]  - plotAreaManager: com.github.intellectualsites.plotsquared.plot.generator.HybridPlotManager

Here, PlotSquared is loading a world after ShopChest has started loading the shops, leading to the issue I described above. I have yet to fix that.

EpicEricEE commented 4 years ago

Should be fixed with build 83. Leave a message if that is not the case.