Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

MySQL connector issues #128

Closed
RhvsW opened this issue Jan 14, 2017 · 3 comments
Closed

MySQL connector issues #128

RhvsW opened this issue Jan 14, 2017 · 3 comments
Labels
general support Help requested by a user. invalid Not a valid issue.

Comments

@RhvsW
Copy link

RhvsW commented Jan 14, 2017

Connected to a local MySQL server the plugin consistently errors with:

[12:55:28] [Server thread/INFO]: [*] redacted has joined the server.
[12:55:28] [Craft Scheduler Thread - 66/INFO]: [GAListener] Player: redacted has 2 queued votes
[12:55:33] [Server thread/ERROR]: [AdvancedAchievements] SQL error while retrieving connection date stats:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 1,862,150 milliseconds ago.  The last packet sent successfully to the server was 1,862,152 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing 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 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_111]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_111]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_111]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_111]
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) ~[patched_1.11.2.jar:git-Paper-1029]
        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:988) ~[patched_1.11.2.jar:git-Paper-1029]
        at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3739) ~[patched_1.11.2.jar:git-Paper-1029]
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2508) ~[patched_1.11.2.jar:git-Paper-1029]
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673) ~[patched_1.11.2.jar:git-Paper-1029]
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545) ~[patched_1.11.2.jar:git-Paper-1029]
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2503) ~[patched_1.11.2.jar:git-Paper-1029]
        at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1369) ~[patched_1.11.2.jar:git-Paper-1029]
        at com.hm.achievement.db.SQLDatabaseManager.getPlayerConnectionDate(SQLDatabaseManager.java:921) [AdvancedAchievements.jar:?]
        at com.hm.achievement.runnable.AchieveConnectionRunnable.run(AchieveConnectionRunnable.java:61) [AdvancedAchievements.jar:?]
        at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:58) [patched_1.11.2.jar:git-Paper-1029]
        at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:355) [patched_1.11.2.jar:git-Paper-1029]
        at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:811) [patched_1.11.2.jar:git-Paper-1029]
        at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:403) [patched_1.11.2.jar:git-Paper-1029]
        at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:749) [patched_1.11.2.jar:git-Paper-1029]
        at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:648) [patched_1.11.2.jar:git-Paper-1029]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
Caused by: java.net.SocketException: Broken pipe (Write failed)
        at java.net.SocketOutputStream.socketWrite0(Native Method) ~[?:1.8.0_111]
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) ~[?:1.8.0_111]
        at java.net.SocketOutputStream.write(SocketOutputStream.java:153) ~[?:1.8.0_111]
        at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) ~[?:1.8.0_111]
        at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) ~[?:1.8.0_111]
        at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3721) ~[patched_1.11.2.jar:git-Paper-1029]
        ... 14 more
[12:55:33] [Server thread/INFO]: [AdvancedAchievements] Player redacted received the achievement: connect_1 (Good Choice)
@PyvesB PyvesB added the investigate Let's figure out what's going on here! label Jan 16, 2017
@PyvesB
Copy link
Owner

PyvesB commented Jan 16, 2017

Hello,

One user was having a similar issue a long time ago, could you please refer to #67 and see if the links I posted there help you out?

Cheers,

Pyves

@RhvsW
Copy link
Author

RhvsW commented Jan 22, 2017

Increasing the timeout to a ridiculously stupid time fixes this but shouldn't the plugin handle a stale connection and reinitialize it rather than spewing an error to console and failing spectacularly?

@PyvesB
Copy link
Owner

PyvesB commented Jan 26, 2017

Hello,

The plugin does handle reconnection (both by sending autoReconnect parameter when establishing a connection and by checking connection availability before each database transaction). Hundreds of servers use this plugin with MySQL without any "spectacular failures", the issue most likely comes from your database setup or server.

Cheers,

Pyves

@PyvesB PyvesB closed this as completed Jan 26, 2017
@PyvesB PyvesB added general support Help requested by a user. invalid Not a valid issue. and removed investigate Let's figure out what's going on here! labels Jan 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
general support Help requested by a user. invalid Not a valid issue.
Projects
None yet
Development

No branches or pull requests

2 participants