Skip to main content

An error has occurred. 1062 Duplicate entry '101-119' for key 'PRIMARY'

More
3 hours 4 minutes ago #100000340 by MSTACE
-- url of the page with the problem -- : www.notable.au/
-- HikaShop version -- : 6.7.1
-- Joomla version -- : 6.2.0
-- PHP version -- : 8.5.12
-- Browser(s) name and version -- : Chrome 155.0
-- Error-message(debug-mod must be tuned on) -- : An error has occurred. 1062 Duplicate entry '101-119' for key 'PRIMARY'

When saving any Hikashop product, I get the error message "Duplicate entry '102-119' for key 'PRIMARY'"  "Return to Dashboard".
The same error occurs every time, no matter which product is tried.

I ran phpMyAdmin. No database errors on check. Nothing looks suspicious.
106

Please Log in or Create an account to join the conversation.

More
2 minutes ago #100000343 by nicolas
Hi,

This error does not come from your products themselves but from the Joomla Smart Search index. When a product is saved, HikaShop's "Smart Search - HikaShop" plugin asks Joomla's Smart Search to index it again, and Joomla's indexer fails while writing the words of the product into its table #__finder_links_terms (the two numbers in the message are the index entry of the product and the id of a word, which is why only the first number changes from one product to the next). The product itself is saved before that step, so your changes are not lost: only the page ends on the error instead of coming back to the product.

This happens when the Smart Search index tables are out of step, typically on a site that has been updated over many years or whose database collations were changed: the words table (#__finder_terms) then sees as identical two spellings that the indexer treats as different, for example with and without an accent, and the same word gets written twice for a product.

To fix it, go to Content > Smart Search in your Joomla backend, click "Clear Index" (if you set up Smart Search content maps or filters, note them first, as clearing the index removes them), then click "Index" to rebuild it. Saving a product should then work again.

If the error comes back after the index is rebuilt, check in phpMyAdmin that the "term", "stem" and "soundex" columns of the tables #__finder_terms, #__finder_tokens and #__finder_tokens_aggregate use the collation utf8mb4_bin, as Joomla creates them, and set them back to it if they don't.

If you don't use the Joomla Smart Search on your site, you can instead simply disable the "Smart Search - HikaShop" plugin in System > Plugins: the error will go away as well.

If none of this helps, please turn on "Debug System" in the Joomla Global Configuration, save a product again and send us the full error page with its call stack, so we can see exactly which query fails.

Please Log in or Create an account to join the conversation.

Time to create page: 0.132 seconds
Powered by Kunena Forum