Everything works fine but not all of a sudden I get this error when posting a new story/page.

user error: Duplicate entry '24' for key 1
query: INSERT INTO node (status, moderate, promote, sticky, title, body, format, uid, created, type, teaser, changed, nid) VALUES('1', '0', '1', '0', 'test', 'this is a test', '1', '1', '1149692821', 'story', 'this is a test', '1149692832', '24') in /opt/intranet/includes/database.mysql.inc on line 66.

warning: Cannot modify header information - headers already sent by (output started at /opt/intranet/includes/common.inc:384) in /opt/intranet/includes/common.inc on line 192.

i can manually add an entry into the database but the site wont do it! noting has changed since any ideas would be appreciated.

Comments

rivena’s picture

Check your node table... what is the highest node ID? Check your sequences table, what is the node id there? If it is lower, that may be your problem. Just set the node id in your sequences table to any number higher than what is in your node table, and try again. :)

Anisa.

-----------------------------------------------------------
Kindness builds stronger bonds than necessity.

www.animecards.org - 16,000 card scans and counting!
-----------------------------------------------------------

jweinraub’s picture

node table:
if i list how phpmyadmin lists it by default, the last number is 3, but it goes 57,1,2,3..
if i list by numerical last becomes 62 but goes 55,56,57,60,62...

weird i guess that can be a cause...

as for sequences..

node_id says 24....so i just made it 63 and this appeared to fix the problem...so why did this happen in hte first place?

rivena’s picture

Not really sure! Somewhere, something forgot to update the sequences table. I think there are more detailed explanations if you search for 'sequences table'.

But it's a pain in the butt, isn't it? ^.^

Anisa.

-----------------------------------------------------------
Kindness builds stronger bonds than necessity.

www.animecards.org - 16,000 card scans and counting!
-----------------------------------------------------------

jweinraub’s picture

but thanks i was going nuts googling stuff considering reinstalling drupal, etc, did mysql table repairs. i did see overheard on the nodes table and such, but glad i got this sorted out. i had to get some things posted on the intranet here and was frustrated why this wasnt working...i am the only admin so it's ok...