[Skip to main content](#vessel-content)

#   Error message: 1062 Duplicate entry '403518'​ for key 'PRIMARY'

##

- **[Foxworks](/forum/user/7379-foxworks "View Foxworks's Profile")**
- [![Foxworks's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7379.png)](/forum/user/7379-foxworks "View Foxworks's Profile") Topic Author
- [ Offline](/forum/user/7379-foxworks)

Less More

- Posts: 93
- Thank you received: 5
-
-
-

6 years 5 months ago -  6 years 5 months ago [\#321115](#321115) by [Foxworks](/forum/user/7379-foxworks "View Foxworks's Profile")  *[Error message: 1062 Duplicate entry '403518'​ for key 'PRIMARY'](/forum/32-content-creation/900245-error-message-1062-duplicate-entry-403518-for-key-primary#321115 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : Joomla! 3.9.19 Stable &#91; Amani &#93; 2-June-2020 -- PHP version -- : 7.3.18 -- Error-message(debug-mod must be tuned on) -- : 1062 Duplicate entry '403518'​ for key 'PRIMARY'  This issue just cropped up. Whenever I try to add a new price to an item and try to save the product I get this error message:  1062 Duplicate entry '403518'​ for key 'PRIMARY'  It does not matter if I make a new product or edit an existing one. The product itself is saved but I cannot add a price.  I think this is a database error, but I don't know how to solve it.  EDIT: I just checked the hikashop&#95;price table in my database (because I think this is where the problem comes from). There is indeed already an entry with price&#95;id 403518 in there. But this is not the highest entry. The highest price&#95;id in my table is actually 404277, so i do not understand why Hikashop is trying to same the price&#95;id for a new product as lower than the latest added price&#95;id. Shouldn't the price&#95;id be automatically incremented?")* was created by *[Foxworks](/forum/user/7379-foxworks "View Foxworks's Profile")*

-- HikaShop version -- : 4.3.0
-- Joomla version -- : Joomla! 3.9.19 Stable [ Amani ] 2-June-2020
-- PHP version -- : 7.3.18
-- Error-message(debug-mod must be tuned on) -- : 1062 Duplicate entry '403518'​ for key 'PRIMARY'

This issue just cropped up. Whenever I try to add a new price to an item and try to save the product I get this error message:

**1062 Duplicate entry '403518'​ for key 'PRIMARY'**

It does not matter if I make a new product or edit an existing one. The product itself is saved but I cannot add a price.

I think this is a database error, but I don't know how to solve it.

EDIT:
I just checked the hikashop_price table in my database (because I think this is where the problem comes from). There is indeed already an entry with price_id 403518 in there. But this is not the highest entry. The highest price_id in my table is actually 404277, so i do not understand why Hikashop is trying to same the price_id for a new product as lower than the latest added price_id. Shouldn't the price_id be automatically incremented?

Last edit: 6 years 5 months ago by [Foxworks](/forum/user/7379-foxworks "View Foxworks's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vOTAwMjQ1LWVycm9yLW1lc3NhZ2UtMTA2Mi1kdXBsaWNhdGUtZW50cnktNDAzNTE4LWZvci1rZXktcHJpbWFyeT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Foxworks](/forum/user/7379-foxworks "View Foxworks's Profile")**
- [![Foxworks's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7379.png)](/forum/user/7379-foxworks "View Foxworks's Profile") Topic Author
- [ Offline](/forum/user/7379-foxworks)

Less More

- Posts: 93
- Thank you received: 5
-
-
-

6 years 5 months ago [\#321122](#321122) by [Foxworks](/forum/user/7379-foxworks "View Foxworks's Profile")  Replied by *[Foxworks](/forum/user/7379-foxworks "View Foxworks's Profile")* on topic *[Error message: 1062 Duplicate entry '403518'​ for key 'PRIMARY'](/forum/32-content-creation/900245-error-message-1062-duplicate-entry-403518-for-key-primary#321122 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : Joomla! 3.9.19 Stable &#91; Amani &#93; 2-June-2020 -- PHP version -- : 7.3.18 -- Error-message(debug-mod must be tuned on) -- : 1062 Duplicate entry '403518'​ for key 'PRIMARY'  This issue just cropped up. Whenever I try to add a new price to an item and try to save the product I get this error message:  1062 Duplicate entry '403518'​ for key 'PRIMARY'  It does not matter if I make a new product or edit an existing one. The product itself is saved but I cannot add a price.  I think this is a database error, but I don't know how to solve it.  EDIT: I just checked the hikashop&#95;price table in my database (because I think this is where the problem comes from). There is indeed already an entry with price&#95;id 403518 in there. But this is not the highest entry. The highest price&#95;id in my table is actually 404277, so i do not understand why Hikashop is trying to same the price&#95;id for a new product as lower than the latest added price&#95;id. Shouldn't the price&#95;id be automatically incremented?")*

I think I fixed the issue. In PHPMyAdmin for my hosting I went into the hikashop_price table and in the table options I changed the AUTO_INCREMENT setting to the current highest price_id +1. I can now save new prices again.

If anyone from Hikashop reads this, could you please let me know if this is indeed a correct fix for this issue?
I would also like to know how this could have happened and what I can do to prevent this from happening again.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vOTAwMjQ1LWVycm9yLW1lc3NhZ2UtMTA2Mi1kdXBsaWNhdGUtZW50cnktNDAzNTE4LWZvci1rZXktcHJpbWFyeT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

6 years 5 months ago [\#321127](#321127) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Error message: 1062 Duplicate entry '403518'​ for key 'PRIMARY'](/forum/32-content-creation/900245-error-message-1062-duplicate-entry-403518-for-key-primary#321127 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : Joomla! 3.9.19 Stable &#91; Amani &#93; 2-June-2020 -- PHP version -- : 7.3.18 -- Error-message(debug-mod must be tuned on) -- : 1062 Duplicate entry '403518'​ for key 'PRIMARY'  This issue just cropped up. Whenever I try to add a new price to an item and try to save the product I get this error message:  1062 Duplicate entry '403518'​ for key 'PRIMARY'  It does not matter if I make a new product or edit an existing one. The product itself is saved but I cannot add a price.  I think this is a database error, but I don't know how to solve it.  EDIT: I just checked the hikashop&#95;price table in my database (because I think this is where the problem comes from). There is indeed already an entry with price&#95;id 403518 in there. But this is not the highest entry. The highest price&#95;id in my table is actually 404277, so i do not understand why Hikashop is trying to same the price&#95;id for a new product as lower than the latest added price&#95;id. Shouldn't the price&#95;id be automatically incremented?")*

Hi,

The only ways I can see are:
- that the auto_increment value of the hikashop_price table has been modified to be lower than the max price_id. That would require manual intervention in phpmyadmin.
-that prices were injected in the hikashop_price table with the price_id already provided and bigger than the auto_increment at some point in the past. And it was fine, until the auto_increment catched up with these price_ids. Such injection could be done by some importing tool / script, or maybe some backup restore system gone awry. I'm suspecting that these price entries have been there for a long while.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vOTAwMjQ1LWVycm9yLW1lc3NhZ2UtMTA2Mi1kdXBsaWNhdGUtZW50cnktNDAzNTE4LWZvci1rZXktcHJpbWFyeT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.051 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
