Page 1 of 1

BugID: 611 (John Adams) Error Running MySQL Query

Posted: Sat Jan 05, 2013 12:29 pm
by John Adams
Bug ID: 611 - Error Running MySQL Query
Bug Date: 2013-01-04 10:31:31
Priority: Low

Originated From World: PacketAnalyzer (100)
Category: PacketAnalyzer
Sub-Category: Bug Report
Causes a Crash: Causes crash
Reproducible: Happened Once
Version:

Details:
Connection must be valid and open.

SELECT `name`,`opcode`,`version_range1`,`version_range2` FROM `opcodes` WHERE 1193>=`version_range1` AND 1193Stack Trace:
System.InvalidOperationException: Connection must be valid and open.
at MySql.Data.MySqlClient.MySqlCommand.CheckState()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
at EQ2PacketAnalyzer.Database.Select(String query, Object[] list) in D:\dev\eq2\eq2tools\trunk\DevTools\PacketAnalyzer\PacketAnalyzer\SQL\Database.cs:line 65Additional Details:
running 2 packetanalyzer's at once, never saw this error before with hundreds of executions. wtf?
Spawn: N/A (0), Zone: 0

Re: BugID: 611 (John Adams) Error Running MySQL Query

Posted: Sat Jan 05, 2013 2:54 pm
by John Adams
It is very rare that this happens, so it's likely a momentary glitch in the machine (Windows 7 x64) or something with my local network. Never heard anyone else complain.

Only other MySQL error: http://eq2emulator.net/phpBB3/viewtopic.php?f=76&t=3164


Update: I've been able to reproduce this, somewhat. Seems if I leave PacketAnalyzer open all night long on a log, over 12 hours or so, then without closing it, try and reopen the current log (or any other?) I will get this MySQL error. Perhaps I am losing connection after starting, and ANAL only tries to re-establish connection on start up? I'll look into it while we wait for Scattypoop to return.

Re: BugID: 611 (John Adams) Error Running MySQL Query

Posted: Wed Jul 26, 2017 10:01 pm
by Cynnar
Checking to see if this can be archived.

Re: BugID: 611 (John Adams) Error Running MySQL Query

Posted: Thu Jul 27, 2017 7:58 am
by Ememjr
I get something similar almost every morning, when i open a new packet and didnt restart the the ANAL, to me looks like the anal had opened the connection when first starting, but then when it idle for a long time, the connetion is closing in Mysql, and ANAL is not opening again

Re: BugID: 611 (John Adams) Error Running MySQL Query

Posted: Thu Jul 27, 2017 8:06 am
by Cynnar
Could we add a button, or put in the menu, a way to re-establish the MySQL connection.

Perhaps a check in the code to see if connected to MySQL, then reconnect to MySQL if connection was lost.

Re: BugID: 611 (John Adams) Error Running MySQL Query

Posted: Thu Jul 27, 2017 1:39 pm
by Ememjr
i am sure that would be possible, it almost looks as though the conntection is made when the ANAL is opened and not when the packet log is opened

Re: BugID: 611 (John Adams) Error Running MySQL Query

Posted: Thu Jul 27, 2017 1:53 pm
by Cynnar
So maybe change to have connection open when a packet log is opened then.

Re: BugID: 611 (John Adams) Error Running MySQL Query

Posted: Thu Jul 27, 2017 2:04 pm
by Cynnar
Not at my desktop, but it looks like load file function already has a db connection set up.

Code: Select all

private void LoadFile(string file_name) {
...
//first make sure we're connected to the database
			if (!database.IsConnected()) {
				form_loading.Show();
				form_loading.SetTitle("Connecting to MySQL Server");
				form_loading.SetText("Connecting to " + options.GetHost() + ":" + options.GetPort());
				form_loading.SetValue(0);
				form_loading.SetMax(1);

				database.Connect(options.GetHost(), options.GetDatabase(), options.GetUser(), options.GetPassword(), options.GetPort());
				
				form_loading.Hide();
			}
            new Thread(new ThreadStart(processThread)).Start();
So if I'm reading that correctly each time LoadFile is called (which should be every time a file is opened) then there is a check to see if db is connected.

Like I said I'm on my phone, so I could be missing something.