ks-hl / AuxProtect

Data Logging and Inventory Recovery plugin designed to suplement CoreProtect
25 stars 8 forks source link

AuxProtect starved of connections or something? #7

Closed codeHusky closed 1 year ago

codeHusky commented 1 year ago

Unsure what this is about, occurs only after server has ran for quite a few hours. Spams console.

java.sql.SQLNonTransientConnectionException: No operations allowed after connection closed.
        at me.lucko.helper.sql.external.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:73) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:1664) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:1580) ~[helper-sql.jar:?]
        at dev.heliosares.auxprotect.database.SQLManager.updateUsernameAndIP(SQLManager.java:1288) ~[AuxProtect-1.2.2.jar:?]
        at dev.heliosares.auxprotect.spigot.listeners.PlayerListener$1.run(PlayerListener.java:180) ~[AuxProtect-1.2.2.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.19.2.jar:git-Paper-300]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.19.2.jar:git-Paper-300]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.19.2.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: me.lucko.helper.sql.external.mysql.cj.exceptions.ConnectionIsClosedException: No operations allowed after connection closed.
        at jdk.internal.reflect.GeneratedConstructorAccessor162.newInstance(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
        at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]
        at me.lucko.helper.sql.external.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.NativeSession.checkClosed(NativeSession.java:1171) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:573) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:1595) ~[helper-sql.jar:?]
        ... 9 more
Caused by: me.lucko.helper.sql.external.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 29,262,250 milliseconds ago. The last
packet sent successfully to the server was 29,262,250 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testin
g connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to
 avoid this problem.
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
        at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]
        at me.lucko.helper.sql.external.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:577) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:632) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.protocol.a.NativeProtocol.sendQueryPacket(NativeProtocol.java:948) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.NativeSession.execSQL(NativeSession.java:1075) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:930) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1003) ~[helper-sql.jar:?]
        at dev.heliosares.auxprotect.database.SQLManager.getUIDFromUUID(SQLManager.java:1514) ~[AuxProtect-1.2.2.jar:?]
        at dev.heliosares.auxprotect.database.SQLManager.put(SQLManager.java:549) ~[AuxProtect-1.2.2.jar:?]
        at dev.heliosares.auxprotect.database.DatabaseRunnable.lambda$run$3(DatabaseRunnable.java:92) ~[AuxProtect-1.2.2.jar:?]
        at java.util.Arrays$ArrayList.forEach(Arrays.java:4204) ~[?:?]
        at dev.heliosares.auxprotect.database.DatabaseRunnable.run(DatabaseRunnable.java:90) ~[AuxProtect-1.2.2.jar:?]
        ... 6 more
Caused by: java.net.SocketException: Connection reset by peer
        at sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:420) ~[?:?]
        at sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440) ~[?:?]
        at sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:826) ~[?:?]
        at java.net.Socket$SocketOutputStream.write(Socket.java:1035) ~[?:?]
        at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81) ~[?:?]
        at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142) ~[?:?]
        at me.lucko.helper.sql.external.mysql.cj.protocol.a.SimplePacketSender.send(SimplePacketSender.java:55) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.protocol.a.TimeTrackingPacketSender.send(TimeTrackingPacketSender.java:50) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:568) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:632) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.protocol.a.NativeProtocol.sendQueryPacket(NativeProtocol.java:948) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.NativeSession.execSQL(NativeSession.java:1075) ~[helper-sql.jar:?]
        at me.lucko.helper.sql.external.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:930) ~[helper-sql.jar:?]

Updated to 1.2.3 to see if that fixes it, will lyk but if you didn't try and address this in particular its likely still an issue. Was on 1.2.2

ks-hl commented 1 year ago

Significant database handling improvements were made in 1.2.3/1.2.4, please start a new issue if you experience further errors, as they will likely be very different from this.