preister / Celts_Altis_Life

Celts Clan Arma 3 Altis Life RPG Multiplayer mission
6 stars 5 forks source link

Strange SQL error on my local server #65

Closed preister closed 9 years ago

preister commented 9 years ago

just checking if you have seen this already on the life server @CeltS-Dubbz261 :

 0:09:07 Attempt to override final function - life_sql_id
 0:09:20 Error in expression <RE owned='1'",2] call DB_fnc_asyncCall) select 0;

for [{_x=0},{_x<=_count},{_x=>
 0:09:20   Error position: <select 0;

for [{_x=0},{_x<=_count},{_x=>
 0:09:20   Error select: Type Number, expected Array,Config entry
 0:09:20 File life_server\Functions\Housing\fn_initHouses.sqf, line 9
 0:09:21 "------------- Client Query Request -------------"
 0:09:21 "QUERY: SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, civ_licenses, arrested, civ_gear FROM players WHERE playerid='76561197970700911'"
 0:09:21 "Time to complete: 0.0239868 (in seconds)"
 0:09:21 "Result: 1"
 0:09:21 "------------------------------------------------"
 0:09:21 Error in expression <D,false,true] spawn life_fnc_MP;
};

if(count _queryResult == 0) exitWith {
[[],>
 0:09:21   Error position: <count _queryResult == 0) exitWith {
[[],>
 0:09:21   Error count: Type Number, expected Array,Config entry
 0:09:21 File life_server\Functions\MySQL\fn_queryRequest.sqf, line 45
 0:09:39 Client: Remote object 2:3295 not found
 0:09:39 Client: Remote object 2:3296 not found
 0:09:39 Client: Remote object 2:3297 not found
 0:09:39 Error in expression <};
{
_pos = call compile format["%1",_x select 1];
_house = nearestBuilding _pos>
 0:09:39   Error position: <select 1];
_house = nearestBuilding _pos>
 0:09:39   Error select: Type Number, expected Array,Config entry
 0:09:39 File life_server\Functions\Housing\fn_houseCleanup.sqf, line 14
 0:09:40 Warning: Cleanup player - person 2:1905 not found
preister commented 9 years ago

I put a fix for this in, hasn't broken anything on my local so I would say its good. The issue seems to be that its trying to overwrite a constant which in this case is the SQL session id which shouldn't change after the mod has initialized.

preister commented 9 years ago

Before I forget to mention it the fix for this is on the server side so requires the life_server.pbo to be build, I tested the scripts and all works fine.

Duubz commented 9 years ago

Strange. I hadn't noticed it before, but then again I only check the logs if I have a specific problem usually.

preister commented 9 years ago

Onz had some issues logging in before and as far as I could read his murmuring it looked quite similar to the user experience I had on the client when this happened ... so this whole thing is mostly based on suspicions :(

Duubz commented 9 years ago

I tend not to believe stuff until i see it for myself due to the large amount of issues that have ended up being user error :P

preister commented 9 years ago

Oh well PEBCAK is always the best ;)

preister commented 9 years ago

Part of #68

preister commented 9 years ago

Added in some logging while removing my Fix again and and it looks like this issue is related to some snaffuu in the DB_fnc_asyncCall:

"SERVER DEBUG: ASYNC Query Result: [1,[1,[[0]]]]"
Error in expression <RE owned='1'",2] call DB_fnc_asyncCall) select 0;

for [{_x=0},{_x<=_count},{_x=>
  Error position: <select 0;

for [{_x=0},{_x<=_count},{_x=>
  Error select: Type Number, expected Array,String,Config entry
File life_server\Functions\Housing\fn_initHouses.sqf, line 9
"SERVER DEBUG: ASYNC Query Result: [1,[1,[["76561197970700911","SrgFlip",1250,4.67825e+007,"0","0","[[`license_civ_driver`,1],[`license_civ_air`,1],[`license_civ_heroin`,0],[`license_civ_marijuana`,0],[`license_civ_gang`,0],[`license_civ_boat`,1],[`license_civ_oil`,0],[`license_civ_dive`,0],[`license_civ_truck`,1],[`license_civ_gun`,1],[`license_civ_rebel`,0],[`license_civ_coke`,0],[`license_civ_diamond`,0],[`license_civ_copper`,0],[`license_civ_iron`,0],[`license_civ_platinum`,0],[`license_civ_salt`,0],[`license_civ_cement`,0],[`license_civ_home`,1],[`license_civ_meth`,0],[`license_civ_moonshine`,0]]",0,"[`U_C_Poloshirt_blue`,``,``,``,``,[`ItemMap`,`ItemCompass`,`ItemWatch`],``,`hgun_ACPC2_F`,[],[`9Rnd_45ACP_Mag`],[],[],[],[],[],[``,``,``],[]]"]]]]"
"------------- Client Query Request -------------"
"QUERY: SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, civ_licenses, arrested, civ_gear FROM players WHERE playerid='76561197970700911'"
"Time to complete: 0.0529785 (in seconds)"
"Result: 1"
"------------------------------------------------"
Error in expression <D,false,true] spawn life_fnc_MP;
};

if(count _queryResult == 0) exitWith {
[[],>
  Error position: <count _queryResult == 0) exitWith {
[[],>
  Error count: Type Number, expected Array,String,Config entry
File life_server\Functions\MySQL\fn_queryRequest.sqf, line 45

it looks like the query result returned is not which should be returned to the call.

preister commented 9 years ago

This might be fixed in the .8 update but I want to keep an eye on this, DB snaffuuu is no fun :(

preister commented 9 years ago

and yes indeed that is the case, mode 2 Queries are getting mode 1 results as it seems.

"------------- Async Query : 2 -------------"
"QUERY: SELECT COUNT(*) FROM houses WHERE owned='1'"
"Result: 1"
"-------------------------------------------"
Error in expression <RE owned='1'",2] call DB_fnc_asyncCall) select 0;

for [{_x=0},{_x<=_count},{_x=>
  Error position: <select 0;

for [{_x=0},{_x<=_count},{_x=>
  Error select: Type Number, expected Array,String,Config entry
File life_server\Functions\Housing\fn_initHouses.sqf, line 9
"------------- Async Query : 2 -------------"
"QUERY: SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, civ_licenses, arrested, civ_gear FROM players WHERE playerid='76561197970700911'"
"Result: 1"
"-------------------------------------------"
"------------- Client Query Request -------------"
"QUERY: SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, civ_licenses, arrested, civ_gear FROM players WHERE playerid='76561197970700911'"
"Time to complete: 0.0280151 (in seconds)"
"Result: 1"
"------------------------------------------------"
Error in expression <D,false,true] spawn life_fnc_MP;
};

if(count _queryResult == 0) exitWith {
[[],>
  Error position: <count _queryResult == 0) exitWith {
[[],>
  Error count: Type Number, expected Array,String,Config entry
File life_server\Functions\MySQL\fn_queryRequest.sqf, line 45

time to look at .8 and see if its fixed there.

preister commented 9 years ago

On 2nd though I'm taking all of this back .... and we are back at square 1

preister commented 9 years ago

Now we are getting somewhere, the result is correct but we still end up returning something wrong.

"------------- Async Query : 2 -------------"
"SQLID: {4720}"
"QUERY: SELECT COUNT(*) FROM houses WHERE owned='1'"
"Result: [1,[1,[[0]]]]"
"Return: 1"
"-------------------------------------------"
Error in expression <RE owned='1'",2] call DB_fnc_asyncCall) select 0;

for [{_x=0},{_x<=_count},{_x=>
  Error position: <select 0;

for [{_x=0},{_x<=_count},{_x=>
  Error select: Type Number, expected Array,String,Config entry
File life_server\Functions\Housing\fn_initHouses.sqf, line 9
"------------- Async Query : 2 -------------"
"SQLID: {4720}"
"QUERY: SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, civ_licenses, arrested, civ_gear FROM players WHERE playerid='76561197970700911'"
"Result: [1,[1,[["76561197970700911","SrgFlip",10402,4.67804e+007,"0","0","[[`license_civ_driver`,1],[`license_civ_air`,1],[`license_civ_heroin`,0],[`license_civ_marijuana`,0],[`license_civ_gang`,0],[`license_civ_boat`,1],[`license_civ_oil`,0],[`license_civ_dive`,0],[`license_civ_truck`,1],[`license_civ_gun`,1],[`license_civ_rebel`,0],[`license_civ_coke`,0],[`license_civ_diamond`,0],[`license_civ_copper`,0],[`license_civ_iron`,0],[`license_civ_platinum`,0],[`license_civ_salt`,0],[`license_civ_cement`,0],[`license_civ_home`,1],[`license_civ_meth`,0],[`license_civ_moonshine`,0]]",0,"[`U_C_Poloshirt_blue`,``,``,``,``,[`ItemMap`,`ItemCompass`,`ItemWatch`],``,`hgun_ACPC2_F`,[],[`9Rnd_45ACP_Mag`],[],[],[],[],[],[``,``,``],[]]"]]]]"
"Return: 1"
"-------------------------------------------"
"------------- Client Query Request -------------"
"QUERY: SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, civ_licenses, arrested, civ_gear FROM players WHERE playerid='76561197970700911'"
"Time to complete: 0.0379944 (in seconds)"
"Result: 1"
"------------------------------------------------"
Error in expression <D,false,true] spawn life_fnc_MP;
};

if(count _queryResult == 0) exitWith {
[[],>
  Error position: <count _queryResult == 0) exitWith {
[[],>
  Error count: Type Number, expected Array,String,Config entry
File life_server\Functions\MySQL\fn_queryRequest.sqf, line 45
preister commented 9 years ago

And I found it, the extDBVersion variable does not get set properly on reloading ...

"------------- Async Query : 2 -------------"
"SQLID: {4918}"
"QUERY: SELECT COUNT(*) FROM houses WHERE owned='1'"
"Result: [1,[1,[[0]]]]"
"Return: 1"
"MultiArr: false"
"extDBVer: "
"-------------------------------------------"

This is how it should look like:

"------------- Async Query : 2 -------------"
"SQLID: {4918}"
"QUERY: SELECT COUNT(*) FROM houses WHERE owned='1'"
"Result: [1,[[0]]]"
"Return: [0]"
"MultiArr: false"
"extDBVer: 17"
"-------------------------------------------"

there is a check for this but its at the wrong place it seems.

preister commented 9 years ago

After all this work I've realized this will be all a non issue in .8 ... everything switches over to DB_RAW_V2 ... no more support for extDB version less than 14.