BugID: 611 (John Adams) Error Running MySQL Query

Bug forum for In-House and 3rd-Party tools.

Moderator: Team Members

Forum rules
READ THE STICKY ON PROPER BUG SUBMISSION FORMAT BEFORE POSTING.
Post Reply
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

BugID: 611 (John Adams) Error Running MySQL Query

Post by John Adams » Sat Jan 05, 2013 12:29 pm

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

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

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

Post by John Adams » Sat Jan 05, 2013 2:54 pm

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.

User avatar
Cynnar
Project Leader
Posts: 738
Joined: Sat Sep 27, 2014 1:22 am
EQ2Emu Server: Eq2emulator
Characters: Vlash
Veinlash
Taragak
Cynnar

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

Post by Cynnar » Wed Jul 26, 2017 10:01 pm

Checking to see if this can be archived.
[ 01000011 01111001 01101110 01101110 01100001 01110010 ]

Follow on:
Twitter Facebook

Contact me:
PM Discord chat email

Hardware: the parts of a computer that can be kicked

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

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

Post by Ememjr » Thu Jul 27, 2017 7:58 am

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

User avatar
Cynnar
Project Leader
Posts: 738
Joined: Sat Sep 27, 2014 1:22 am
EQ2Emu Server: Eq2emulator
Characters: Vlash
Veinlash
Taragak
Cynnar

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

Post by Cynnar » Thu Jul 27, 2017 8:06 am

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.
[ 01000011 01111001 01101110 01101110 01100001 01110010 ]

Follow on:
Twitter Facebook

Contact me:
PM Discord chat email

Hardware: the parts of a computer that can be kicked

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

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

Post by Ememjr » Thu Jul 27, 2017 1:39 pm

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

User avatar
Cynnar
Project Leader
Posts: 738
Joined: Sat Sep 27, 2014 1:22 am
EQ2Emu Server: Eq2emulator
Characters: Vlash
Veinlash
Taragak
Cynnar

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

Post by Cynnar » Thu Jul 27, 2017 1:53 pm

So maybe change to have connection open when a packet log is opened then.
[ 01000011 01111001 01101110 01101110 01100001 01110010 ]

Follow on:
Twitter Facebook

Contact me:
PM Discord chat email

Hardware: the parts of a computer that can be kicked

User avatar
Cynnar
Project Leader
Posts: 738
Joined: Sat Sep 27, 2014 1:22 am
EQ2Emu Server: Eq2emulator
Characters: Vlash
Veinlash
Taragak
Cynnar

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

Post by Cynnar » Thu Jul 27, 2017 2:04 pm

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.
[ 01000011 01111001 01101110 01101110 01100001 01110010 ]

Follow on:
Twitter Facebook

Contact me:
PM Discord chat email

Hardware: the parts of a computer that can be kicked

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests