SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 25/07/2020, 08:30 PM   #1
Ertouq
Huge Clucker
 
Ertouq's Avatar
 
Join Date: Jul 2014
Posts: 236
Reputation: 4
Default crash server

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!
Ertouq is offline   Reply With Quote
Old 25/07/2020, 10:49 PM   #2
xRadical3
Gangsta
 
Join Date: May 2017
Location: Iran
Posts: 694
Reputation: 63
Default Re: crash server

Delete the primary key column from the `bans` table and try again.
xRadical3 is online now   Reply With Quote
Old 26/07/2020, 05:48 AM   #3
SharpenBlade
Huge Clucker
 
Join Date: May 2020
Posts: 202
Reputation: 25
Default Re: crash server

Well, you added a primary key after creating the table. Empty the bans table and check if it works.
SharpenBlade is offline   Reply With Quote
Old 26/07/2020, 10:29 AM   #4
Ertouq
Huge Clucker
 
Ertouq's Avatar
 
Join Date: Jul 2014
Posts: 236
Reputation: 4
Default Re: crash server

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
Ertouq 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
RP Server crash every payday (Hour) Help Crash detect. shaquill Scripting Help 11 24/07/2015 02:36 AM
Crash detect , server crash Debug. whats wrong? MarwanCartman Server Support 4 10/05/2015 11:14 AM
[HELP]Server Crash - Located crash line with CrashDETECT - Guest4390857394857 Server Support 4 05/09/2014 04:37 AM
setplayername server crash helpme [crash detect] bigtigerbeee Scripting Help 4 28/11/2013 12:23 AM
Fatal Game crash, Not client or server crash SourceCode Scripting Help 3 11/10/2011 05:13 PM


All times are GMT. The time now is 07:52 AM.


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