Full documentation and information about XLRstats can be found on our XLRstats website: www.xlrstats.com

You are here: Big Brother Bot ForumAdd-OnsXLRstatsXLRSTATS COD7 error inserting data into database
Pages: [1]   Go Down
  Print  
Author Topic: XLRSTATS COD7 error inserting data into database  (Read 342 times) Bookmark and Share
Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: BF3, RO2, COD-BO
Posts: 127
Offline Offline
« on: January 06, 2012, 07:28:24 AM »

Hi,

I've noticed a number of the following errors in my b3 for cod7

Code:

120106 14:24:24 ERROR   '[INSERT INTO xlr_weaponstats ( name, kills, suicides, teamkills ) VALUES ("m16_reflex_mp", 1, 0, 0)] None'
120106 14:24:24 ERROR   'handler XlrstatsPlugin could not handle event Client Kill: IntegrityError: (1062, "Duplicate entry \'255\' for key \'PRIMARY\'") [(\'/home/b3/b3/parser.py\', 1000, \'handleEvents\', \'hfunc.parseEvent(event)\'), (\'/home/b3/b3/plugin.py\', 158, \'parseEvent\', \'self.onEvent(event)\'), (\'/home/b3/b3/extplugins/xlrstats.py\', 498, \'onEvent\', \'self.kill(event.client, event.target, event.data)\'), (\'/home/b3/b3/extplugins/xlrstats.py\', 1050, \'kill\', \'self.save_Stat(weaponstats)\'), (\'/home/b3/b3/extplugins/xlrstats.py\', 744, \'save_Stat\', \'cursor = self.query(q)\'), (\'/home/b3/b3/storage/database.py\', 313, \'query\', \'raise e\')]'


The other errors are all the same except for the name :-

m60_grip_mp
kiparis_rf_mp

Does anyone have an idea how I can fix them?  I can see all these weaponse in my xlrstats cod7.php file and I've checked that they are not duplicated in my sql database, so I'm a bit stumped.

Cheers
Toffees
Logged

XLRstats dev.
Dev. Team
*
OS: Linux
Type: Home user
Gameservers: COD5, COD7, BF3
Posts: 947
Offline Offline
WWW
Support Specialty: XLRstats webfront
« Reply #1 on: January 07, 2012, 04:42:41 PM »

Looks like the issue here -> http://forum.bigbrotherbot.net/general-usage-support/error-xlrstats-plugin-could-not-handle-event-client-kill/msg19690/#msg19690

Can you please check if it's the same?
Logged

Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: BF3, RO2, COD-BO
Posts: 127
Offline Offline
« Reply #2 on: January 07, 2012, 05:19:01 PM »

yes mate, you are spot on again :-)  Sorry I didnt pick this thread up.  I did do a search but the returned results leave a lot to be desired.

Cheers
Toffees
Logged
[ www.xlrstats.com ]
Project Lead
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD, CoD2, CoD5, UrT
Posts: 2022
Offline Offline
WWW
Support Specialty: B3-Core, CoD/UrT/WoP/ETPro parsers, Plugin development
« Reply #3 on: January 08, 2012, 03:34:25 AM »

Fixed: https://github.com/xlr8or/big-brother-bot/issues/69

This will be okay in next version after running 'b3_run.py --update'.
Logged

Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: BF3, RO2, COD-BO
Posts: 127
Offline Offline
« Reply #4 on: January 08, 2012, 06:31:03 AM »

Hmmm still not working.  After issuing a ALTER TABLE xlr_weaponstats MODIFY id SMALLINT(5); I'm still seeing errors this morning in the logs :-

Quote
mysql> desc xlr_weaponstats;
+-----------+-----------------------+------+-----+---------+----------------+
| Field     | Type                  | Null | Key | Default | Extra          |
+-----------+-----------------------+------+-----+---------+----------------+
| id        | smallint(5) unsigned  | NO   | PRI | NULL    | auto_increment |
| name      | varchar(64)           | YES  | UNI | NULL    |                |
| kills     | mediumint(Cool unsigned | NO   |     | 0       |                |
| teamkills | smallint(5) unsigned  | NO   |     | 0       |                |
| suicides  | smallint(5) unsigned  | NO   |     | 0       |                |
+-----------+-----------------------+------+-----+---------+----------------+
5 rows in set (0.00 sec))


Code:

120108 13:26:45 ERROR   '[INSERT INTO xlr_weaponstats ( name, kills, suicides, teamkills ) VALUES ("kiparis_rf_mp", 0, 0, 1)] None'
120108 13:26:45 ERROR   'handler XlrstatsPlugin could not handle event Client Team Kill: IntegrityError: (1062, "Duplicate entry \'0\' for key \'PRIMARY\'") [(\'/home/b3/b3/parser.py\', 1000, \'handleEvents\', \'hfunc.parseEvent(event)\'), (\'/home/b3/b3/plugin.py\', 158, \'parseEvent\', \'self.onEvent(event)\'), (\'/home/b3/b3/extplugins/xlrstats.py\', 503, \'onEvent\', \'self.teamkill(event.client, event.target, event.data)\'), (\'/home/b3/b3/extplugins/xlrstats.py\', 1256, \'teamkill\', \'self.save_Stat(weaponstats)\'), (\'/home/b3/b3/extplugins/xlrstats.py\', 744, \'save_Stat\', \'cursor = self.query(q)\'), (\'/home/b3/b3/storage/database.py\', 313, \'query\', \'raise e\')]'


Fixed: https://github.com/xlr8or/big-brother-bot/issues/69

This will be okay in next version after running 'b3_run.py --update'.


That issue was a similar problem with the size of the description column.  This appears to be something to do with the id but increasing it to smallint(5) has not fixed it.
« Last Edit: January 09, 2012, 07:05:40 AM by Toffees » Logged
[ www.xlrstats.com ]
Project Lead
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD, CoD2, CoD5, UrT
Posts: 2022
Offline Offline
WWW
Support Specialty: B3-Core, CoD/UrT/WoP/ETPro parsers, Plugin development
« Reply #5 on: January 08, 2012, 07:11:28 AM »

The fix i wrote today changes the name field into varchar(64).
It is in this commit in my repo: http://bit.ly/x4f06N

Next version (v1.8.0) will have this feature. Or apply this patch to your current install: http://bit.ly/wM3wIT
« Last Edit: January 08, 2012, 07:18:57 AM by xlr8or » Logged

Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: BF3, RO2, COD-BO
Posts: 127
Offline Offline
« Reply #6 on: January 08, 2012, 04:04:50 PM »

still getting this error regardless of name being varchar(64) or id being smallint(5)

Code:

120108 23:21:50 ERROR   '[INSERT INTO xlr_weaponstats ( name, kills, suicides, teamkills ) VALUES ("mpl_elbit_rf_mp", 1, 0, 0)] None'
120108 23:21:50 ERROR   'handler XlrstatsPlugin could not handle event Client Kill: IntegrityError: (1062, "Duplicate entry \'0\' for key \'PRIMARY\'") [(\'/home/b3/b3/parser.py\', 1000, \'handleEvents\', \'hfunc.parseEvent(event)\'), (\'/home/b3/b3/plugin.py\', 158, \'parseEvent\', \'self.onEvent(event)\'), (\'/home/b3/b3/extplugins/xlrstats.py\', 498, \'onEvent\', \'self.kill(event.client, event.target, event.data)\'), (\'/home/b3/b3/extplugins/xlrstats.py\', 1050, \'kill\', \'self.save_Stat(weaponstats)\'), (\'/home/b3/b3/extplugins/xlrstats.py\', 744, \'save_Stat\', \'cursor = self.query(q)\'), (\'/home/b3/b3/storage/database.py\', 313, \'query\', \'raise e\')]'


Logged
XLRstats dev.
Dev. Team
*
OS: Linux
Type: Home user
Gameservers: COD5, COD7, BF3
Posts: 947
Offline Offline
WWW
Support Specialty: XLRstats webfront
« Reply #7 on: January 09, 2012, 12:55:09 AM »

Do you see only 1 kill on the kill column of the "xlr_weaponstats" table in your db for weapon "mpl_elbit_rf_mp"? If yes:

First back up your database.
Then note the id number for that weapon. Delete this row with "mpl_elbit_rf_mp".
Then go to xlr_weaponusage table and delete the row with weapon_id that you noted down.

Don't forget to backup your DB first!

Hope this helps.
Logged

Full Member
***
OS: Linux
Type: Owner dedicated server(s)
Gameservers: BF3, RO2, COD-BO
Posts: 127
Offline Offline
« Reply #8 on: January 09, 2012, 07:09:00 AM »

hmmm why can't I be as clever as you  Wink  Worked a treat.  I must have screwed it slightly when I altered the id to a smallint(5), but removing the row got it going again.  I can see new data being written to the table and no more errors in the logs.

Thanks Freelander :-)
Logged
Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal