Closed (won't fix)
Project:
Drupal core
Version:
4.7.4
Component:
user system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Nov 2006 at 16:54 UTC
Updated:
24 Sep 2008 at 14:44 UTC
When trying to create a user manually I get the following error:
Warning: Duplicate entry '' for key 3 query: user_save INSERT INTO users (name, mail, pass, init, status, created, uid) VALUES ('drunk', 'user@some.com', '07b300c1e985d829afd1dfc13ae8ceab', 'user@some.com', 1, 1163091053, 11) in /home/martin/public_html/includes/database.mysql.inc on line 121
Warning: Cannot modify header information - headers already sent by (output started at /home/martin/public_html/includes/database.mysql.inc:121) in /home/martin/public_html/includes/common.inc on line 269
The user, of course, is not created (I did check.) However, when I load admin/users after the error I DO see a message "Created a new user account. No e-mail has been sent." Uh, what? No, a user has NOT been created. The only thing worse than erroring out instead of creating the user is erroring out instead of creating the user, then telling me the user has been created. I take it then that the user functionality doesn't actually test for return status before printing that message... This is NOT GOOD.
And, just for laughs:
mysql> select name from users;
+-------+
| name |
+-------+
| |
| drink |
+-------+
2 rows in set (0.00 sec)
Am I supposed to have an entry in here with nothing in the name field?
Comments
Comment #1
danbh commentedMy installation works, and it does have a blank in the first spot. The second spot is the super admin account. I have no idea how to help you further.
Comment #2
kkaefer commentedThis is not a bug. You probably messed around with the database. Take a look at your 'sequences' table and correct the values for uid. It should be the same as the highest uid number in your user table.
Comment #3
TPerkins commentedkkaefer is correct.
And quite often when this happens, in your case whoever had uid #3 may have been partially overwritten by the user you tried creating. I've seen it happen mostly with user roles.