Page 1 of 2

EQ2World Won't Load

Posted: Sat Jan 30, 2016 1:20 am
by Gilraak
Title is misleading, it loads, but all it does and logs is this:

- I am using EQWorld_x64. Same behavior with EQWorld

02:48:28 I Init: Starting EQ2Emulator WorldServer...

And then exits the command prompt.

Here is my world_db configuration:

I currently host a dedicated db VM inside of Hyper-V and verified port 3306 is open. I can remotely connect and granted ALL to my everquest2 user on eq2.

```
[Database]
host=67.227.240.121
user=everquest2
password=omitted
database=eq2
```

Here is my LoginServer, note it is not 100% filled out, I'm testing a basic connection at the moment and would expect to see an error:

```
[LoginServer]
loginserver=eq2emulator.net
loginport=9100
worldname=Unrest
worldaddress=67.227.240.120
# internalworldaddress=
worldport=9000
locked=false
account=minilogin
password=minilogin
autotableupdates=never
autotableverbose=false
autotabledata=false

[WorldServer]
Defaultstatus=
Unavailzone=

[UpdateServer]
updateserveraddress=
updateserverport=

[LoginConfig]
ServerMode=StandAlone
ServerPort=9100
```

If anyone has any idea because I'm stumped. I'd expect an error or something. I am using the pre-compiled binaries from the SVN. This is a Windows Server 2012 instance, dedicated hardware.

Re: EQ2World Won't Load

Posted: Sat Jan 30, 2016 1:33 am
by Jabantiz
Do you have the struct files in the same folder as the exe? They are located at trunk/structs on the svn.

Re: EQ2World Won't Load

Posted: Sat Jan 30, 2016 1:45 am
by Gilraak
Everything is accounted for I believe:

http://postimg.org/image/elpoe5409/



I was missing the EQ2_Structs and I re-downloaded everything else. It still opens and says the same as before then closing. I forgot to mention I turned all logging to 9 as well.

Re: EQ2World Won't Load

Posted: Sat Jan 30, 2016 1:54 am
by Gilraak
You know what.... I'm pretty sure I'm missing some stuff, like Lua and possibly the MySQL lib, the wiki doesn't say much but I vaguely remember...

Re: EQ2World Won't Load

Posted: Sat Jan 30, 2016 2:11 am
by Jabantiz
You shouldn't need those libs if you are just running the exe, you do need them if you are compiling and we include them on svn.

As you only get that one log it makes me believe it is a db connection issue but that should give off more logs if it has problems, by chance do the log files contain more info, if not you may need to run the server through command promt to try and get more log's

Re: EQ2World Won't Load

Posted: Sat Jan 30, 2016 10:17 am
by Gilraak
Sadly nothing else the logs but what I posted. It's a very odd issue.

I was thinking database but it usually spits out an error. I also did open from a command prompt, but it runs, says starting eq2world... then jumps back to the prompt.

Re: EQ2World Won't Load

Posted: Sat Jan 30, 2016 11:02 am
by Gilraak
You were spot on, it is a problem with my dedicated database install.

I reimported the DB locally, fixed a few things that broke and all is working. Thank you for the help!

Re: EQ2World Won't Load

Posted: Sat Jan 30, 2016 5:23 pm
by Jabantiz
Glad you figured it out, odd that it is not giving any errors, do you know what the problem was? I will have to look at that code and see where it errors out without logs.

Re: EQ2World Won't Load

Posted: Fri Jan 26, 2018 11:15 am
by allahn
Mine does the same, but I don't know how to import the db file into the dedicated db, and I cannot for the life of me find instructions for how to do so. I followed the wiki for a Windows Server like it was Biblical Truth, and it never mentions doing that.

Any ideas?

I will say this: Thanks for the super fun project. I have an EQ server run from an old laptop in my networking closet, but I just acquired a few cycled out Dell Poweredge 1950 servers and a hoss-daddy 2900 with 32gigs of RAM and 4 460gb 15krpm SAS drives, so this seems like a great first project. I'd like to run both the EQ and the EQ2 servers from one of those old servers, but will I need to do so with separate VMs because of port issues, or will one machine with two different NICs work for 2 servers?

Re: EQ2World Won't Load

Posted: Fri Jan 26, 2018 11:11 pm
by Jabantiz
In a case like originally posted it is usually a DB connection issue, basically the server is failing to connect to the DB at startup and closing. All I can really recommend is double checking the user/pass/db name and making sure it all valid, also checking with a tool like HeidiSQL with the same info and see if that connects.
allahn wrote: Fri Jan 26, 2018 11:15 am I'd like to run both the EQ and the EQ2 servers from one of those old servers, but will I need to do so with separate VMs because of port issues, or will one machine with two different NICs work for 2 servers?
EQ2Emu allows you to set whatever ports you want and the client will use what the server tells it to so you can change it to anything to prevent the conflicts with EQEmu.

Re: EQ2World Won't Load

Posted: Mon Jan 29, 2018 3:27 pm
by John Adams
Same exact thing I was telling you about the other night [mention]Jabantiz[/mention] - on 3 completely separate machines, eq2world starts and abruptly ends with a Catch Signal 2. That, of course, is not in the world Logs because it is a system message not a logger message.

Tried on my old VGODev machine (Ubuntu 16.04.3 LTS), which worked fine a few months back (before upgrading to 16.04.3).
Tried on my old VGOTC and VGOTarg windows 7 machines, same thing each with a downloaded exe from SVN (so I can't blame Linux this time)
EQ2Dev VM is still Ubuntu 14.04 I think, so it's no surprise it still works there.

That same EXE works fine on my Windows 10 machine, as does compiling and running release or debug on my windows 10 machine. So if we're all on Windows 10 now, perhaps it deserves looking into closer than waving it off as "works on my machine" :lol:

Hopefully I'll find time this week to step through debugging on one of my failing Windows machines, but first I have to spend a week installing VS2015, because 2012 no longer builds EQ2Emu.

Re: EQ2World Won't Load

Posted: Mon Jan 29, 2018 4:27 pm
by Jabantiz
In the cases listed above it is almost always a DB connection issue, the signal 2 you reported kind of through me off after looking up what signal 2 is.
John Adams wrote: Mon Jan 29, 2018 3:27 pm So if we're all on Windows 10 now, perhaps it deserves looking into closer than waving it off as "works on my machine" :lol:
Works on my machine, my Linux vm (16.04.3), and the eq2emulator server had no problems with the code.

The fact that no logs are produced is annoying, I think they get put in a queue but never get printed out before the server shuts down, need to find a way to flush the queue so we can get an idea of what is going on assuming there are error logs in it.

Re: EQ2World Won't Load

Posted: Mon Jan 29, 2018 8:20 pm
by Zcoretri
John Adams wrote: Mon Jan 29, 2018 3:27 pm So if we're all on Windows 10 now, perhaps it deserves looking into closer than waving it off as "works on my machine" :lol:
I for one have not moved to Windows 10 yet...holding out as long as I can.

Re: EQ2World Won't Load

Posted: Mon Jan 29, 2018 9:20 pm
by John Adams
Jabantiz wrote: Mon Jan 29, 2018 4:27 pm The fact that no logs are produced is annoying, I think they get put in a queue but never get printed out before the server shuts down, need to find a way to flush the queue so we can get an idea of what is going on assuming there are error logs in it.
I'm fairly sure it's not getting far into main() at all. Soon as I get a chance, I'll debug on a failing machine and give you exactly what's happening, since nothing bad ever happens to you :)

Re: EQ2World Won't Load

Posted: Mon Jan 29, 2018 10:20 pm
by Jabantiz
Quick look at the code says it is a DB issue.

Code: Select all

LogWrite(INIT__INFO, 0, "Init", "Starting EQ2Emulator WorldServer...");
	//int32 server_startup = time(NULL);

	//remove this when all database calls are using the new database class
	database.Init();
We get the top log, next is database.Init() and this is where it is failing. If we go to that function we see this segment of code

Code: Select all

if (!Open(host, user, passwd, database,port, &errnum, errbuf)) 
	{
		LogWrite(DATABASE__ERROR, 0, "DB", "Failed to connect to database: Error: %s", errbuf);
		HandleMysqlError(errnum);
		exit(1);
	}
	
What we are interested in here is the HandleMysqlError() looking at that we have this a switch case calling AddEQEMuError

Code: Select all

void Database::HandleMysqlError(int32 errnum) {
	switch(errnum) {
		case 0:
			break;
		case 1045: // Access Denied
		case 2001: {
			AddEQEMuError(EQEMuError_Mysql_1405, true);
			break;
		}
		case 2003: { // Unable to connect
			AddEQEMuError(EQEMuError_Mysql_2003, true);
			break;
		}
		case 2005: { // Unable to connect
			AddEQEMuError(EQEMuError_Mysql_2005, true);
			break;
		}
		case 2007: { // Unable to connect
			AddEQEMuError(EQEMuError_Mysql_2007, true);
			break;
		}
	}
}
Notice the second parameter is always true, this refers to the iExitNow parameter in that function, so if we go to that function at the bottom we have this

Code: Select all

if (iExitNow)
		CatchSignal(2);
		
This is the signal 2. And if you notice in the database.init right after HandleMysqlError() that triggers the signal 2 is an exit(1) killing the app.