SA-MP Forums Archive
crash server - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: crash server (/showthread.php?tid=677697)



crash server - Ertouq - 25.07.2020

Hello, the server crashed when i banned someone, I don't know what happens.

PHP Code:
[16:14:10] [debugServer crashed due to an unknown error
[16:14:10] [debugNative backtrace:
[
16:14:10] [debug#0 f676f8b6 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () in plugins/crashdetect.so
[16:14:10] [debug#1 f6767120 in _ZN18CrashDetectHandler20PrintNativeBacktraceERSoRKN2os7ContextE () in plugins/crashdetect.so
[16:14:10] [debug#2 f6767886 in _ZN18CrashDetectHandler20PrintNativeBacktraceERKN2os7ContextE () in plugins/crashdetect.so
[16:14:10] [debug#3 f6767f96 in _ZN18CrashDetectHandler7OnCrashERKN2os7ContextE () in plugins/crashdetect.so
[16:14:10] [debug#4 f676ef82 in ?? () in plugins/crashdetect.so
[16:14:10] [debug#5 f778fd40 in __kernel_rt_sigreturn () in linux-gate.so.1
[16:14:10] [debug#6 f74dd5e8 in ?? () in /lib32/libc.so.6
[16:14:10] [debug#7 0809571b in ?? () in ./server
[16:14:10] [debug#8 f73fa7cf in ?? () in plugins/mysql.so
[16:14:10] [debug#9 f7425843 in ?? () in plugins/mysql.so
[16:14:10] [debug#10 f740d3a4 in ?? () in plugins/mysql.so
[16:14:10] [debug#11 00000000 in nil ()
[16:14:10] [debugRegisters:
[
16:14:10] [debugEAXffc2c8d0 EBXf22d5008 ECX0875500e EDXffc2c8d0
[16:14:10] [debugESIffffd8c0 EDI00000008 EBPffc2c7d8 ESPffc2c7ac
[16:14:10] [debugEIPf74dd5e8 EFLAGS00010203
[16:14:10] [debugStack:
[
16:14:10] [debugESP+000000000809571b ffc2c8d0 0875500e ffc2caf8
[16:14:10] [debugESP+00000020f744e000 088375e8 00000001 ffc2caf8
[16:14:10] [debugESP+00000040f744e000 088375e8 f7711ed6 f744e000
[16:14:10] [debugESP+0000006000000000 00000000 00000003 00000028
[16:14:10] [debugESP+0000008000000030 087bbd48 0000000a 0000000b
[16:14:10] [debugESP+000000a000000038 f7710e87 f774c000 087ae94c
[16:14:10] [debugESP+000000c0f75fa000 08d597c4 f754a342 ffc2c938
[16:14:10] [debugESP+000000e0f74c3ea5 0878cd5c 0878cbb4 f774c000
[16:14:10] [debugESP+00000100f73ef000 0000032d 00000000 ffc2c8d0
[16:14:10] [debugESP+00000120f73da722 08a89d58 f774c000 f7439b14
[16:14:10] [debugESP+00000140f774c000 00000001 ffc2c980 ffc2c9c8
[16:14:10] [debugESP+00000160f74c3ea5 00000000 f76aae56 00000008
[16:14:10] [debugESP+0000018000000020 00000000 087a74f8 f75fa420
[16:14:10] [debugESP+000001a000000038 00000000 0000005b 00000000
[16:14:10] [debugESP+000001c0f774c000 087a74f8 08d55918 ffc2caf8
[16:14:10] [debugESP+000001e0f76aae68 00000000 f76aae56 f744e000
[16:14:10] [debugESP+00000200f76aae68 00000000 087a74fc f7402319
[16:14:10] [debugESP+00000220f73fb90b 08d562e0 f744d440 f7439b14
[16:14:10] [debugESP+0000024000000005 087bbd30 087bbd48 ffc2ca90
[16:14:10] [debugESP+0000026008d59d38 ffffd8c0 0878f350 ff800084
[16:14:10] [debugESP+00000280ffc2ca31 0003cb01 e401d835 50fdf83e
[16:14:10] [debugESP+000002a08b372c41 08d59a34 fdfdb30b 00000015
[16:14:10] [debugESP+000002c000000063 ffc2ca90 081596ef ffc2ca88
[16:14:10] [debugESP+000002e00806f87b 08d55440 08d562e0 f66fbcb8
[16:14:10] [debugESP+00000300f74c6bd1 f743cef0 087a0f63 f0617898
[16:14:10] [debugESP+00000320f76ad074 00000015 02e107d0 00000001
[16:14:10] [debugESP+00000340f744e000 f05006ac ffc2cb50 ffc2cb78
[16:14:10] [debugESP+00000360f743cd26 f743cd25 00000426 f05006ac
[16:14:10] [debugESP+00000380f76aae68 00000000 00000000 f7712e49
[16:14:10] [debugESP+000003a0f7711ee8 087bbd40 087bbd30 00000009
[16:14:10] [debugESP+000003c0f744e000 081a1990 f05006ac ffc2cbf0
[16:14:10] [debugESP+000003e0087891c8 00000100 00000100 00000100
[16:14:10] [debugLoaded modules:
[
16:14:10] [debug00000000 00187dc3 server
[16:14:10] [debugf778f000 f778fe82 linux-gate.so.1
[16:14:10] [debugf7770000 f777281b /lib32/libdl.so.2
[16:14:10] [debugf7754000 f776ed2b /lib32/libpthread.so.0
[16:14:10] [debugf7662000 f775bd1a /usr/lib32/libstdc++.so.6
[16:14:10] [debugf761c000 f7660b97 /lib32/libm.so.6
[16:14:10] [debugf75ff000 f761b3c4 /usr/lib32/libgcc_s.so.1
[16:14:10] [debugf7451000 f7606237 /lib32/libc.so.6
[16:14:10] [debugf7792000 f77b34a0 /lib/ld-linux.so.2
[16:14:10] [debugf7783000 f778b7c4 plugins/Whirlpool.so
[16:14:10] [debugf73f0000 f744eaec plugins/mysql.so
[16:14:10] [debugf73cd000 f73ee108 /home/samp03/plugins/../log-core.so
[16:14:10] [debugf777a000 f778109f /lib32/librt.so.1
[16:14:10] [debugf6fa3000 f73b6e9f /home/samp03/plugins/../libmysqlclient.so.18
[16:14:10] [debugf6795000 f67a03ef /lib32/libnss_files.so.2
[16:14:10] [debugf73bc000 f73cb9b4 plugins/sscanf.so
[16:14:10] [debugf6750000 f67943ac plugins/crashdetect.so
[16:14:10] [debugf6714000 f674e7c8 plugins/jit.so
[16:14:10] [debugf664e000 f6713740 plugins/streamer.so
[16:14:10] [debugf6569000 f6650b50 plugins/pawncmd.so
[16:14:10] [debugf63c9000 f6570168 plugins/SKY.so 
In mysql log:

PHP Code:
[07/25/20 12:19:33] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (C:\Users\ert\Desktop\SERVER\gamemodes\game.pwn:2344)
[
07/25/20 12:20:41] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (C:\Users\ert\Desktop\SERVER\gamemodes\game.pwn:2344)
[
07/25/20 12:58:00] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (C:\Users\ert\Desktop\SERVER\gamemodes\game.pwn:2344)
[
07/25/20 15:41:03] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (C:\Users\ert\Desktop\SERVER\gamemodes\game.pwn:2344)
[
07/25/20 16:14:10] [plugins/mysqlerror #1062 while executing query "INSERT INTO bans (`name`, `accid`, `by`, `reason`, `date`) VALUES ('Stefanrty', '43', 'Waser', 'cheat', NOW())": Duplicate entry '0' for key 'PRIMARY' (C:\Users\ert\Desktop\SERVER\gamemodes\game.pwn:4761)
[07/25/20 16:14:10] [log-coresignal 11 (SIGSEGVcatchedshutting log-core down (errno0signal code: -6, exit status0
Line 2344:
PHP Code:
cache_get_value_int(0"banned"banned); 
in

PHP Code:
forward OnAccountCheckBan(playerid);
public 
OnAccountCheckBan(playerid)
{
    new 
banned;
    
cache_get_value_int(0"banned"banned);
    if(
banned == 1)
    {
        
SendClientMessage(playerid, -1"account banned :(");
        
SetTimerEx("SendToKick"500false"i"playerid);
    }
    else
    {
        new 
playername[MAX_PLAYER_NAME], query[128];
        
GetPlayerName(playeridplayernamesizeof(playername));
        
mysql_format(dbquerysizeof(query), "SELECT `password`, `id` FROM `accounts` WHERE `name` = '%e' LIMIT 1"playername);
        
mysql_tquery(dbquery"OnAccountCheck""d"playerid);
    }
    return 
true;

and line 4761:
PHP Code:
mysql_tquery(dbquery); 
in

PHP Code:
CMD:ban(playeridparams[])
{
    new 
idreason[124], query[230], update[120], str[245], stringa[200];
    if(
PlayerInfo[playerid][Admin] < 4) return SendClientMessage(playerid, -1"Nope");
    if(
sscanf(params"us[124]"idreason)) return SendClientMessage(playerid, -1"/ban (id/name) (reason)");
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid, -1"Player disconnected");
    if(
PlayerInfo[playerid][Admin] < PlayerInfo[id][Admin]) return SendClientMessage(playerid, -1"U cant");
    if(
id == playerid) return SendClientMessage(playerid, -1"nope");
    
mysql_format(dbquerysizeof(query), "INSERT INTO bans (`name`, `accid`, `by`, `reason`, `date`) VALUES ('%e', '%d', '%e', '%e', NOW())"GetName(id), PlayerInfo[id][ID], GetName(playerid), reason);
    
mysql_format(dbupdatesizeof(update), "UPDATE `accounts` SET `banned` = 1 WHERE name = '%e'"GetName(id));
    
mysql_tquery(dbquery); 
    
mysql_tquery(dbupdate); 
    
format(strsizeof(str), "%s has been banned by %s. (Reason: %s)"GetName(id), GetName(playerid), reason);
    
SendClientMessageToAll(0xff6b6bFFstr);
    
SetTimerEx("SendToKick"500false"i"id);
    
format(stringasizeof(stringa), "Admin %s(%d) used the cmd /ban to %s."GetName(playerid), playeridGetName(id));
    
SendMessageToAdmins(0xe8e8e8FFstringa);
    new
    
File:lFile fopen("db/logs/logs_ban.txt"io_append),
    
logData[178],
    
fyearfmonthfday,
    
fhourfminutefsecond;
    
getdate(fyearfmonthfday);
    
gettime(fhourfminutefsecond);
    
format(logDatasizeof(logData),"[%02d/%02d/%04d %02d:%02d:%02d] (ADMIN NIVEL %d) %s banned %s. (Reason: %s)\r\n"fdayfmonthfyearfhourfminutefsecondPlayerInfo[playerid][Admin], GetName(playerid), GetName(id), reason);
    
fwrite(lFilelogData);
    
fclose(lFile);
    return 
1;

Thanks!


Re: crash server - xRadical3 - 25.07.2020

Delete the primary key column from the `bans` table and try again.


Re: crash server - SharpenBlade - 26.07.2020

Well, you added a primary key after creating the table. Empty the bans table and check if it works.


Re: crash server - Ertouq - 26.07.2020

Quote:
Originally Posted by xRadical3
View Post
Delete the primary key column from the `bans` table and try again.
Quote:
Originally Posted by SharpenBlade
View Post
Well, you added a primary key after creating the table. Empty the bans table and check if it works.
Thanks! Fixed