Zen Cart Logo
Forums / General Questions / PHP Fatal error: 1062:Duplicate entry

PHP Fatal error: 1062:Duplicate entry

Views: 2,953

Results 1 to 7 of 7
17 Aug 2013, 9:20 AM
#1
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

PHP Fatal error: 1062:Duplicate entry

Can anyone please help. These errors just started in my logs and I can't figure out how to fix it. Can anyone please help? Thank you.

PHP Fatal error: 1062:Duplicate entry 'ca34fbe5f9a075091ad59abf02c259a7-1' for key 'PRIMARY' :: INSERT INTO zen_seo_cache (cache_id, cache_language_id, cache_name, cache_data, cache_global, cache_gzip, cache_method, cache_date, cache_expires) VALUES ('ca34fbe5f9a075091ad59abf02c259a7', '1', 'seo_urls_v2_products', 'tL1bkys7jh767l9x3saOOIpQXiWFnxy2H30Jh8+zI6VSVWmXLjW6rNVr//

17 Aug 2013, 9:37 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PHP Fatal error: 1062:Duplicate entry

joyjoy:

Can anyone please help. These errors just started in my logs and I can't figure out how to fix it. Can anyone please help? Thank you.

PHP Fatal error: 1062:Duplicate entry 'ca34fbe5f9a075091ad59abf02c259a7-1' for key 'PRIMARY' :: INSERT INTO zen_seo_cache (cache_id, cache_language_id, cache_name, cache_data, cache_global, cache_gzip, cache_method, cache_date, cache_expires) VALUES ('ca34fbe5f9a075091ad59abf02c259a7', '1', 'seo_urls_v2_products', 'tL1bkys7jh767l9x3saOOIpQXiWFnxy2H30Jh8+zI6VSVWmXLjW6rNVr//

The cause of the problem is a lot more difficult to identify than the fix. This means I'm about to tell you how to fix the problem, but I can't make any claims that the problem won't re-occur.

Log into the cPanel of your hosting account (if you don't use cPanel you should still be able to follow the same steps with whatever control panel you do have).

Look for the 'phpMyadmin' tool and activate it.
Navigate your way to your store database and click on the tabled named "zen_seo_cache"
Click on the 'Operations' TAB.
Then click the link that reads "Empty the table (TRUNCATE)"

That's it. The errors should now now go away. They may or may not return again, as this will depend on the cause of the problem. If the problem reoccurs consistently it will warrant further investigation, but if it re-occurs only rarely it is probably caused by some kind of 'race condition' and can probably be ignored as it isn't something that you or I will be able to resolve.

Cheers
Rod

17 Aug 2013, 9:43 AM
#3
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Re: PHP Fatal error: 1062:Duplicate entry

Thank you so much for your help. I will try this. Also I realize I didn't include the end of the error log. I'm not sure if this will help any.

"...mysql/query_factory.php on line 120"

Thank you.

17 Aug 2013, 9:56 AM
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PHP Fatal error: 1062:Duplicate entry

joyjoy:

Also I realize I didn't include the end of the error log. I'm not sure if this will help any.

"...mysql/query_factory.php on line 120"

In this instance it doesn't matter. This is simply telling us that it is "mysql/query_factory.php" reporting/recording the errors.
This will be consistent with almost all zencart SQL errors.

Cheers
Rod

15 Sep 2013, 10:22 PM
#5
nyasha avatar

nyasha

New Zenner

Join Date:
Feb 2013
Posts:
6
Plugin Contributions:
0

Re: PHP Fatal error: 1062:Duplicate entry

Rod, i wonder if you could kindly assist. I have been experiencing a problem with the order confirmation emails coming through. Most of the time this works perfectly but sometimes it doesnt. The only way of me knowing that there is an order is when I receive an email from 2Checkout. I tried to do what you stated above but I have experienced the same problem again. I have posed this query before and I didnt get much help. I am using version 1.5.0. I havent updated to the latest version. On going through the cashe as I was directed to do, this is the error that was recorded on one of the days when the email didnt come through:
[01-Sep-2013 11:05:34] PHP Fatal error: 1062:Duplicate entry 'zc_9b41e5ce79b3ea0cb51c3c6e45a797e8' for key 'PRIMARY' :: insert into znc_db_cache set cache_entry_name = 'zc_9b41e5ce79b3ea0cb51c3c6e45a797e8',
cache_data = 'YTo4OntpOjA7YTo0OntzOjEzOiJjYXRlZ29yaWVzX2lkIjtzOjM6IjE2OSI7czoxNToiY2F0ZWdvc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NToiY2F0ZWdvcmllc19uYW1lIjtzOjk6IkhvdXNlaG9sZCI7czo5OiJwYXJlbnRfaWQiO3M6MToiMCI7czoxNjoiY2F0ZWdvcmllc19pbWFnZSI7Tjt9aTo3O2E6NDp7czoxMzoiY2F0ZWdvcmllc19pZCI7czozOiIxMTkiO3M6MTU6ImNhdGVnb3JpZXNfbmFtZSI7czoxOToiUGVyc29uYWwgVG9pbGV0cmllcyI7czo5OiJwYXJlbnRfaWQiO3M6MToiMCI7czoxNjoiY2F0ZWdvcmllc19pbWFnZSI7Tjt9fQ==',
cache_entry_created = '1378055134' in /home4/zimbogin/public_html/includes/classes/db/mysql/query_factory.php on line 101
Please can you assist as I need to get this resolved as soon as possible. Thank you.

16 Sep 2013, 1:19 PM
#6
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: PHP Fatal error: 1062:Duplicate entry

Nyasha:

... I have been experiencing a problem with the order confirmation emails coming through. Most of the time this works perfectly but sometimes it doesnt. ...
I doubt this error message is associated with an issue with emails.... But if you want those "errors" with "db_cache" to go away, just turn off "database" caching (for potentially long running database queries). This may have a small impact on performance (in some cases may be negative, in others positive)...

Go into "/includes/configure.php" and "/admin/includes/configure.php" and change the setting for 'SQL_CACHE_METHOD' to 'none'. Yes, this needs to be done in both places.

Note: For a full description of this (and other) settings in the configure.php please read this article.

2 Jan 2014, 9:17 AM
#7
royaldave avatar

royaldave

Zen Follower

Join Date:
Aug 2013
Location:
Perth, WA, AU
Posts:
284
Plugin Contributions:
1

Re: PHP Fatal error: 1062:Duplicate entry

I'm periodically getting a similar error , if anyone can help -

[02-Jan-2014 02:58:30 Australia/Perth] PHP Fatal error: 1062:Duplicate entry 'zc_d6616cb5f4c2cb55d422ea67feb723b0' for key 'PRIMARY' :: insert into db_cache set cache_entry_name = 'zc_d6616cb5f4c2cb55d422ea67feb723b0',
cache_data = 'YTo1ODM6e2k6MDthOjI6e3M6NjoiY2Zna2V5IjtzOjEwOiJTVE9SRV9OQU1FIjtzOjg6ImNmZ3ZhbHVlIjtzOjE0OiJGdW5reSBCYWxsb29ucyI7fWk6M

ending ....

jt9aTo1Nzk7YToyOntzOjY6ImNmZ2tleSI7czozNzoiUFJPRFVDVF9MSVNUSU5HX0xBWU9VVF9TVFlMRV9DVVNUT01FUiI7czo4OiJjZmd2YWx1ZSI7czoxOiIwIjt9aTo1ODA7YToyOntzOjY6ImNmZ2tleSI7czoyNToiUFJPRFVDVF9MSVNUSU5HX0dSSURfU09SVCI7czo4OiJjZmd2YWx1ZSI7czoxOiIwIjt9aTo1ODE7YToyOntzOjY6ImNmZ2tleSI7czoyNzoiU1RPUkVfVEVMRVBIT05FX0NVU1RTRVJWSUNFIjtzOjg6ImNmZ3ZhbHVlIjtzOjA6IiI7fWk6NTgyO2E6Mjp7czo2OiJjZmdrZXkiO3M6MTY6IlNTTFBXU1RBVFVTQ0hFQ0siO3M6ODoiY2ZndmFsdWUiO3M6MDoiIjt9fQ==',
cache_entry_created = '1388602710' in /clientdata/n5200-2-static/f/u/funkyballoons.com.au/www/zencart/includes/classes/db/mysql/query_factory.php on line 120