DB Error - MySQL Server Has Gone Away

Post Reply
xelloss
Posts: 57
Joined: Sat Mar 09, 2013 1:09 am

DB Error - MySQL Server Has Gone Away

Post by xelloss » Fri Aug 01, 2014 8:16 am

So, I just recently started seeing these errors on the FFXI Game Server. The lobby and search servers are unaffected. My setup involves the MySQL ( MariaDB ) server and FFXI servers on different machines. The SQL server is located at 192.168.54.4/24, and the FFXI servers are located at 192.168.51.38/24.

According to the logs, this is the sequence of events:

Code: Select all

[0m[20:01:10][1;36m[Debug][0m [1;36m[Lua] Garbage Collected. Current State Top: 0
[0m[20:01:12][1;36m[Debug][0m [1;36mUpdateWeather Finished
[0m[20:10:48][1;36m[Debug][0m [1;36mUpdateWeather Finished
[0m[20:16:10][1;36m[Debug][0m [1;36m[Lua] Garbage Collected. Current State Top: 0
[0m[20:20:24][1;36m[Debug][0m [1;36mUpdateWeather Finished
[0m[20:28:48][1;36m[Debug][0m [1;36mUpdateGuildsStock is finished
[0m[20:29:09][1;35m[SQL][0m DB error - Lost connection to MySQL server during query
The server was running for approximately 47 hrs and 43 mins when the error occurred.

User avatar
whasf
Site Admin
Posts: 1300
Joined: Thu Jul 19, 2012 9:11 pm

Re: DB Error - MySQL Server Has Gone Away

Post by whasf » Fri Aug 01, 2014 9:00 am

Sounds like you have network issues, or the SQL server was restarted while the game server was running. If the connection is lost or closed for any reason then it'll complain and you'll have to restart the Game Server. The other two aren't affected because they don't keep a connection open at all times.
-- Whasf

xelloss
Posts: 57
Joined: Sat Mar 09, 2013 1:09 am

Re: DB Error - MySQL Server Has Gone Away

Post by xelloss » Fri Aug 01, 2014 1:31 pm

Hm. Well, I found nothing in the DB logs ( hence why not included ) that would suggest a break. Fortunately this was only a few days of runtime and not longer so I just had to count the number of times 00 showed up; is there any way to make the DS Server logs break / rotate by day or at least include a date in the logs themselves?

User avatar
whasf
Site Admin
Posts: 1300
Joined: Thu Jul 19, 2012 9:11 pm

Re: DB Error - MySQL Server Has Gone Away

Post by whasf » Sat Aug 02, 2014 2:49 pm

xelloss wrote:Hm. Well, I found nothing in the DB logs ( hence why not included ) that would suggest a break. Fortunately this was only a few days of runtime and not longer so I just had to count the number of times 00 showed up; is there any way to make the DS Server logs break / rotate by day or at least include a date in the logs themselves?
Absolutely, you have access to the source, code it in. :)
-- Whasf

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

Re: DB Error - MySQL Server Has Gone Away

Post by bluekirby0 » Sun Aug 03, 2014 1:22 pm

You can also configure your mysql server to be more forgiving about timeouts to try to prevent the connection loss in the first place (at some significant performance penalty when the server is used by many programs).

xelloss
Posts: 57
Joined: Sat Mar 09, 2013 1:09 am

Re: DB Error - MySQL Server Has Gone Away

Post by xelloss » Tue Aug 05, 2014 8:03 am

whasf wrote:
xelloss wrote:Hm. Well, I found nothing in the DB logs ( hence why not included ) that would suggest a break. Fortunately this was only a few days of runtime and not longer so I just had to count the number of times 00 showed up; is there any way to make the DS Server logs break / rotate by day or at least include a date in the logs themselves?
Absolutely, you have access to the source, code it in. :)
You do not want to see my attempts at coding. Hi elbow, have you seen the thumb?
bluekirby0 wrote:You can also configure your mysql server to be more forgiving about timeouts to try to prevent the connection loss in the first place (at some significant performance penalty when the server is used by many programs).
Default wait timeout is 8 hours, I don't think that would be the issue. I split up my SQL databases so that the mail server has its own separate and contained one and 'everything else' is using a common SQL server with different users / dbs. I haven't seen anything to indicate a 'back_log' parameter problem. The SQL server still has resources available if I need to go that route but atm I don't think it is necessary.


I had swapped from Linux LXC to a Windows VM for the Darkstar server build ( because other emulators seem reliant on Windows tools / environs rather than *nix ) and this was my first 'long duration' run. So far as of this writing the SQL server is still talking to the gameserver so perhaps it was a fluke? I intend to tear down my current setup this weekend to swap over from a pfSense controller / firewall to a Sophos one, and we'll see how with the planned network topo changes things act.

Post Reply