[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do i correct the duplicate entry error in Drupal

Posted on 2008-11-05
5
Medium Priority
?
711 Views
Last Modified: 2013-12-13
My website that uses drupal has been down since yesterday and all it displays is this error:

Fatal error: Duplicate entry 'b7c59e0ea3545b9b42b8372e87cee12e' for key 1 query: INSERT INTO sessions (sid, uid, hostname, timestamp) VALUES ('b7c59e0ea3545b9b42b8372e87cee12e', 0, '212.3.247.30', 1225948156) in /var/www/ffa/includes/database.mysql.inc on line 66

I have repaired and emptied the session tables but it is still not working. I also tried increasing the node id in the sequence table but still it is not working..

Can any one be of help?

Thanks
0
Comment
Question by:tdopsdarock
  • 3
  • 2
5 Comments
 
LVL 17

Expert Comment

by:HuyBD
ID: 22892434
try this
REPLACE INTO sessions (sid, uid, hostname, timestamp) VALUES ('b7c59e0ea3545b9b42b8372e87cee12e', 0, '212.3.247.30', 1225948156)

Open in new window

0
 

Author Comment

by:tdopsdarock
ID: 22892976
should i add the line to the database.mysql.inc file? or run it as a mysql query?
0
 
LVL 17

Expert Comment

by:HuyBD
ID: 22893069
you can run the query, it inserts if the key doesn't exist
0
 

Author Comment

by:tdopsdarock
ID: 22893922
This did not seem to work..Any other suggestions?
0
 

Accepted Solution

by:
tdopsdarock earned 0 total points
ID: 22894320
Just found the solution at http://drupal.org/node/21120
I guess the default userid was deleted to correct use just run the SQL query
INSERT INTO users (uid, name, mail) VALUES ('0', '', '');
INSERT INTO users_roles (uid, rid) VALUES (0, 1);

Open in new window

0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month18 days, 12 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question