user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks_tracker (nid, keywords) VALUES (12296, '') in /home/cyberfan/htdocs/sites/all/modules/relatedlinks/relatedlinks.module on line 602.

Id love to use this module.. thanks for any help!

CommentFileSizeAuthor
#4 relatedlinks-patched.zip33.1 KBholydrupal

Comments

holydrupal’s picture

same here!

holydrupal’s picture

I found it, change the line 848:

function _relatedlinks_insert_tracker($nid, $keywords) {
if (trim( $keywords )) {
db_query("INSERT INTO {relatedlinks_tracker} (nid, keywords) VALUES (%d, '%s')", $nid, $keywords);
}
}
AntiNSA’s picture

It was the wrong line... not 848, but 601. It helped, but I am still getting this error user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks (nid, url, title, type) VALUES (18057, '/node/18342', 'Bird Group Warns that Oiled Birds Found Onshore May Be a Fraction of the Total Toll on Birds From Gulf Spill(Common Dreams Progressive Newswire)', 3) in /home/cyberfan/htdocs/sites/all/modules/relatedlinks/relatedlinks.module on line 464.
user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks (nid, url, title, type) VALUES (18057, '/node/18007', 'Bears rescued from bile farm(Reuters Latest Videos)', 3) in /home/cyberfan/htdocs/sites/all/modules/relatedlinks/relatedlinks.module on line 464.
user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks (nid, url, title, type) VALUES (18057, '/node/17791', 'Fears for Crops as Shock Figures From America Show Scale of Bee Catastrophe(Common Dreams News)', 3) in /home/cyberfan/htdocs/sites/all/modules/relatedlinks/relatedlinks.module on line 464.
user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks (nid, url, title, type) VALUES (18057, '/node/17595', 'Snail Farming Could Save Endangered Gorillas(TreeHugger)', 3) in /home/cyberfan/htdocs/sites/all/modules/relatedlinks/relatedlinks.module on line 464.
user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks (nid, url, title, type) VALUES (18057, '/node/17267', 'Vladimir Putin Hearts Polar Bears(TreeHugger)', 3) in /home/cyberfan/htdocs/sites/all/modules/relatedlinks/relatedlinks.module on line 464.

any ideas? Thank you so much for your help on this!

holydrupal’s picture

StatusFileSize
new33.1 KB

I downloaded this patched version which is a complete module for drupal 6 without error

AntiNSA’s picture

when I used your patched attachment I receive :

user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks (nid, url, title, type) VALUES (5928, '/node/4780', 'Interview with Alex Steffen in The Sun(WorldChanging)', 3) in /home/cyberfan/htdocs/sites/all/modules/relatedlinks/relatedlinks.module on line 710.
user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks (nid, url, title, type) VALUES (5928, '/node/4352', 'The Parable of the Electric Bike(WorldChanging)', 3) in /home/cyberfan/htdocs/sites/all/modules/relatedlinks/relatedlinks.module on line 710.
user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks (nid, url, title, type) VALUES (5928, '/node/14368', 'The Architect\'s Role in a Warming World: Learning from Jamie Lerner(WorldChanging)', 3) in /home/cyberfan/htdocs/sites/all/modules/relatedlinks/relatedlinks.module on line 710.
user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks (nid, url, title, type) VALUES (5928, '/node/16616', 'Climate change Indicators in the U.S.: Summary of Scientific Findings(WorldChanging)', 3) in /home/cyberfan/htdocs/sites/all/modules/relatedlinks/relatedlinks.module on line 710.
user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks (nid, url, title, type) VALUES (5928, '/node/12443', 'Bolivian Indigenous Activist: We Must Respect Mother Earth, Our Pachamama(DemocracyNow!)', 3) in /home/cyberfan/htdocs/sites/all/modules/relatedlinks/relatedlinks.module on line 710.

so fustrating :( Thanks for your help! any ideas?

AntiNSA’s picture

Ah after uninstall and reinstall it worked! Thanks soooooo much! great module.

mattwmc’s picture

Yeah, this just started happening to me for some reason a few moments ago as well.

MrSlayer’s picture

I think I may have figured out what is causing this problem. Since it is saying duplicate entry for key 255, I checked the database and the auto increment number was set to 256, but for some reason it was still entering 255 for the key. So, I checked the structure of the table and sure enough, the lid field (the auto increment field) data type was set to TINYINT(3). I changed this to INT(5) and it is working now. Since I'm not much of a DBA, I don't know how much of an impact this will have as far as optimization.

vinayras’s picture

The fields "lid" and "nid" in "relatedlinks" table were set to TINYINT(3) - which can hold 255 entries at max. Same issue with "relatedlinks_tracker" table. This problem is happening on fresh D6 install also.

Just run following SQL statements to fix this issue.

ALTER TABLE `relatedlinks` CHANGE `lid` `lid` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
CHANGE `nid` `nid` INT UNSIGNED NOT NULL DEFAULT '0'

ALTER TABLE `relatedlinks_tracker` CHANGE `nid` `nid` INT UNSIGNED NOT NULL AUTO_INCREMENT
umesh sharma’s picture

yes, its work , and resolve our issue thanks, thanks a lot.

mattwmc’s picture

@#9 - Newbie, here. How do I do this?

Thanks!

Cool! Figured it out. http://www.ehow.com/how_2245774_run-sql-database-query.html

dagietje’s picture

Hello,

I run the following SQL statements, but I get a error:

ALTER TABLE `relatedlinks` CHANGE `lid` `lid` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
CHANGE `nid` `nid` INT UNSIGNED NOT NULL DEFAULT '0' ALTER TABLE `relatedlinks_tracker` CHANGE `nid` `nid` INT UNSIGNED NOT NULL AUTO_INCREMENT

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE `relatedlinks_tracker` CHANGE `nid` `nid` INT UNSIGNED NOT NULL AUTO' at line 4

Can someone help me?
Thx

dagietje’s picture

Anyone?
Thx

Zen’s picture

Title: user warning: Duplicate entry '255' for key 1 query: INSERT INTO relatedlinks_tracker (nid, keywords) VALUES (12296, '') in /re » Database schema incorrect in D6
Assigned: Unassigned » Zen
Zen’s picture

Status: Active » Fixed

This has been fixed. For those of you with existing installs with this bug, please follow #9.

-K

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.