IS YOUR SERVER BROKEN SINCE 1.64 UPDATE? READ THIS #104

Open
BoGuu opened this Issue Sep 22, 2016 · 157 comments

Projects

None yet
@BoGuu
Contributor
BoGuu commented Sep 22, 2016 edited

Please make the changes from this commit: db66e54, to your life_server/Functions/MySQL/fn_mresArray.sqf. If you use a headless client, change the relevant file in life_hc also.

You can thank @tkcjesse

Update:

If you have malformed entries in your DB (contains ``) then replace your mresToArray with the following:

http://hastebin.com/omikofajej.cpp

https://gist.github.com/BoGuu/c552b652f752378f06a42c809150032e

Over time they should fix themselves, and you can revert back to the original.

@BoGuu BoGuu added the READ ME label Sep 22, 2016
@Jawshy
Collaborator
Jawshy commented Sep 22, 2016

More caps, please. :Kappa:

@setoy
Contributor
setoy commented Sep 22, 2016

Hmm, have applied this to my server but the error still persists... Same error in the log files.

@tkcjesse
Contributor
tkcjesse commented Sep 22, 2016 edited

I mean did you clear the column if you already joined?

Like if the column still has `` you need to fix that lmfao.

@DarkSilencerZA Can you confirm this fixed it for 4.5? As this solution for me is currently running on 3 live servers just fine however they're using 3.1.4.8 but have the exact same code for licenses.

@setoy
Contributor
setoy commented Sep 22, 2016 edited

Yeah, I've cleared the columns.

It appears on our modded server as well as on our clean one:
http://hastebin.com/eyepabiget.vbs

I've also run the update script and have seen that while the server is running, more rows are getting updated. So even when fixing all columns, 10 minutes later there are more malformed cells. Which indicates there's still that bug somewhere.

@riskingfusion

When ever I use that query code and execute it, it works but then when they re-join the server it re-appears with the '','' instead of ',' ?? Any fixes ?

@tkcjesse
Contributor

If you're using the HC you need to update that file as well...

@tkcjesse
Contributor

@setoy your error clearly says : DB_fnc_mresToArray

@vabene1111
vabene1111 commented Sep 22, 2016 edited

Any ideas what the reason for this could be:

2016/09/22, 21:26:45 Error in expression <m 0 to (count _old)-1 do { _data = _old select _i; _old set[_i,[_data select 0, > 2016/09/22, 21:26:45 Error position: <select _i; _old set[_i,[_data select 0, > 2016/09/22, 21:26:45 Error Generic error in expression 2016/09/22, 21:26:45 File life_server\Functions\MySQL\fn_queryRequest.sqf, line 70 `

We Updated the mresArray functions and restored the original Database (so no double quotes or anything broken) .. it kinda looks like the array has a different format ? running v4.4

@tkcjesse
Contributor
@riskingfusion

@tkcjesse I have never had a headless client file so I assume I am not using it. But is there any other ideas that may cause it to almost back track to the '','' instead of ',' even though I used that query code ?

@tkcjesse
Contributor

I mean what version are you using?... Look for the stupid str shit
Run it in debug to test if it's the issue and if it is, reform the data. Simple.

@riskingfusion

We are using 4.4

@riskingfusion

Dont have to be so rude if you cant be arsed to help fuck off!

@DarkSilencerZA
Contributor

It works fine for me. I'm using as close to the main build as possible, but just a ton of customized stuffs.

4.4 seems a little outdated.

@riskingfusion

@DarkSilencerZA Yeah I had the issue when first updated I used the query code, It works then you disconnect re-log to the server and it is like it back tracks it self so you come back naked. So I am wondering if there was anything else you edited ?

@setoy
Contributor
setoy commented Sep 22, 2016 edited

your error clearly says : DB_fnc_mresToArray

Yeah, but that file wasn't changed / fixed / whatever

@tkcjesse
Contributor

Lmao. K.

@BoGuu
Contributor
BoGuu commented Sep 22, 2016

If you are having problems post your mresArray and mresToArray, please

@SimZor
Contributor
SimZor commented Sep 22, 2016

I get these errors when joining after applying @tkcjesse fix.

http://hastebin.com/xivobukafi.bash

@ace16huey
ace16huey commented Sep 22, 2016 edited

That SQL command is changing all the empty strings to have one ` instead of the 2 needed.

@riskingfusion

@ace16huey Some people are having the problem when they use that when you re-log to the server all them empty strings come back and make you naked again

@ace16huey

@riskingfusion I had a player that couldn't spawn in as a civ, I am gonna dump the table and replace them that way and hope for the best. I already messed up the licenses column by working to quick and not checking my work.

@riskingfusion

@ace16huey Oh right. Thats why you make backups :P

@rebornfuel
rebornfuel commented Sep 22, 2016 edited

any news on a fix or 4.4r3? as the current changes to fn_mresArray.sqf does not fix a thing

@ace16huey

@riskingfusion Had a back up from a couple days ago, applied it and it got corrupted in the process... Arma updates give me the worst luck D:

@riskingfusion

@rebornfuel not currently I think most of us are waiting on a fix for a similar issue

@riskingfusion

@ace16huey I think they give everyone bad luck xD

@harmdhast
Contributor

3.1.4.8
players table fix.

UPDATE `players` 
 SET `cop_licenses` = replace(cop_licenses, '``', '`'),
 `civ_licenses` = replace(civ_licenses, '``', '`'),
 `med_licenses` = replace(med_licenses, '``', '`'),
 `aliases` = replace(aliases, '``', '`'),
 `cop_gear` = replace(cop_gear, '``', '`'),
 `civ_gear` = replace(civ_gear, '``', '`'),
 `med_gear` = replace(med_gear, '``', '`')
    WHERE `aliases` LIKE '"[``%'
@ace16huey

That might break more then fix to be honest @harmdhast. did that to a couple columns and it cause all the empty strings to break and what not.

@harmdhast
Contributor

Please note the Where.

@riskingfusion

@harmdhast I am going to test it on my server now

@rebornfuel

dont bother it only fixes it for seconds, the issue comes back

@harmdhast
Contributor

The mresarray fix works like a charm.

@riskingfusion

@harmdhast What version you on ?

@rebornfuel

what version you on?

@rebornfuel

4.4r3 it does nothing

@riskingfusion

I am on 4.4 and it just comes back after re-log

@harmdhast
Contributor

@rebornfuel Are you sure you applied the db66e54 ?
Worked on 4.4r3 AND v3.1.4.8

@rebornfuel

yeah its applied im taking my server down to test

@ace16huey
ace16huey commented Sep 22, 2016 edited

@rebornfuel Okay, I see what you did now, the where would need to be in the selected column,

UPDATEplayersSETciv_gear= replace(civ_gear, '``', '')
WHERE civ_gear LIKE '"[``%'`

fixed it for that specific column. I don;t have much knowledge on SQL so thank you.

Edit: rip. read through to quick

@harmdhast
Contributor

Basicly the SQL that I provided checks the aliases column if it is corrupted then fixes the entire line.

@harmdhast
Contributor

Since I only had a player table corrupted I can't provide any more scripts for other versions nor tables

@ace16huey

Thats the only table I did do it to, I am about to give a link to 2 pics, then first being before I apply that code

then after

Can you see the issue? Its breaking the empty strings

@harmdhast
Contributor
harmdhast commented Sep 22, 2016 edited

Yeah, that's a v4 table right ? The script I provided is only for v3 since here you have to manage when it's

[`` or Blaba`` 

And I don't have a table to test so, I only did it for v3. Or you "fixed" it uncompletely and my script fucks up.

@ace16huey

This is a v3 table. 3.1.4.8 to be exact. But I will look into it more

@harmdhast
Contributor

That's strange did you tried to fix it before applying my script ? It's not supposed to be only double quotes.

@ace16huey

I have done so many things to it, that I lost track, I am gonna revert and apply the fix again to see if I messed something up

@harmdhast
Contributor

And sadly Mysql does not support regex replace.
That why you don't make databases like a web developper when you make a mission used by a whole fukin community.

@setoy
Contributor
setoy commented Sep 22, 2016

You could dump the DB and do regex replaces in Notepad++ or such (:

@harmdhast
Contributor
harmdhast commented Sep 22, 2016 edited

Yeah but this should never happen. And ppl should be aware of encoding and such things when dumping dbs. Just to say that you never dump a database to replace strings. Just think about 10k entries databases (and that's not much)

@angryfatty

we got the database fixed but we have a problem with whitelisting as cops the host can join as cop but when I join on the server after whitelisting I spawn naked without spawn screen but when I go back to civ it works fine any suggestions

@BoGuu
Contributor
BoGuu commented Sep 22, 2016

@setoy what exactly is your error?
@riskingfusion You haven't applied the fix

@harmdhast
Contributor

@angryfatty
You didn't fixed the cop column. Check the integrity of the cop column or reset it to the default

"[]"
@JedINyte

Running a 4.4 server (not r3) none of the fixes above fix the issue of spawning with no gear or licenses :( It initially works, but as soon as you leave the server and rejoin (lobby or server list) the columns re write the '' into the database.

@BoGuu
Contributor
BoGuu commented Sep 22, 2016

@JedINyte Post your mres (array) functions, and a snap shot of your DB.

@JedINyte

Hello Boguu, im fairly new to all this, never had to delve this deep into the database before: mresarray:

` /*
File: fn_mresArray.sqf
Author: Bryan "Tonic" Boardwine";

 Description:
 Acts as a mres (MySQL Real Escape) for arrays so they
 can be properly inserted into the database without causing
 any problems. The return method is 'hacky' but it's effective.

*/
private ["_array"];
_array = [_this,0,[],[[]]] call BIS_fnc_param;
_array = str _array;
_array = toArray(_array);

for "_i" from 0 to (count _array)-1 do
{
_sel = _array select _i;
if ((_i != 0 && _i != ((count _array)-1))) then
{
if (_sel isEqualTo 34) then
{
_array set[_i,96];
};
};
};

str(toString(_array));`

mres to array:

`/*
File: fn_mresToArray.sqf
Author: Bryan "Tonic" Boardwine";
Description:
Acts as a mres (MySQL Real Escape) for arrays so they
can be properly inserted into the database without causing
any problems. The return method is 'hacky' but it's effective.
*/
private["_array"];
_array = [_this,0,"",[""]] call BIS_fnc_param;
if (_array isEqualTo "") exitWith {[]};
_array = toArray(_array);

for "_i" from 0 to (count _array)-1 do
{
_sel = _array select _i;
if (_sel == 96) then
{
_array set[_i,39];
};
};

_array = toString(_array);
_array = call compile format["%1", _array];
_array;`

what do you mean by a snapshot of DB?

@tkcjesse
Contributor

I assume the ' at the start of that file and end on jedi is an attempt at markdown...

Also you guys need to make sure you're not doing the sql update while that player is on the server.... hope thats obvious...

@tkcjesse
Contributor

Hope we can all now learn why its important to test arma updates on a test instance and db prior to updating a live production server... and why doing a backup is necessary before hand.

@JedINyte

The ' at the start and end is where i tried to add it as code on here lol (the little <> box)!! I thought it would put it in a neat box, but it just displayed as is with the' at each end. The player isn't on the server when updating the SQL :)

@setoy
Contributor
setoy commented Sep 23, 2016

@boguu 4.4R3

@Jawshy
Collaborator
Jawshy commented Sep 23, 2016

If one is going to post code then please remember to format it. See Mastering Markdown → Examples → Code.

if (isAwesome){
  return true
}

If one is going to paste a lot of code then please upload it as a file to GitHub instead.

@Jawshy
Collaborator
Jawshy commented Sep 23, 2016 edited

@JedINyte, one backtick ` is for single-line code. Three backticks ``` above and below are for multi-line code blocks. Hope that clears it up.

@Gentism
Gentism commented Sep 23, 2016

im still having the issue with db after doing the mresarray fix anyone help??

@harmdhast
Contributor

@Gentism You need to fix your database as well. Either restore a backup or look for some little scripts in this issue thread.

@SimZor
Contributor
SimZor commented Sep 23, 2016

@rebornfuel as @tkcjesse said. Why it only works for seconds is because you still have players on your server while updating the MySQL entries.

Just shut your server down, update the tables and then connect and it will work. At least for that issue.

@xProlithium

But we still haven't pinpointed the issue itself or what is causing it?

@Jawshy
Collaborator
Jawshy commented Sep 23, 2016

@xProlithium, str on the Bohemia Interactive Community Wiki:

... Since Arma 3 v1.63.137891 this command will correctly escape all " inside a string:

str command does not escape nested double-quotes for strings on the Bohemia Interactive Feedback Tracker.

@SimZor
Contributor
SimZor commented Sep 23, 2016

I just stumbled upon another issue and that is that as soon as you open your house crates everything and then log back in everything is gone.

See error log http://hastebin.com/xivobukafi.bash

@Jawshy
Collaborator
Jawshy commented Sep 23, 2016

@SimZor, it is the same issue; it is just affecting a different table.


Reference: #81

@xProlithium

I have an older version of tonic's mres so not only am I somewhat lost and how to fix it, I feel in the dark due to the version of the files as well.

@Jawshy
Collaborator
Jawshy commented Sep 23, 2016

@xProlithium, attach a copy of your fn_mresArray.sqf to a comment.

@xProlithium
xProlithium commented Sep 23, 2016 edited

@Jawshy

private["_array"];
_array = [_this,0,[],[[]]] call BIS_fnc_param;
_array = str(str(_array));
_array = toArray(_array);

for "_i" from 0 to (count _array)-1 do
{
_sel = _array select _i;
if((_i != 0 && _i != ((count _array)-1))) then
{
if(_sel == 34) then
{
_array set[_i,96];
};
};
};

toString(_array);

When comparing mine to the one shown above, I saw very little difference, however when I overwrote it, I got an error in the insert

@Jawshy
Collaborator
Jawshy commented Sep 23, 2016
@xProlithium

Better? I tried it the first time with ' and it didn't work lol

@SimZor
Contributor
SimZor commented Sep 23, 2016

@Jawshy so that means I can just do the DB fix for that table aswell?

@setoy
Contributor
setoy commented Sep 23, 2016

I needed to fix the following columns in my DB:

containers:
inventory
gear

gangs:
members

players:
aliases
civ_licenses
cop_licenses
med_licenses
civ_gear
cop_gear
med_gear

vehicles:
inventory
gear

wanted
wantedCrimes

@Jawshy
Collaborator
Jawshy commented Sep 23, 2016

@xProlithium,

private["_array"];
_array = [_this,0,[],[[]]] call BIS_fnc_param;
_array = str _array;
_array = toArray(_array);

for "_i" from 0 to (count _array)-1 do
{
_sel = _array select _i;
if((_i != 0 && _i != ((count _array)-1))) then
{
if(_sel == 34) then
{
_array set[_i,96];
};
};
};

str(toString(_array));
@Jawshy
Collaborator
Jawshy commented Sep 23, 2016
@SimZor
Contributor
SimZor commented Sep 23, 2016

There was no ´´ in my DB in any other tables than players, but yet it sometimes spits out the error.

@Jawshy

@xProlithium
xProlithium commented Sep 23, 2016 edited

@Jawshy I'm getting an error in the asyncCall.sqf on line 53 and 56.

private["_queryStmt","_queryResult","_key","_mode","_return","_loop"];

_queryStmt = [_this,0,"",[""]] call BIS_fnc_param;
_mode = [_this,1,1,[0]] call BIS_fnc_param;
_multiarr = [_this,2,false,[false]] call BIS_fnc_param;

_key = "extDB2" callExtension format["%1:%2:%3",_mode,(call life_sql_id), _queryStmt];

if(_mode isEqualTo 1) exitWith {true};

_key = call compile format["%1",_key];
_key = _key select 1;

uiSleep (random .03);

_queryResult = "";
_loop = true;
while{_loop} do
{
    _queryResult = "extDB2" callExtension format["4:%1", _key];
    if (_queryResult isEqualTo "[5]") then {
        _queryResult = "";
        while{true} do {
            _pipe = "extDB2" callExtension format["5:%1", _key];
            if(_pipe isEqualTo "") exitWith {_loop = false};
            _queryResult = _queryResult + _pipe;
        };
    }
    else
    {
        if (_queryResult isEqualTo "[3]") then
        {
            uisleep 0.1;
        } else {
            _loop = false;
        };
    };
};
if(typeName _queryResult == "STRING") then {_queryResult = call compile _queryResult};

_return = (_queryResult select 1);

if(!_multiarr) then {
    _return = _return select 0;
} else {
    if((count (_return select 0)) == 0) then {_return = []};
};

_return;

Not sure what it refers to.

Line 53 is
_return = (_queryResult select 1);
and 56 is

if(!_multiarr) then {
    _return = _return select 0;
@BartoCarto

I'm using 3.1.4.8
i have problem when players log out there gear is disappear after this update
how i can solve this?

@tkcjesse
Contributor
tkcjesse commented Sep 23, 2016 edited

Lmfaoooo. Omg.

@SimZor
Contributor
SimZor commented Sep 23, 2016

Is this troll?

Didn't they teach you to read in school?

@tkcjesse
Contributor

Dude HAS to be trolling. Holy fuck. Man this thread... lmao.

@BoGuu
Contributor
BoGuu commented Sep 23, 2016

So is any one still broken?

@Twisted123

yes we are broken still

@tkcjesse
Contributor

So @BoGuu whats been the issues? Does this actually not fix it for some peoplem or is it bad db stuff after they've realized somethings broken?

@BartoCarto
BartoCarto commented Sep 23, 2016 edited

I've tried all the written ,Didn't work

mresArray
http://pastebin.com/YD0UsEm5

mresToArray
http://pastebin.com/9ZAR5XT7

@Jawshy
Collaborator
Jawshy commented Sep 23, 2016
@BoGuu
Contributor
BoGuu commented Sep 23, 2016

@Twisted123 Please post the files asked for, and a screenshot of your database (with recently logged in people)

@BartoCarto You haven't followed the one thing you were told to do in the OP

@BartoCarto

i have made this change db66e54

same problem

@Jawshy
Collaborator
Jawshy commented Sep 23, 2016

@BartoCarto, the fn_mresArray.sqf on the Pastebin file you linked does not have the latest change. The green highlight on the diff is the latest code.

@Jawshy
Collaborator
Jawshy commented Sep 23, 2016

If your database contains malformed entries then following the steps outlined in #104 (comment).

If you have malformed entries in your DB, run the following command:

UPDATE `players`
SET `civ_licenses` = replace(civ_licenses, '``', '`') where uid>=0;

Replace players and civ_licenses with relevant table/column (licenses, gear, containers etc etc.)

Or alternatively you can dump your DB, and find/replace `` -> `, then reupload.

@Jawshy Jawshy added a commit that referenced this issue Sep 23, 2016
@Jawshy Jawshy life_hc//fn_mresArray: Fix for 1.64 str change
Same as db66e54 but for the fn_mresArray in life_hc. Original fix courtesy of @tkcjesse. 

See also: #104
419aae8
@Twisted123

Has this been fixed yet or anyone found a way to fix it?

@BoGuu
Contributor
BoGuu commented Sep 23, 2016

@Twisted123 what exactly is your problem? You haven't posted any details about what your particular problem is, have you even made the changes stated?

@numpty9989

after running this "fix" got https://gyazo.com/478e2e9eb6cc58588a386e838e716690 any help would be appreciated

@Emma-L
Collaborator
Emma-L commented Sep 23, 2016

@numpty9989 Post a picture of your gear in the database

@Emma-L
Collaborator
Emma-L commented Sep 23, 2016 edited

@numpty9989 Please refer to the original post, which contains SQL to remove the malformed entries. (The double `` )

@numpty9989

me running query https://gyazo.com/709163b4ba3cd810f959a54e165181f2
me running it https://gyazo.com/2995b13a11d01eec3c0d6b5bbdb78e20
original time i did it said affected 24 rows

@Emma-L
Collaborator
Emma-L commented Sep 23, 2016

@numpty9989 'Replace players and civ_licenses with relevant table/column (licenses, gear, containers etc etc.)'

@numpty9989

huh

@numpty9989

@setoy you linked to the same issue xD

@LiamLikesGaming

I have done the fn_mresArray.sqf fix, but now when i try to join a job I get stuck on "Sending request to server for player information UID". Do I need to do the table fix too? Or what?

@numpty9989

@Emma-L Fixed Now thanks i had a noob moment

@Emma-L
Collaborator
Emma-L commented Sep 23, 2016

@LiamLikesGaming Like any issue, you need to post more details/logs. Check if your DB has any double back-ticks, like this: https://i.gyazo.com/35570faa0aa355f2cbe0d0ff85d3c9d4.png. If it does, refer back to the first post.

@numpty9989 No worries, glad you got it fixed!

@LiamLikesGaming
LiamLikesGaming commented Sep 23, 2016 edited

I don't really know if I have, I'm fairly new to MYSQL, and don't really understand much of it.

Here is a screenshot anyway. I can't tell if it has got any "double back-ticks" or not.

http://i.imgur.com/dd5dxDd.png

@Emma-L
Collaborator
Emma-L commented Sep 23, 2016 edited

Here is a screenshot anyway

You forgot to attach/link it :)

@numpty9989

#epic fail lol

@LiamLikesGaming

I edited the comment.

@Emma-L
Collaborator
Emma-L commented Sep 23, 2016 edited

@LiamLikesGaming Run this:

UPDATE `players` 
 SET `cop_licenses` = replace(cop_licenses, '``', '`'),
 `civ_licenses` = replace(civ_licenses, '``', '`'),
 `med_licenses` = replace(med_licenses, '``', '`'),
 `aliases` = replace(aliases, '``', '`'),
 `cop_gear` = replace(cop_gear, '``', '`'),
 `civ_gear` = replace(civ_gear, '``', '`'),
 `med_gear` = replace(med_gear, '``', '`')
    WHERE uid>=0;
@Twisted123

where do we run it?

@Emma-L
Collaborator
Emma-L commented Sep 23, 2016

....In MySQL workbench (or whatever you use)...to set up your server you must have had to run some SQL code...

@LiamLikesGaming

Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MYSQL server version for the right syntax to use near '``' at line 1.

Thats the error it gives when I used that code, however when I ran it, it saids "Changed: 4" so it must've done something

@Emma-L
Collaborator
Emma-L commented Sep 23, 2016

@LiamLikesGaming I fucked my markdown up, sorry my triple back-ticks at the end were by accident. Did you include them. If you did rerun it (I edited the comment to get rid of them).

@LiamLikesGaming

I did that command too, even the edited one and I still get "Sending request to server for player information UID", sorry for this by the way..

@Emma-L
Collaborator
Emma-L commented Sep 23, 2016

Can you verify all of your DB for back-ticks (``) and post logs? Alternatively, if you don't have too much data in your DB, and you're not too bothered about it, you can simply reset it.

@LiamLikesGaming

How do I verify the DB for back-ticks. And I have quite a lot of data for players if your talking about resetting it..

Thanks

@Emma-L
Collaborator
Emma-L commented Sep 23, 2016 edited

You literally just look for double back-ticks

@LiamLikesGaming

might it be easier if I can contact you somewhere and give you access to the DB itself?

Thank you.

@Emma-L
Collaborator
Emma-L commented Sep 23, 2016

You can contact me on the, either, the AYU discord or the ArmaRPGLife discord (see the readme for an inv). If I'm not around, as I'm going off soon, there will be other people there that can help you, who are probably more proficient anyway.

@LiamLikesGaming

Okay i added you on discord.

@xProlithium

I did some troubleshooting. The error I get after changing mresArray for version 3.1.4.8 doesn't happen in the version 4.4r3 after changing the mresArray.

@variousskittles

Im getting this message before and after doing this, I dont know if the message is the same as everyone else or not but it says "The server didnt find any any player information matching your UID, attempting to add player to system." when joining

@Jawshy
Collaborator
Jawshy commented Sep 24, 2016

#104 (comment)

@numpty9989, no he did not. Someone posted a duplicate issue (of this one) and @setoy redirected them to this issue. GitHub then referenced back to the duplicate issue.


@variousskittles, your character's data is being sent to the server and added to the database. This should only occur once on the initial setup.

@numpty9989

@Jawshy my bad soz

@harmdhast
Contributor
harmdhast commented Sep 24, 2016 edited

Here you go, the complete SQL fix for the v3.1.4.8.

YOUR SERVER MUST BE STOPPED OR YOU MAY CORRUPT THE WHOLE FIX. IF ITS THE CASE PLEASE RESTORE A BACKUP OR FIX YOU DATABASE MANUALLY

UPDATE `players`
 SET `cop_licenses` = replace(cop_licenses, '``', '`'),
 `aliases` = replace(aliases, '``', '`'),
 `cop_gear` = replace(cop_gear, '``', '`')
    WHERE `cop_licenses` LIKE '"[[``%';

UPDATE `players`
 SET `civ_licenses` = replace(civ_licenses, '``', '`'),
 `civ_gear` = replace(civ_gear, '``', '`'),
 `aliases` = replace(aliases, '``', '`')
    WHERE `civ_licenses` LIKE '"[[``%';

UPDATE `players`
 SET `med_licenses` = replace(med_licenses, '``', '`'),
 `aliases` = replace(aliases, '``', '`'),
 `med_gear` = replace(med_gear, '``', '`')
    WHERE `med_licenses` LIKE '"[[``%';

UPDATE `gangs`
 SET `members` = replace(members, '``', '`')
    WHERE `members` LIKE '"[``%';

UPDATE `houses`
 SET `containers` = replace(containers, '``', '`')
    WHERE `containers` LIKE '"[[``%';

UPDATE `houses`
 SET `inventory` = replace(inventory, '``', '`')
    WHERE `inventory` LIKE '"[[[``%';
@variousskittles

@Jawshy It happens everytime I join my server.

@harmdhast
Contributor
harmdhast commented Sep 24, 2016 edited

SQL fix for the v4+. STILL WIP

YOUR SERVER MUST BE STOPPED OR YOU MAY CORRUPT THE WHOLE FIX. IF ITS THE CASE PLEASE RESTORE A BACKUP OR FIX YOU DATABASE MANUALLY

UPDATE `players`
 SET `cop_licenses` = replace(cop_licenses, '``', '`'),
 `aliases` = replace(aliases, '``', '`'),
 `cop_gear` = replace(cop_gear, '``', '`')
    WHERE `cop_licenses` LIKE '"[[``%';

UPDATE `players`
 SET `civ_licenses` = replace(civ_licenses, '``', '`'),
 `civ_gear` = replace(civ_gear, '``', '`'),
 `aliases` = replace(aliases, '``', '`')
    WHERE `civ_licenses` LIKE '"[[``%';

UPDATE `players`
 SET `med_licenses` = replace(med_licenses, '``', '`'),
 `aliases` = replace(aliases, '``', '`'),
 `med_gear` = replace(med_gear, '``', '`')
    WHERE `med_licenses` LIKE '"[[``%';

UPDATE `gangs`
 SET `members` = replace(members, '``', '`')
    WHERE `members` LIKE '"[``%';

UPDATE `containers`
 SET `gear` = replace(gear, '``', '`')
    WHERE `gear` LIKE '"[[``%';

UPDATE `containers`
 SET `inventory` = replace(inventory, '``', '`')
    WHERE `inventory` LIKE '"[[[``%';

UPDATE `vehicles`
 SET `gear` = replace(gear, '``', '`')
    WHERE `gear` LIKE '"[[``%';

UPDATE `vehicles`
 SET `inventory` = replace(inventory, '``', '`')
    WHERE `inventory` LIKE '"[[[``%';
@Jawshy
Collaborator
Jawshy commented Sep 24, 2016

@variousskittles, your issue appears to be unrelated to the one listed here. If you like you can join the ArmA RPG Life Discord server or post on the forums where others can help you troubleshoot your issue.

@BoGuu
Contributor
BoGuu commented Sep 24, 2016 edited

See updated OP:

"
If you have malformed entries in your DB (contains ``) then replace your mresToArray with the following:

http://hastebin.com/omikofajej.cpp

https://gist.github.com/BoGuu/c552b652f752378f06a42c809150032e

Over time they should fix themselves, and you can revert back to the original.
"

@harmdhast
Contributor

Useless. Better fix it right now. Temp fixes doesn't go well with AltisLife and Arma.
One thing to note, why does the database is still managed like that ?
It look like one of the web database that you do in the html tutorials. Like seriously. One does not store arrays as strings. And it's just one of the things.

@BoGuu
Contributor
BoGuu commented Sep 24, 2016 edited

Useless. Better fix it right now. Temp fixes doesn't go well with AltisLife and Arma.

Unfortunately, like with anything in AltisLife, a large amount of people fail to follow simple instructions. This has been a perfect demonstration of this, countless people in the same boat. And in the same fashion as usual, it's simplified for people.

One thing to note, why does the database is still managed like that ?

Because it's old, and hasn't been changed from what Tonic made originally.

It look like one of the web database that you do in the html tutorials. Like seriously. One does not store arrays as strings. And it's just one of the things.

The system has not been changed in a long time, but not too long ago there was a reasoning behind it, but by saying that, you come across as naïve.

@CarbineLife
CarbineLife commented Sep 25, 2016 edited

Ok so I bought a server right before the 1.64 update hit so we had nothing on it no player data everything was just standard brand new altis life version 4.4. The day after however the 1.64 update hit so we updated to it and also updated our altis life version to 4.5. When we did that every time we try and join the server now we get these messages constantly alternating between eachother on a black screen.

The server didn't find any player information matching your UID, attempting to add player to system.

Sending request to server for player information UID [76561198096865516]

Can anyone link me to a fix for this or just tell me on here. We've tried contacting the hosting company and they said wait for an update on the Altis Life mod however I don't see signs of an update coming so what is going on?

On our server right now we have the latest version of Arma (1.64) and the latest version of Altis life (4.5)

@Jawshy
Collaborator
Jawshy commented Sep 25, 2016

@CarbineLife, your issue does not appear to be related to this one. Please jump in #server_setup on the ArmA RPG Life Discord server for support.

@CarbineLife

@Jawshy will do thanks for the info

@3LGStevo

Neither the MresArray.sqf file or MresToArray.sqf file changes have fixed the issue. When my players still sync their data, it still inserts `` into the database.

@BoGuu
Contributor
BoGuu commented Sep 25, 2016

@3LGStevo

It would seem you have not correctly edited the files then. The only cause for the double would be by not changing the files correctly. You should have some though, in between commas, such as:

[`XXXX`,``,``,`XXXX`]
@chelseaboyc18

@BoGuu im having same problem as 3LGStevo it allows me into server and can relog as many times as i want but soon as i sync data and then relog i get received request from server validating

@chelseaboyc18

Or even items or licences anythink to do with arrays the way arrays are inserted into DB is not correct, they have to rewrite the two functions that format arrays OR remove em completely because they are not needed

@3LGStevo

Yeah, someone posted a "fix" in one of the replies which didn't fix it, and the hastebin links weren't working for me.

@chelseaboyc18
I'll post you the files tomorrow, you'll need to repair your database entries. Better to take your server down to prevent further corruptions.

@Emma-L
Collaborator
Emma-L commented Sep 26, 2016

@3LGStevo The gist link is working just fine for me, the hastebin link has been crossed out for a reason..

@BoGuu
Contributor
BoGuu commented Sep 26, 2016 edited

Or even items or licences anythink to do with arrays the way arrays are inserted into DB is not correct

It will be correct after applying the mresArray changes in the OP (correct as in pre update).

they have to rewrite the two functions that format arrays OR remove em completely because they are not needed

One has been, as you know, the other doesn't need to change seeing as the format will be no different. However, you are right in saying they are not needed anymore (and haven't really been for a long time).

Yeah, someone posted a "fix" in one of the replies which didn't fix it, and the hastebin links weren't working for me.

Gist link works, although it's not a fix, it's a hack to fix database entries.

@chelseaboyc18 @3LGStevo

The changes have worked for servers running every version there is, so if you still have persistent problems then you've either still got malformed arrays (and no mresToArray changes), the malformed arrays have caused null entries, or your problem is something specific to your setup.

@3LGStevo
3LGStevo commented Sep 27, 2016 edited

@BoGuu
My server has been working for a few days now, dude. I thought the fix didn't work because someone posted a "fix" using pastebin which did nothing to rectify the issue. The hastebin links didn't work (and are now crossed out) but the working link was added in afterwards.

Anyway, @chelseaboyc18 , replace the files in life_server\functions\MySQL\ with the two files below. Any database entries with '' will need to be manually corrected. I say manually, because each of the automated methods above just fucks a different part of the database for that record, so just have some patience and work through them manually. It's easier if you filter the table with the records that are broken (like searching for '%[''%').

MREStoArray.sqf
`
/*
File: fn_mresToArray.sqf
Author: Bryan "Tonic" Boardwine";

Description:
Acts as a mres (MySQL Real Escape) for arrays so they
can be properly inserted into the database without causing
any problems. The return method is 'hacky' but it's effective.

*/
private["_array"];
_array = [_this,0,"",[""]] call BIS_fnc_param;
if (_array isEqualTo "") exitWith {[]};
_array = toArray(_array);

for "_i" from 0 to (count _array)-1 do
{
_sel = _array select _i;
if (_sel == 96) then
{
_array set[_i,39];
};
};

_array = toString(_array);
_array = call compile format["%1", _array];
_array;
`

MRESArray.sqf
`
/*
File: fn_mresArray.sqf
Author: Bryan "Tonic" Boardwine";

Description:
Acts as a mres (MySQL Real Escape) for arrays so they
can be properly inserted into the database without causing
any problems. The return method is 'hacky' but it's effective.

*/
private["_array"];
_array = [_this,0,[],[[]]] call BIS_fnc_param;
_array = str(_array);
_array = toArray(_array);

for "_i" from 0 to (count _array)-1 do
{
_sel = _array select _i;
if ((_i != 0 && _i != ((count _array)-1))) then
{
if (_sel isEqualTo 34) then
{
_array set[_i,96];
};
};
};

str(toString(_array));`

@Jawshy
Collaborator
Jawshy commented Sep 27, 2016

@3LGStevo, code blocks are formatted with three backticks ` above and below; not one. However, with the amount of code you have there you should upload the files to GitHub instead as said at #104 (comment).

@chelseaboyc18

@BoGuu thanks for that finally got it working now. Appreciate your help.
Also i noticed in your MREStoArray.sqf you have str(toString(_array));` should be str(toString(_array));
just pointing out as anyone else might make the mistake of adding the extra '
(:

@harmdhast
Contributor

@chelseaboyc18
It seems to be markdown related.

@VladmirVorkeshky

Can someone please help me with this? I am new to GitHub and would prefer if someone could help me through Steam @Vladmir Vorkeshky. I did everything he said to do and I still am having the same problem. I have a community and they're all waiting on me to fix it I would REALLY REALLY appreciate it if anyone could help. Thanks!

@OfficialTemp
OfficialTemp commented Oct 1, 2016 edited

@VladmirVorkeshky Make sure you have followed ALL the steps listed by Boguu. If you still cannot fix it, join the ArmA RPG Life discord and ask for help by someone there. https://discordapp.com/invite/sEcQdPn

@JimBob0121

UPDATE players
SET cop_licenses = replace(cop_licenses, '', ''),
aliases = replace(aliases, '', ''),
cop_gear= replace(cop_gear, '', '`') WHERE `cop_licenses` LIKE '"[[%';

UPDATE players
SET civ_licenses = replace(civ_licenses, '', ''),
civ_gear = replace(civ_gear, '', ''),
aliases= replace(aliases, '', '`') WHERE `civ_licenses` LIKE '"[[%';

UPDATE players
SET med_licenses = replace(med_licenses, '', ''),
aliases = replace(aliases, '', ''),
med_gear= replace(med_gear, '', '`') WHERE `med_licenses` LIKE '"[[%';

UPDATE gangs
SET members = replace(members, '', '')
WHERE members LIKE '"[`%';

UPDATE containers
SET gear = replace(gear, '', '')
WHERE gear LIKE '"[[`%';

UPDATE containers
SET inventory = replace(inventory, '', '')
WHERE inventory LIKE '"[[[`%';

UPDATE vehicles
SET gear = replace(gear, '', '')
WHERE gear LIKE '"[[`%';

UPDATE vehicles
SET inventory = replace(inventory, '', '')
WHERE inventory LIKE '"[[[`%';

@Jawshy Jawshy added major-bug and removed READ ME labels Nov 16, 2016
@JamesMason580
JamesMason580 commented Dec 30, 2016 edited

Really don't want to sound like a broken record, but I am comparatively new to running an Arma 3 server. We're using the old CG mission file with a few modifications of our own. Now I've run into this issue, gear saving works perfectly, but when anyone loads in after having saved gear, they spawn in naked. A temporary fix I instituted was to if(count _itemArray == 0) exitWith within the loadGear.sqf to if(count 0 == 0) exitWith so that it always evaluates to true and give everyone the default gear. My problem is that I'm unsure how to debug this, or I could probably figure it out. Any help would be greatly appreciated.

EDIT: Maybe this sheds some light? From one of our users logging in. http://pastebin.com/rGqRgrQy

EDIT: Could be it's cutting off before it acutally finishes loading the data?

@wilsonjude

So there isnt a fix?

@NeFShARk
Contributor
NeFShARk commented Jan 9, 2017

@wilsonjude Did you read this issue at least?

@wilsonjude

Now it says Setting Up Client, Please wait

@Emma-L
Collaborator
Emma-L commented Jan 9, 2017

@wilsonjude if you have followed all of the steps and still can't get it working, please join the ArmA RPG Life discord: invite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment