Hidendra / LWC

Lightweight Protection for Chests, Furnaces, Dispensers, and more for the Minecraft server mod Bukkit
Other
167 stars 123 forks source link

LWC - DB connection issue and not registering new chests #541

Open Craft4 opened 11 years ago

Craft4 commented 11 years ago

I am using LWC connected to my local mysql Server. After a long period of no actions the LWC (and some other plugins) need to reconnect. As it seems that PEX manages to establish a working connection atleast a part of LWC is not.

I think after the night all Plugins lost connection to the DB Server. i.e PEX is showing the reconnect attempt in the Logs: 2013-02-21 10:43:39 [WARNING] Lost connection with sql server. Reconnecting. 2013-02-21 10:43:39 [INFO] [PermissionsEx-SQL] Connecting to database "mysql://localhost/minecraft_perms"

Here is the Log from Last night from my Server:

2013-02-21 00:26:50 [INFO] Craft4 lost connection: disconnect.quitting 2013-02-21 00:39:13 [INFO] [MineBackup] * saving worlds\world_1_4_7 2013-02-21 01:03:26 [INFO] Connection reset 2013-02-21 02:03:21 [INFO] Connection reset 2013-02-21 03:02:37 [INFO] Connection reset 2013-02-21 04:02:13 [INFO] Connection reset 2013-02-21 05:03:37 [INFO] Connection reset 2013-02-21 06:03:32 [INFO] Connection reset 2013-02-21 07:03:59 [INFO] Connection reset 2013-02-21 08:05:12 [INFO] Connection reset 2013-02-21 09:02:27 [INFO] Connection reset 2013-02-21 10:02:15 [INFO] Connection reset 2013-02-21 10:43:39 [INFO] Schnubbi90[/XXXXXXX] logged in with entity id XXXXXX at ([world_1_4_7] 261.59181567512405, 63.0, -20.66121696931663) 2013-02-21 10:43:39 [WARNING] Lost connection with sql server. Reconnecting. 2013-02-21 10:43:39 [INFO] [PermissionsEx-SQL] Connecting to database "mysql://localhost/minecraft_perms" 2013-02-21 10:47:31 [INFO] Connection reset 2013-02-21 11:03:44 [INFO] Connection reset 2013-02-21 11:08:17 [INFO] SpecialFrog[/XXXXXXXXXXX] logged in with entity id XXXXXXX at ([world_1_4_7] 273.47408223925015, 67.0, -7.373296683381893) 2013-02-21 11:14:10 [INFO] Connection reset 2013-02-21 11:14:10 [INFO] SpecialFrog lost connection: disconnect.quitting 2013-02-21 11:21:12 [INFO] Connection reset 2013-02-21 11:21:12 [INFO] Schnubbi90 lost connection: disconnect.quitting 2013-02-21 11:36:32 [INFO] Schnubbi90[XXXXXXXXX] logged in with entity id XXXXXXX at ([world_1_4_7] 267.72185314426866, 63.0, -19.556519358331855) 2013-02-21 11:43:29 [SEVERE] com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 40,631,547 milliseconds ago. The last packet sent successfully to the server was 40,631,547 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. 2013-02-21 11:43:29 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 2013-02-21 11:43:29 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 2013-02-21 11:43:29 [SEVERE] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 2013-02-21 11:43:29 [SEVERE] at java.lang.reflect.Constructor.newInstance(Unknown Source) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3348) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1967) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5022) 2013-02-21 11:43:29 [SEVERE] at com.griefcraft.sql.Database.setAutoCommit(Database.java:158) 2013-02-21 11:43:29 [SEVERE] at com.griefcraft.util.DatabaseThread.flushDatabase(DatabaseThread.java:127) 2013-02-21 11:43:29 [SEVERE] at com.griefcraft.util.DatabaseThread.run(DatabaseThread.java:157) 2013-02-21 11:43:29 [SEVERE] at java.lang.Thread.run(Unknown Source) 2013-02-21 11:43:29 [SEVERE] Caused by: java.net.SocketException: Broken pipe 2013-02-21 11:43:29 [SEVERE] at java.net.SocketOutputStream.socketWrite0(Native Method) 2013-02-21 11:43:29 [SEVERE] at java.net.SocketOutputStream.socketWrite(Unknown Source) 2013-02-21 11:43:29 [SEVERE] at java.net.SocketOutputStream.write(Unknown Source) 2013-02-21 11:43:29 [SEVERE] at java.io.BufferedOutputStream.flushBuffer(Unknown Source) 2013-02-21 11:43:29 [SEVERE] at java.io.BufferedOutputStream.flush(Unknown Source) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3329) 2013-02-21 11:43:29 [SEVERE] ... 8 more 2013-02-21 11:43:29 [SEVERE] com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure during commit(). Transaction resolution unknown. 2013-02-21 11:43:29 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 2013-02-21 11:43:29 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 2013-02-21 11:43:29 [SEVERE] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 2013-02-21 11:43:29 [SEVERE] at java.lang.reflect.Constructor.newInstance(Unknown Source) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.Util.getInstance(Util.java:382) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) 2013-02-21 11:43:29 [SEVERE] at com.mysql.jdbc.ConnectionImpl.commit(ConnectionImpl.java:1672) 2013-02-21 11:43:29 [SEVERE] at com.griefcraft.sql.Database.setAutoCommit(Database.java:155) 2013-02-21 11:43:29 [SEVERE] at com.griefcraft.util.DatabaseThread.flushDatabase(DatabaseThread.java:140) 2013-02-21 11:43:29 [SEVERE] at com.griefcraft.util.DatabaseThread.run(DatabaseThread.java:157) 2013-02-21 11:43:29 [SEVERE] at java.lang.Thread.run(Unknown Source)

From this time on - everytime someone attempts to protect a new chest with LWC, this error shows up in the console again. The Client gets the message "Created private CHest successful". But it does not register the Chest - there is no entry showing up in the DB and /cinfo returns "THis chest is not registered".

The already existing protections are working fine and /cinfo shows up all information about them. So i guess there is still some kind of DB connection or is this information about protected chests cached in the server?

Is there a solution to this problem? Currently only a complete Server restart solves the issue needs the involvement of an server admin with shell access.

Craft4 commented 11 years ago

Is there a possibility to avoid this problem - currently i´ve set up a cronjob to restart my server all 6 hours which ... sucks.