MySQL Server has gone away
Moderators: Community Managers, Developers
- John Adams
- Retired
- Posts: 4582
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
MySQL Server has gone away
Scat, I think I know how to recreate this issue. I had started my login/world together hours ago and they sat idle. The first player to try connecting, the SQL call bombed out. Copying the query into SQLYog, it executes fine so it's not bad SQL.
I also noticed that on this new Linux host of mine (Ubuntu 13.10 x64) world and login both start a lot slower than on the 12.04 x86 I had them on before:
17:47:31.348 I Net Client log: Login successful to WorldServer: 68.98.218.5 17:47:31.455 E Database Error running MySQL query (2006): MySQL server has gone away SELECT `char_id`,`char_firstname`,`char_lastname`,`char_race`,`char_class`,`char_gender`,`adventure_level` FROM `characters` WHERE `account_id`=131 AND `char_deleted`=0 LIMIT 12Maybe the code is dropping the SQL connection somehow? Does World have a heartbeat yet? I know Login does.
I also noticed that on this new Linux host of mine (Ubuntu 13.10 x64) world and login both start a lot slower than on the 12.04 x86 I had them on before:
17:58:57.699 I General Starting VGOEmulator WorldServer v0.1 Alpha 17:59:02.718 I Database MySQL database connected to .......
Re: MySQL Server has gone away
Not sure what's going on there...Anything in /var/log/mysql?
- John Adams
- Retired
- Posts: 4582
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: MySQL Server has gone away
Newp. error.log = 0 bytes. My shit is solid. At MMOE, we do not tolerate failure.
- John Adams
- Retired
- Posts: 4582
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: MySQL Server has gone away
Here's more evidence that it only happens after the Worldserver is idle for hours. I had a dozen connections to World yesterday while I was sitting right here watching. Soon as I went to sleep though, the very next connection almost 8.5 hours later, failed.
Last known good connection:
[quote]23:05:37.422 I UDP Client from 68.98.218.5 set to disconnect in 60 seconds: Timeout
23:06:14.457 I UDP Client from 68.98.218.5 has been removed[/quote]
Very next connect:
[quote]07:46:28.335 I UDP New client connected from 108.35.211.128
07:46:28.335 I UDP Received session request from 108.35.211.128 with connection ID 1365998151
07:46:28.549 I Net Client log: Connected to World Server: 68.98.218.5
07:46:28.555 I Net New Session: Account ID: 128 Session ID: 'qo6tnmf9bki7gclqrhh0k1b8u3'
07:46:28.861 I Net Client log: Login successful to World Server: 68.98.218.5
07:46:29.111 E Database Error running MySQL query (2006): MySQL server has gone away
SELECT `char_id`,`char_firstname`,`char_lastname`,`char_race`,`char_class`,`char_gender`,`adventure_level`
FROM `characters`
WHERE `account_id`=128
AND `char_deleted`=0
LIMIT 12
07:46:30.195 I Net Client log: Received unhandled message id 1832 from WorldServer.
07:47:30.453 I UDP Client from 108.35.211.128 set to disconnect in 60 seconds: Timeout
07:48:30.453 I UDP Client from 108.35.211.128 has been removed[/quote]
and 2 more at 9:35am failed exactly the same way. Once it's gone, it's gone. I think we need that World heart beat. Might be that simple to solve this problem.
Last known good connection:
[quote]23:05:37.422 I UDP Client from 68.98.218.5 set to disconnect in 60 seconds: Timeout
23:06:14.457 I UDP Client from 68.98.218.5 has been removed[/quote]
Very next connect:
[quote]07:46:28.335 I UDP New client connected from 108.35.211.128
07:46:28.335 I UDP Received session request from 108.35.211.128 with connection ID 1365998151
07:46:28.549 I Net Client log: Connected to World Server: 68.98.218.5
07:46:28.555 I Net New Session: Account ID: 128 Session ID: 'qo6tnmf9bki7gclqrhh0k1b8u3'
07:46:28.861 I Net Client log: Login successful to World Server: 68.98.218.5
07:46:29.111 E Database Error running MySQL query (2006): MySQL server has gone away
SELECT `char_id`,`char_firstname`,`char_lastname`,`char_race`,`char_class`,`char_gender`,`adventure_level`
FROM `characters`
WHERE `account_id`=128
AND `char_deleted`=0
LIMIT 12
07:46:30.195 I Net Client log: Received unhandled message id 1832 from WorldServer.
07:47:30.453 I UDP Client from 108.35.211.128 set to disconnect in 60 seconds: Timeout
07:48:30.453 I UDP Client from 108.35.211.128 has been removed[/quote]
and 2 more at 9:35am failed exactly the same way. Once it's gone, it's gone. I think we need that World heart beat. Might be that simple to solve this problem.
Re: MySQL Server has gone away
I have tried to get on a few times but my toon is never available. I have updated my client and so forth.
update - just got on. very cool once all those npc's load.
update - just got on. very cool once all those npc's load.
- John Adams
- Retired
- Posts: 4582
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: MySQL Server has gone away
And now, on Windows. This was not a linux issue. It has everything to do with idle time and can be solved most likely with a World heartbeat.
Re: MySQL Server has gone away
I see the login heartbeat code so I'll work that into my commit for world, been fixing valgrind errors this morning anyway.
- John Adams
- Retired
- Posts: 4582
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: MySQL Server has gone away
Thank you.
Re: MySQL Server has gone away
Committed, I added in a call to mysql_ping() every 5 minutes, let me know if this still happens and I can change it to some other kind of query. I think it will work though.
- John Adams
- Retired
- Posts: 4582
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: MySQL Server has gone away
Uh oh, Foofski... with the new ping, server screamed up to 2GB ram and crashed immediately when someone logged in.
Not sure if this is you, or if you are a victim of the race condition:
Not sure if this is you, or if you are a victim of the race condition:
Code: Select all
> WorldServer.exe!_NMSG_WRITE(int rterrnum) Line 226 C
WorldServer.exe!abort() Line 62 C
WorldServer.exe!_wassert(const wchar_t * expr, const wchar_t * filename, unsigned int lineno) Line 155 C
WorldServer.exe!_net_clear() Unknown
WorldServer.exe!_cli_advanced_command() Unknown
WorldServer.exe!_mysql_ping@4() Unknown
WorldServer.exe!Database::PingDatabase() Line 202 C++
WorldServer.exe!WorldDatabase::PingDatabase() Line 93 C++
WorldServer.exe!Net::Process() Line 108 C++
WorldServer.exe!main(int argc, char * * argv) Line 115 C++
WorldServer.exe!__tmainCRTStartup() Line 241 C
WorldServer.exe!mainCRTStartup() Line 164 C
kernel32.dll!767d338a() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!77319f72() Unknown
ntdll.dll!77319f45() Unknown