A simple site was working fine, then suddenly I started getting these errors:
• user warning: Duplicate entry '89-114' for key 'PRIMARY' query: INSERT INTO upload (fid, nid, vid, list, description, weight) VALUES (114, 89, 89, 1, 'Governance Minutes 24.05.10.doc', 0) in /usr/share/drupal6/modules/upload/upload.module on line 411
Every time a create a new node with a file Uploaded. If there is no file attachment, its fine - but as soon as I attach a file using the Upload module, this error occurs. The node still gets created, the file is uploaded, and nothing seems wrong with it, but obviously I need to get rid of the error message.
I don't believe I changed anything related to Upload any time recently...
From the error message, I am assuming that the code is trying to insert a reference to the same primary key representing the uploaded file multiple times --- but I have no idea why, or why this would have changed.
Can anyone make any suggestions?
Comments
Also getting this error
I am also getting this error, intermittently. I can't seem to re-create it with all my testing.
Duplicate entry '478-398' for key 1 query: INSERT INTO upload (fid, nid, vid, list, description, weight) VALUES (398, 58, 478, 1, '.......pdf', 0) in /www/...../docroot/modules/upload/upload.module on line 420.
Drupal 6.19
Very similar dupe error
I've just gotten a very similar dupe error on my 6.22 dev server. This happened when creating a new entry... in this case, for node #74. The node gets created, the attachment gets successfully uploaded, shows properly on the returned page, and the link works correctly. Operationally, everything is fine, but just throws the error. The same node during an edit works as expected (without modifying the attachment), and doesn't error. I haven't tried to change the attachment yet, but I'll give that a shot to see what happens.
Duplicate entry '74-42' for key 'PRIMARY' query: INSERT INTO htdrupal_upload (fid, nid, vid, list, description, weight) VALUES (42, 74, 74, 1, 'HT_StoreNotes.pdf', 0) in C:\xampp\htdocs\htdrupal\modules\upload\upload.module on line 419.