SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 11/12/2019, 12:59 PM   #1
aurimuxe7
Little Clucker
 
Join Date: Jan 2017
Posts: 1
Reputation: 0
Default My server crash with mysql

Hi, I don't even know where to start. Server crashes due to mysql troubles, but I don't even know how it crashes. I have optimized the code, everything looks fine, it should run without problems, but the server crashes. I turn on the server and it just crashes after about 2-3 hours. Sometimes it just breaks down as soon as you connect the server. As much as you watched the server logs, it crashes due to a mysql problem. I'll put logos here, please help, I need a lot of help.

An example:

[19:51:28] [TRANSPORTAS] Kraunamos zaidejo Bulca_Tacos masinos.
[19:51:29] [connection] incoming connection: 78.62.113.8:63470 id: 5
[19:51:29] [join] Cha_Cho has joined the server (5:78.62.113.
[19:51:29] [TRANSPORTAS] Kraunamos zaidejo Cha_Cho masinos.
[19:51:33] [connection] 83.189.196.79:55073 requests connection cookie.
[19:51:34] [connection] incoming connection: 83.189.196.79:55073 id: 6
[19:51:35] [join] Armoro_Penetracija has joined the server (6:83.189.196.79)
[19:51:35] [debug] Server crashed while executing sang.amx
[19:51:35] [debug] AMX backtrace:
[19:51:35] [debug] #0 native cache_get_field_content_int () from mysql_static.so
[19:51:35] [debug] #1 0024c740 in public OnLoadPlayerData (6) from sang.amx

The second example:

[20:10:56] [SANG.lt] Vartotojas Bron_Son panaudojo [ /sms sand tai kokià klaidà padariau? ] komanda
[20:10:56] [chat] [Abra_Cadabra]: scottai
[20:10:56] [chat] [Tremell_Santos]: xdd
[20:10:57] [chat] [Vilius_Gigantas]: Sveiki.
[20:10:58] [SANG.lt] Vartotojas James_Crazy panaudojo [ / jo ] komanda
[20:10:58] [chat] [Bulca_Tacos]: vielos
[20:10:58] [SANG.lt] Vartotojas Armoro_Penetracija panaudojo [ /r tau dar per anksti zinot apie mergos pataikymus ] komanda
[20:10:58] [chat] [Michael_Scott]: nu
[20:10:59] [debug] Server crashed while executing sang.amx
[20:10:59] [debug] AMX backtrace:
[20:10:59] [debug] #0 native mysql_format () from mysql_static.so
[20:10:59] [debug] #1 003a9048 in ?? (1) from sang.amx
[20:10:59] [debug] #2 003a8758 in public cmd_direktoriai (20, 25252416) from sang.amx
[20:10:59] [debug] #3 native CallLocalFunction () from samp03svr
[20:10:59] [debug] #4 000026fc in public OnPlayerCommandText (20, 25252364) from sang.amx
aurimuxe7 is offline   Reply With Quote
Old 11/12/2019, 02:30 PM   #2
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 823
Reputation: 52
Default Re: My server crash with mysql

Use debug level 3 to know which line exactly causes the crash, create a file called pawn.cfg and write inside it
pawn Code:
-d3
and put it inside the pawno folder in your gamemode directory, then recompile and run the server again, the crash log will show you the error line.
__________________
JasonRiggs is offline   Reply With Quote
Old 11/12/2019, 03:22 PM   #3
MichaelScott
Little Clucker
 
Join Date: Apr 2019
Posts: 15
Reputation: 0
Default Re: My server crash with mysql

Hey, I'm the scripter from this server and the Pawn.cfg with -d3 was already added. Sometimes it doesn't show the line, but when it does, it almost always is cache_get_field_content_int. The thing is, the server almost every time crashes from mysql and it happens randomly without a specific place that crashes the server, just randomly. It is very odd and we can't figure out what is happening for a few days already. The mysql version is R39.
MichaelScott is offline   Reply With Quote
Old 11/12/2019, 03:50 PM   #4
Joe Staff
High-roller
 
Join Date: Aug 2007
Posts: 2,593
Reputation: 379
Default Re: My server crash with mysql

Do you know which table/row that it's reading from during the crash? It might be receiving a bill when it's expecting an integer, or something like that.
Joe Staff is offline   Reply With Quote
Old 11/12/2019, 04:15 PM   #5
MichaelScott
Little Clucker
 
Join Date: Apr 2019
Posts: 15
Reputation: 0
Default Re: My server crash with mysql

I don't think that it is the case, because for example few minutes ago it crashed from this:
HTML Code:
PlayerStats[playerid][GasCargoAll] = cache_get_field_content_int(0, "GasCargoAll");
It definitely is int in the database.
MichaelScott is offline   Reply With Quote
Old 11/12/2019, 04:28 PM   #6
MichaelScott
Little Clucker
 
Join Date: Apr 2019
Posts: 15
Reputation: 0
Default Re: My server crash with mysql

If it helps, now it crashed from:
HTML Code:
[19:25:54] [debug] Server crashed while executing sang.amx
[19:25:54] [debug] AMX backtrace:
[19:25:54] [debug] #0 native mysql_format () in mysql_static.so
[19:25:54] [debug] #1 00254f34 in SaveVarzybos (playerid=0, 0, 0, 1143324020, 567, 289, 0, 0, 4, 6, ... <6317172 more arguments>) at lib/stocks.pwn:657
[19:25:54] [debug] #2 002f4ab4 in public PlayedMinute () at C:\Users\Aurimas\Desktop\SANG\gamemodes\sang.pwn:2391
The lines :
HTML Code:
657 : mysql_format(connectionHandle, SQLString, sizeof SQLString, "UPDATE `fishing_data` SET `fishesMoneyToday` = '%i' WHERE `belongs_to` = '%e'", PlayerDB[playerid][fishesMoneyToday], Vardas(playerid));
2391: if(PlayerDB[playerid][CantPlayBecouseOfBan] == true)
MichaelScott is offline   Reply With Quote
Old 11/12/2019, 05:43 PM   #7
Calisthenics
High-roller
 
Join Date: May 2018
Posts: 1,228
Reputation: 205
Default Re: My server crash with mysql

R39 was released in 2014 and similar crash was reported here: https://forum.sa-mp.com/showpost.php...postcount=5283

Update to R39-6 and see the results.
Calisthenics is offline   Reply With Quote
Old 11/12/2019, 05:48 PM   #8
UnknownGamer
Gangsta
 
UnknownGamer's Avatar
 
Join Date: Apr 2012
Location: 127.0.0.1
Posts: 519
Reputation: 39
Default Re: My server crash with mysql

Quote:
Originally Posted by MichaelScott View Post
If it helps, now it crashed from:
HTML Code:
[19:25:54] [debug] Server crashed while executing sang.amx
[19:25:54] [debug] AMX backtrace:
[19:25:54] [debug] #0 native mysql_format () in mysql_static.so
[19:25:54] [debug] #1 00254f34 in SaveVarzybos (playerid=0, 0, 0, 1143324020, 567, 289, 0, 0, 4, 6, ... <6317172 more arguments>) at lib/stocks.pwn:657
[19:25:54] [debug] #2 002f4ab4 in public PlayedMinute () at C:\Users\Aurimas\Desktop\SANG\gamemodes\sang.pwn:2391
The lines :
HTML Code:
657 : mysql_format(connectionHandle, SQLString, sizeof SQLString, "UPDATE `fishing_data` SET `fishesMoneyToday` = '%i' WHERE `belongs_to` = '%e'", PlayerDB[playerid][fishesMoneyToday], Vardas(playerid));
2391: if(PlayerDB[playerid][CantPlayBecouseOfBan] == true)
That version is way out-dated. Prefer, if possible, re-write to R41-4. We had this crash issue a lot with R39.
__________________
╠ Ɽavens Roleplay → mySQL BlueG R41-4 ╣
╠ Ɽavens Vehicle System → Re-scripted to Y_Iterators & Y_Inline ╣
╠ Ɽavens Commands → STRCMP Re-scripted to Y_Commands ╣
╠ Ɽavens AntiCheat → Migrated over to F-Cleo ╣
╠ Ɽavens Password System → Changed to Whirlpool (WP_Hash) & SHA256_PassHash (Salt) ╣
╠ Ɽavens Jobs System → Entirely re-scripted ╣

╠ Ɽavens Library's Used → Ύ_Iterate, Ύ_Inline, Ύ_Timers, Ύ_Commands, Ύ_Master, Ύ_Dialog, Ύ_Groups, Ύ_Hooks, Ύ_Utils, Ύ_VehicleData, Ύ_Va, A_mySQLYInline, BlueG MySQL R41-4, FCLEO, OPVD, SSCANF2, Progress2, EVF, [MV]_Youtube, Whirlpool ╣
UnknownGamer is offline   Reply With Quote
Old 12/12/2019, 05:34 AM   #9
Joe Staff
High-roller
 
Join Date: Aug 2007
Posts: 2,593
Reputation: 379
Default Re: My server crash with mysql

I remember some time ago having issues with connections sticking. I had to have a timer run every minute or so to run some arbitrary query to keep the connection going
Joe Staff is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Bug? - [Server Crash] JR_Junior Server Support 1 05/05/2017 08:59 PM
Server Crash (MySQL R40) zT KiNgKoNg Scripting Help 8 09/09/2016 01:34 PM
Server crash - Mysql Chase20 Server Support 2 03/07/2016 08:03 PM
Server crash - Mysql Chase20 Scripting Help 0 02/07/2016 12:32 PM
Server Crash + MySql andreistalker Scripting Help 3 09/08/2015 08:22 AM


All times are GMT. The time now is 12:18 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.