logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
MySQL crashes
Goto page 1, 2  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Thu Jun 07, 2007 9:43    Post subject: MySQL crashes Reply with quote

Lately on my test box I'm experiencing many MySQL crashes.

From the mysql.txt log I get this
Quote:
! SQL Error: MySQL server has gone away.


I'm running NWNX4 prototype 1.08b1 with NWN2 v1.05
The MySQL daemon is installed as service so it's restarted everytime I restart the nwn2server (through nwnx4), but it still annoys me to have to restart the module everyone and then. Is there anything I can do to avoid MySQL crashes? I'm using the database only to log new characters, quests and for a bank system, nothing really big for the server.

Thanks in advance.
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Thu Jun 07, 2007 10:11    Post subject: Reply with quote

NWNX does nothing special to the DB, so it would likely crash with every other programm accessing it as well.

You might want to
a) check the MySQL documentation how to find the root of the problem
b) reinstall MySQL
c) check database consistency
d) maybe check that you have enough free RAM.

I have to admit I have never seen MySQL crashing, so I can not give more detailed advice.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Thu Jun 07, 2007 10:14    Post subject: Reply with quote

I'll do so, thanks for the quick reply.
Back to top
View user's profile Send private message
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Fri Jun 22, 2007 10:17    Post subject: Reply with quote

I'm starting to think that's an issue with NWNX4. All out of a sudden it loses the connection with the daemon claiming that it's down but I can fully access the data in it with the mysql client. From the xp_mysql.txt log I can't see anything suspicious, yet if I look at the nwnx4 GUI it seems that the mysql server crashes happens when the gamespy query fails. Should I turn off the gamespy watchdog?

TIA.
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Fri Jun 22, 2007 12:16    Post subject: Reply with quote

If the connection is broken, NWNX won't try to reconnect... even if it's only for a short time.

I'm not sure I understand what you mean with the reference to the gamespy watchdog in this context ...?
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Fri Jun 22, 2007 14:02    Post subject: Reply with quote

Papillon wrote:
If the connection is broken, NWNX won't try to reconnect... even if it's only for a short time.

Any way to prevent that?

Papillon wrote:
I'm not sure I understand what you mean with the reference to the gamespy watchdog in this context ...?

Database issues seem to occur at the same time with this:
* Warning: Server did not answer gamespy query.
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Mon Jun 25, 2007 23:37    Post subject: Reply with quote

Well, if the gamespy watchdog prints out the message about how the query failed, your nwn server is not responding. This usually happens when the server crashes or runs in an endless loop (at 100% CPU).

I am not sure how this might be related to your MySQL server crashing. This seems a bit fishy. Your PC is ok, otherwise ? No sudden crashes in other areas ?
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Tue Jun 26, 2007 1:19    Post subject: Reply with quote

Papillon wrote:
I am not sure how this might be related to your MySQL server crashing. This seems a bit fishy. Your PC is ok, otherwise ? No sudden crashes in other areas ?

The PC works flawlessly, the only issue seems to be with this. I'll inspect further though.

Thanks for the help so far.
Back to top
View user's profile Send private message
JohnB



Joined: 11 Jul 2007
Posts: 10

PostPosted: Wed Jul 11, 2007 19:33    Post subject: Reply with quote

I have the same problem.

However I am using NWNx2 along with MySQL.

The game starts up fine, finds the DB and reads in persistent times, CNR data etc. It will also store persistent locations and CNR data.

Then suddenly I get

! SQL Error: [MySQL][ODBC 3.51 Driver][mysqld-5.0.27-community-nt]MySQL server has gone away

Although I can still access the server and the DB from SQLyog.

Any thoughts? The PC is up and running, doesn't appear to have any other problems? Could it be an issue with ODBC drivers? Or perhaps I should look at adding a connection test and (if needed) a DC connect before every read or write?
Back to top
View user's profile Send private message
JohnB



Joined: 11 Jul 2007
Posts: 10

PostPosted: Wed Jul 11, 2007 21:48    Post subject: Reply with quote

I realised that I didn't have the latest version of MySQL. I have now installed 5.0.41 - now just waiting to see if it still happens.
Back to top
View user's profile Send private message
JohnB



Joined: 11 Jul 2007
Posts: 10

PostPosted: Thu Jul 12, 2007 9:18    Post subject: Reply with quote

That appears to have resolved the problem Smile
Back to top
View user's profile Send private message
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Thu Jul 12, 2007 9:37    Post subject: Reply with quote

I don't mean to jinx but I've experienced these issues with 5.0.41, much less lately but you can't ever tell.
Back to top
View user's profile Send private message
JohnB



Joined: 11 Jul 2007
Posts: 10

PostPosted: Thu Jul 12, 2007 16:38    Post subject: Reply with quote

Yep - It happened again. This time however it lasted longer than it has done before.

From what has been said before - it seems that the server is fine and if we were to force a reconnect when the server is 'Gone away' - that would over come the problem.

Any thoughts on the best way to do it? Not sure I klnow how to code all of these variants - but it seems like there are three ways to handle this ...

1) Restart the module regularly. More frequently that the average time until the 'Server Gone away' message. That would force a new connection ....

2) Have a script run rugularly that checks to see if the server is there, and then tries a reconnect if it isn't. Once an hour should have minimum impact opn the server. I suppose we could even check a second time and if the reconnect doesn't work - we could reload the module.

3) Tweak the script that actually writes to the DB to check for a 'Server Gone Away' error message. (is that even possible?). We could use that to trigger a reconnect or a reboot. I wonder if its possible to save the data and try and write it again after we reconnect to the database?
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat Jul 14, 2007 15:13    Post subject: Reply with quote

How often does the "MySQL server has gone away" message appear ? Does it appear only after prolonged periods of inactivity or does it also happen when players are on and exercise the DB ?
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
JohnB



Joined: 11 Jul 2007
Posts: 10

PostPosted: Sun Jul 15, 2007 10:14    Post subject: Reply with quote

It looks to be after a period of inactivity - however I haven't managed to work out what the time limits are.

I am working with a new server, thats still heavily under development - it can go for a long time without a player connecting to it.

Generally it is OK overnight (about 6-7 hours) without any use. It is more likely to 'Go Away' while I am out at work whis is, perhaps, a slightly longer period with no activity. However, that doesn't appear to be consistent. Sad
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related All times are GMT + 2 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group