Support ⇒ Explain Please ⇒ Duplicate entry error in iptracking table ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexExplain Please

Duplicate entry error in iptracking table Reply to topic


Similar to this error here from a few years ago I am getting this error on every page I visit:

On /Classified/mode=details/lid=285.html
While executing query "INSERT INTO chantill_iptracking
(ipusername, date_time, ip_address, hostname, page, ipcode, referer)
VALUES ('webmaster', '1389527968', '0x5a07be71', 'AAmiens-652-1-127-113.w90-7.abo.wanadoo.fr', '/Classified/mode=details/lid=285.html', '200', 'http://www.chantillyexpat.com/Classified/mode=details/golive/lid=285.html')"

the following error occured: Duplicate entry '16513935' for key 1


The values change each time but the duplicate entry is always the same. Should I be concerned?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Anyone?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Could you copy output of all these separate sql commands ran against chantill_iptracking table (e.g with phpmyadmin or whatever mysql tool):
SELECT MAX(ipid) FROM chantill_iptracking; SHOW INDEXES FROM chantill_iptracking; SHOW COLUMNS FROM chantill_iptracking where Field ='ipid'

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
-


Eestlane wrote
Could you copy output of all these separate sql commands ran against chantill_iptracking table (e.g with phpmyadmin or whatever mysql tool):
SELECT MAX(ipid) FROM chantill_iptracking; MAX(ipid) 16513934 SHOW INDEXES FROM chantill_iptracking; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment chantill_iptracking 0 PRIMARY 1 ipid A 99934 NULL NULL BTREE chantill_iptracking 1 i1iptracking 1 ip_address A 3223 NULL NULL YES BTREE chantill_iptracking 1 i1iptracking 2 hostname A 3331 NULL NULL YES BTREE SHOW COLUMNS FROM chantill_iptracking where Field ='ipid' ipid int(10) NO PRI NULL auto_increment


And it says:
This table does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


So current maximum ipid value is 16513934 not 16513935.

Primary key is ipid column as is originally defined in IP Tracker module. Primary key is always unique and so is this one. So this index is defined correctly.

Also, ipid column type is int(10) as is also originally defined in IP Tracker module. So the maximum value is 2147483647 (or in case of unsigned integer 4294967295). So this limit is not a problem at the moment.

The "This table does not contain a unique column...." message in phpMyAdmin applies to the current result set of the query phpMyAdmin used when you saw that message (see this), so it seems the message is not reporting a problem as well.

So everything seems to be correct, except if index got corrupted somehow. So you could try using phpmyadmin's repair operation on the table. But mysql would probably understand it's broken and reported it.

Maybe it's about the sql statement.

First try running this:
"INSERT INTO chantill_iptracking (date_time, ip_address, hostname, page, ipcode, referer) VALUES ('1390048428', '0x5abed83f', 'fake_hostname', '/', '200', '/')";


And if it did not work and gave the same error as there is on your page, then try this:
"INSERT INTO chantill_iptracking (ipid, date_time, ip_address, hostname, page, ipcode, referer) VALUES (DEFAULT,'1390048428', '0x5abed83f', 'fake_hostname', '/', '200', '/')";

And if this didn't work either, then I'm quite out of ideas.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
-


Eestlane wrote


First try running this:
"INSERT INTO chantill_iptracking (date_time, ip_address, hostname, page, ipcode, referer) VALUES ('1390048428', '0x5abed83f', 'fake_hostname', '/', '200', '/')";

Gives:

#1062 - Duplicate entry '16513935' for key 1

And if it did not work and gave the same error as there is on your page, then try this:
"INSERT INTO chantill_iptracking (ipid, date_time, ip_address, hostname, page, ipcode, referer) VALUES (DEFAULT,'1390048428', '0x5abed83f', 'fake_hostname', '/', '200', '/')"; Gives the same: #1062 - Duplicate entry '16513935' for key 1


And if this didn't work either, then I'm quite out of ideas.


I ran a check and it gave me this:

chantill_dragonfly.chantill_iptracking check warning 2 clients are using or haven't closed the table properly
chantill_dragonfly.chantill_iptracking check warning Size of datafile is: 11928924 Should be: 11925976
chantill_dragonfly.chantill_iptracking check error Found 99935 keys of 99934
chantill_dragonfly.chantill_iptracking check error Corrupt

So I've run a repair and all seems to be well again, I'm not getting the error any more. Does that mean it's fixed?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Seems like the problem was found and fixed.

Original cause was not found, and is probably not worth the time for finding it out (could be hardware problem or anything probably already known behaviour inside the mysql storage engine).

If it will not happen again any time soon, then just forget it Smile

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
-


Good news. Thanks for all your advice in getting it sorted.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):

All times are UTC


Jump to: