Duplicate Entry 0 for Key 1 [SOLVED]

Need help upgrading your Joomla! website or converting to Joomla! 1.5?

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Post Reply
User avatar
dancurranjr
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Apr 25, 2006 8:47 pm

Duplicate Entry 0 for Key 1 [SOLVED]

Post by dancurranjr » Mon Aug 20, 2007 10:17 pm

I recently moved Devils Canyon Brewery to a new server, exported the old sql and reimported at the new location.

Whenever I post a new article it will not show up on the front page. The key in the table is at 0 so I have to use the sql interface and go in and manually change it to the next number (86, 87, etc).
d
Now I noticed that people cannot register:

mosuser::store failed
Duplicate entry \'0\' for key 1 SQL=INSERT INTO jos_users ( `id`,`name`,`username`,`email`,`password`,`gid`,`registerDate` ) VALUES ( . . . . . . )

Its almost like the database ddoesn't know it has records and is trying to start from scratch.  Any help greatly appreciated.
Last edited by dancurranjr on Mon Aug 27, 2007 10:03 pm, edited 1 time in total.

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 21948
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, The Netherlands
Contact:

Re: Duplicate Entry 0 for Key 1

Post by pe7er » Sun Aug 26, 2007 5:25 pm

Use phpMyAdmin to check the table.

jos_users should have an "Next Autoindex" which should be the next ID that can be used.
With the "Operations" tab you'll get a form where you can increase the "auto_increment".

(PS: before making any changes it's recommended to backup your database).
Kind Regards,
Peter Martin, Global Moderator
https://db8.nl - Joomla specialist, Nijmegen, Nederland
Co-founder of data2.eu GDPR Tool https://data2.eu/en/gdpr-tool

User avatar
dancurranjr
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Apr 25, 2006 8:47 pm

Re: Duplicate Entry 0 for Key 1

Post by dancurranjr » Sun Aug 26, 2007 11:27 pm

Thanks, You got me pointed in the right direction.

Here is whats happening now.

I made a copy of jos_users  --> jos_usersORIGINAL
and jos_comprofiler  --> jos_comprofilerORIGINAL

So I am not working on the "masters"

Deleted Key 0 in both.

Went to OPERATIONS page of both and at the bottom under AutoIncrement enterd 584 (the next number)

This would let me go to the registration page and register a new member but then checking th tables the ID number was 0 again

Like I said though, you got me in the right directions - the ANSWER was to go to the STRUCTURE tab, select the ID, tell it the next number was 584 and then AUTO INCREMENT.

Did that to both tables - Wallah! Ta Da!

Then when one goes back to the OPERATIONS page youll see 584 in the bottom auto increment.

So that will help on a few random errors I have been receiving. Thank you for responding to this post. I hope my reply helps someone else!

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 21948
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, The Netherlands
Contact:

Re: Duplicate Entry 0 for Key 1

Post by pe7er » Mon Aug 27, 2007 7:35 am

You're welcome! Good to read that you've solved that problem!

PS: Could you please mark your first message in this thread as "solved" ? (Modify the first message and choose the Message Icon [solved] Image).
This way the list of messages shows that the question has been solved, and other users can benefit from it.
Thanks!
Kind Regards,
Peter Martin, Global Moderator
https://db8.nl - Joomla specialist, Nijmegen, Nederland
Co-founder of data2.eu GDPR Tool https://data2.eu/en/gdpr-tool

User avatar
dancurranjr
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Apr 25, 2006 8:47 pm

Re: Duplicate Entry 0 for Key 1

Post by dancurranjr » Mon Aug 27, 2007 10:02 pm

Ok . . . .  I'm not seeing a message solved icon in the first message. . .

jnba
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sat May 17, 2008 1:39 am

Re: Duplicate Entry 0 for Key 1 [SOLVED]

Post by jnba » Sat Jul 16, 2011 6:41 pm

You guys are awesome.. after days.. of searching this did it .. although i couldnt find it searching here had to google it and redirect here..anyways even though this is a 5 year old post it worrked perfecto!

thanks,

John

jnba
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sat May 17, 2008 1:39 am

Re: Duplicate Entry 0 for Key 1 [SOLVED]

Post by jnba » Sat Jul 16, 2011 8:09 pm

jnba wrote:You guys are awesome.. after days.. of searching this did it .. although i couldnt find it searching here had to google it and redirect here..anyways even though this is a 5 year old post it worrked perfecto!

thanks,

John

Correction.. it worked but the users are not listed in User manager..no im lost again..

any ideas..?

jnba
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sat May 17, 2008 1:39 am

Re: Duplicate Entry 0 for Key 1 [SOLVED]

Post by jnba » Sun Jul 17, 2011 6:45 pm

jnba wrote:
jnba wrote:You guys are awesome.. after days.. of searching this did it .. although i couldnt find it searching here had to google it and redirect here..anyways even though this is a 5 year old post it worrked perfecto!

thanks,

John

Correction.. it worked but the users are not listed in User manager..no im lost again..

any ideas..?
Update... in order to get this working i had to manually back up my local database and upload it to the live server.. now its working perfectly, i do not know the reasons for this but hopefully in the future someone will post a perm fix .. thanks all.

User avatar
sunshine1688
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Mon Jun 27, 2011 1:59 pm
Location: Thailand
Contact:

Re: Duplicate Entry 0 for Key 1 [SOLVED]

Post by sunshine1688 » Sat Jun 27, 2015 9:09 am

I just saw the same problem on Joomla 3, but after force refreshed the page, thing going to normal.


Post Reply

Return to “Migrating and Upgrading to Joomla! 1.5”