I am having a problem with user signups after upgrading to Drupal 6.4 on a clean install with a new data base.

user warning: Duplicate entry '0' for key 1 query: INSERT INTO users (name, mail, pass, status, timezone, init, created, access) VALUES ('Fanessa', 'celestial_fanessa@sbcglobal.net', '63b5980ae3324348d1119c637d3fa38f', 1, -18000, 'celestial_fanessa@sbcglobal.net', 1219272448, 1219272448) in /home/veterans/public_html/modules/user/user.module on line 325.
Error saving user account.

Comments

energypro’s picture

I am having the same issue with 6.4! I cannot save a new user account either! I need HELP ASAP!

Here's my error:
user warning: Duplicate entry '0' for key 1 query: INSERT INTO uc_orders (uid, order_status, order_total, primary_email, delivery_first_name, delivery_last_name, delivery_phone, delivery_company, delivery_street1, delivery_street2, delivery_city, delivery_zone, delivery_postal_code, delivery_country, billing_first_name, billing_last_name, billing_phone, billing_company, billing_street1, billing_street2, billing_city, billing_zone, billing_postal_code, billing_country, payment_method, data, created, modified) VALUES (0, 'in_checkout', 0, '', '', '', '', '', '', '', '', 0, '', 0, '', '', '', '', '', '', '', 0, 0, 0, '', '', 1219719702, 1219719702)

energypro’s picture

I just fixed the issue:

I went into my phpMyAdmin from my CPanelX. I found the table: uc_orders, then made sure that the order_ID had the "Extra" field set to "auto_increment"

Yeah!!!!

mikeyx’s picture

where one sets a field to autoincrement?

DesTincT’s picture

not working for "users" table.

I think some counter reseted in database, and table filling from the begining. I changed "uid" values for users and got many errors on admin page...

don't know how to fix it...

hychanhan’s picture

Hi,

I am having a problem relate with users registration on drupal-6.12

When users start to register to my website i always appear an error message:

========================================

* user warning: Duplicate entry '0' for key 1 query: INSERT INTO khos_users (name, mail, timezone, pass, init, status, created) VALUES ('han0089', 'han0089@yahoo.com', 25200, '9cab589f3fe89130a17f9c7baa8123d8', 'han0089@yahoo.com', 1, 1249608555) in /home/virtualmin/wordforgefoundation.org/domains/khmeros.info/public_html/drupal612/modules/user/user.module on line 327.
* Error saving user account.

========================================

Please kindly help me now.

Best regards,
HY ChanHan

dontulio’s picture

I'm getting the same problem with version 6.13. I don't even know how long this has been going on. Apparently it wasn't working a few versions back either on my site.

Any solution to this?????

dontulio’s picture

I tried a few things and got it to work. I couldn't do it through any editor though.

NOTE: This worked for me, so make sure you back up your database (don't overwrite your local backup)

I exported the SQL and searched for `users. I then manually made the following changes with notepad and restored from the modified file:

>>>>>>

FROM

`uid` int(10) unsigned NOT NULL default '0',

TO

`uid` int(10) unsigned NOT NULL auto_increment,

<<<<<<

Removing the default "0" and setting to auto_increment seemed to do the trick. I don't know if I've broken anything else while trying to fix this, but then again, my site has been broken for a while.

I hope this helps.

I will not claim to know SQL or MySQL. I just tried until something worked. If anyone has a more elegant alternative, please post.

ericinwisconsin’s picture

That worked for me, Dontulio. Thanks!

I just hope I haven't seriously screwed something up by doing this.

I agree with DesTincT in that it's probably a counter somewhere within the database that has become screwed up and it's now trying to write to the 'users' table with a uid value of '0', which is used by the first record, so it won't allow it to duplicate that number. This is a job for someone more familiar with Drupal than I.