Civcraft / JukeAlert

Do not open issues here; open them on the maintained fork @ DevotedMC
https://github.com/DevotedMC/JukeAlert
BSD 3-Clause "New" or "Revised" License
5 stars 15 forks source link

JukeAlert SQLError #57

Closed rident closed 8 years ago

rident commented 8 years ago

After a couple hours, sometimes days, jukealert will sort of just implode on it's self and spew out this in the console: http://pastebin.com/F5BbSfbz

28.02 00:01:24 [Server] INFO com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

28.02 00:01:24 [Server] ERROR [JukeAlert] Could not get Snitch Details from the snitchesDetail table using the snitch id 14

If I restart the server, the databases will return as normal, but otherwise it will just say," * Page 1 is empty for snitch Example".

rourke750 commented 8 years ago

Looks like a just timing out issue. @Civcraft/devs

rident commented 8 years ago

@rourke750 I'm guessing it would be a server side issue then?

ProgrammerDan commented 8 years ago

Configure your Mysql/Mariadb to have a longer connection timeout for now. It's not ideal. Set it to slightly longer then your server restart period.

rident commented 8 years ago

@ProgrammerDan

I'm not very proficient with MySQL or servers for that matter. If it's not too much to ask, could you direct me on how to configure that? because the directions I'm finding online are telling me to edit "my.cnf" in the /etc/ directory, but that file doesn't exist there. It does however in the /etc/mysql/ directory, but doesn't have anything detailing the max timeout time.

Supposedly I can also use Connector/J to set configure it to autoreconnect, but I'm unsure how that works either.

ProgrammerDan commented 8 years ago

https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_wait_timeout

Add a line in section [mysqld] like this:

wait_timeout            = 27000
ProgrammerDan commented 8 years ago

Also it's on my todo to just add reconnect into JukeAlert, so hopefully in the next few days this won't be an issue any more :)

rident commented 8 years ago

@ProgrammerDan

Thank you, I appreciate it! and that'll definitely be useful. I've been pretty much pulling my hair out trying to fix this for a bit now aha. I thought maybe I had setup the database wrong or something.

ProgrammerDan commented 8 years ago

I hear ya. First few times I ran into it I had the same thoughts!

Maxopoly commented 8 years ago

This is the same issue we are having currently.

Maxopoly commented 8 years ago

https://github.com/Civcraft/JukeAlert/commit/a71921c3fb5bcae299c11ba114fb80b7940a496b