Issue with MySQL based server
#1

Basicly, my problem is that the server shuts down while loading the MySQL tables.

Quote:

[21:21:25] 430|200|1|0|100|0
[21:21:25] 427|500|1|10|30|0
[21:21:25] 544|1000|1|0|50|0
[21:21:25] 464|10|7|0|20|0
[21:21:25] 501|10|7|0|20|0
[21:21:25] Using existing connection!
[21:21:25] Loading Cars....
[21:21:25] SQL: SELECT carid,modelid,x,y,z,o,color1,color2,respawndelay, factionid, jobid, rentprice, buyable, lockfactionid FROM cars ORDER BY carid ASC
[21:21:25] 1|517|-2034|179|28|271|0|0|3600|0|0|0|0|0

While loading the first carID from the table something happends and the server just shuts down. There is no errors and warnings what so ever in the server log.

Quote:

Exception At Address: 0x7C928C0B



Registers:

EAX: 0x00007974 EBX: 0x00000000 ECX: 0x00000000 EDX: 0x003A0608

ESI: 0x055334F0 EDI: 0x003A0000 EBP: 0x0012FD48 ESP: 0x0012FC8C

EFLAGS: 0x00010217



Stack:

+0000: 0x01159F00 0x05533510 0x00000000 0x00000000

+0010: 0x00000028 0x0012FD00 0x609C443B 0x7FFDE000

+0020: 0x0012FCE0 0x7FFDE000 0x0012FCD4 0x0000001F

+0030: 0x003A41E0 0x0012FD20 0x00000001 0x80000000

+0040: 0x00000000 0x00000000 0x00000000 0x00007974

+0050: 0x055334F0 0x0012FCF4 0x609C4450 0x00037B68

+0060: 0x0012FD10 0x004ACAC8 0x00000000 0x017FA104

+0070: 0x00000000 0x0012FD60 0x609C28B8 0x0012FD20

+0080: 0x0012FD81 0x003A0000 0x055334F0 0x00000000

+0090: 0x003A41E0 0x00000000 0x00000000 0x0101FD60

+00A0: 0x00000006 0x0012FC8C 0x0012F8B0 0x0012FD80

+00B0: 0x7C90E920 0x7C910060 0x00000001 0x0012FD90

+00C0: 0x77C1C2DE 0x003A0000 0x00000000 0x05533510

+00D0: 0x01159F00 0x017FA104 0x00000000 0x003A41E0

+00E0: 0x055220A4 0x00000000 0x7FFFFFFF 0x0012FD5C

+00F0: 0x0012F8B0 0x0012FE5C 0x77C25C94 0x77C02070

+0100: 0xFFFFFFFF 0x0012FDD0 0x609C161B 0x05533510

+0110: 0x03D27FA0 0x00000003 0x0036EE80 0x01159F00

+0120: 0x01159F00 0xC5073000 0x43988000 0x42080000

+0130: 0x00401096 0x00000001 0x05521FA4 0x017FA104

This is taken from the crashlog about the shutdown but I doubt anyone understands it.

Anyhow, does anyone have any idea why this happend or have you might bumped into something just like it. Please post any suggestion or solution you might have since I haven't owned alot of samp servers.

Quote:

public LoadCars()
{
new resultline[1024];
new car[14][64];
new query[256];

ConnectToDatabase();

printf("Loading Cars....");
samp_mysql_real_escape_string("SELECT carid,modelid,x,y,z,o,color1,color2,respawndelay, factionid, jobid, rentprice, buyable, lockfactionid FROM cars ORDER BY carid ASC", query);
printf(" SQL: %s",query);
samp_mysql_query(query);
samp_mysql_store_result();

new carid;
//Load Cars
while(samp_mysql_fetch_row(resultline)==1)
{
printf("%s", resultline);
split(resultline, car, '|');
carid = AddStaticVehicleEx(strval(car[1]), floatstr(car[2]), floatstr(car[3]), floatstr(car[4]), floatstr(car[5]), strval(car[6]), strval(car[7]), strval(car[8]));
VehicleInfo[carid][vSQLId] = strval(car[0]);
VehicleInfo[carid][vModel] = strval(car[1]);
VehicleInfo[carid][vPos_x] = floatstr(car[2]);
VehicleInfo[carid][vPos_y] = floatstr(car[3]);
VehicleInfo[carid][vPos_z] = floatstr(car[4]);
VehicleInfo[carid][vPos_o] = floatstr(car[5]);
VehicleInfo[carid][vColor1] = strval(car[6]);
VehicleInfo[carid][vColor2] = strval(car[7]);
VehicleInfo[carid][vRespawnDelay] = strval(car[8]);
VehicleInfo[carid][vFactionId] = strval(car[9]);
VehicleInfo[carid][vJobId] = strval(car[10]);
VehicleInfo[carid][vRentPrice] = strval(car[11]);
VehicleInfo[carid][vBuyable] = strval(car[12]);
VehicleInfo[carid][vLockFactionId] = strval(car[13]);
new vcmodelid = VehicleInfo[carid][vModel]-MIN_VEHICLEMODELID;
VehicleInfo[carid][vFuel] = VehicleCostInfo[vcmodelid][vcMaxFuel];
VehicleInfo[carid][vOwnerId] = INVALID_PLAYER_ID;
VehicleInfo[carid][vRenting] = INVALID_PLAYER_ID;
if (VehicleInfo[carid][vLockFactionId] > 0)
{
VehicleInfo[carid][vLocked] = 1;
LockFCar(carid);
}
}
//for(new carz = 1; carz <= carid; carz++) LoadVehicleMods(carz);
return 1;
}

Edit: Added the pwn code for the process.
Reply
#2

It can happen because of bugged native. Ask in plugin's topic.
Reply
#3

Switch to the alternative MySQL plugin(g-stylezzz). Atleast that one has a logging feature.
Reply
#4

This server is only supporting the MySQL plugin made by Adrenaline. It would be really hard to replace everything especially when the server has 29 tables and atleast 8k lines natives in the gamemod. Sure that would actually fix it and isn't there another option?

If you have any experience with such things and think you might be able to sovle this mystery of mine with additional information, please PM me.
Reply
#5

I had the exact same problem you are having. I found that this works as a temporary solution:

Quote:
Originally Posted by Blantas ;P*~
If you are using a Windows platform, this is the way to go. I used this and it works perfectly. Just that it is an earlier version of the plugin and will lack features which were implemented in the v0.15 release.

BTW - I also answered this question of yours in Adrenaline's topic.

Let me know if it works. Also, if you are using Linux, scroll through the pages of the topic, someone posted an earlier version of that as well.
Reply
#6

It actually did help, thanks alot.

But when you sovle an error another one occurs.

Its something wrong in this code:

Quote:

public LoadGroups()
{
new resultline[1024];
new permission[2][255];
new query[256];

ConnectToDatabase();

printf("Loading Permission Groups...");
format(query, sizeof(query), "SELECT id, name FROM groups");
printf(" SQL: %s",query);
samp_mysql_query(query);
samp_mysql_store_result();
new text[255];
new permissioncount;
while(samp_mysql_fetch_row(resultline)==1)
{
printf("%s", resultline);
split(resultline, permission, '|');
gGroups[permissioncount][gSQLId] = strval(permission[0]);
text = unreal_escape_string(permission[1]);
strmid(gGroups[permissioncount][gName],text, 0, strlen(text), 256);
// LoadGroupPermissions(gGroups[permissioncount][gSQLId]);
permissioncount++;
}
samp_mysql_free_result();
for(new i=0;i<100;i++)
{
if(gGroups[i][gSQLId])
{
LoadGroupPermissions(gGroups[i][gSQLId]);
}
}
return 1;
}

It should be right but maybe there is something wrong, anyone with an eye for details?
Reply
#7

Unless you've changed the code in some sort of way (not saying you have), it should work fine.

What I did is clean the entire database before using the game mode. That means emptying the 'groups' and 'group_permissions' tables, and possibly some others. Other than that I can't really help you here. It may cause a real inconvenience for you, but this is the method I followed and it's working just fine for me. If you do decide to use the above, I would recommend dumping the SQL file, or creating a backup before you do so.

What exactly does your server console output when it crashes exactly? By knowledge I'm guessing it loads a few lines then crashes, much like the other error, but I did not receive this when attempting the same thing myself.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)