Post by none » Fri Apr 09, 2021 6:02 pm

Hi,

Ive got a migrated OC 3.0.3.7. In order to migrate old SEO urls Ive done this here:
viewtopic.php?t=205218
So far everything was ok until I wanted to add a new product. When I tried to save the new product I've got HTTP 500 error in admin.
After investigating the problem I found the following in my error log:

Code: Select all

[09-Apr-2021 09:38:52 UTC] PHP Fatal error:  Uncaught Exception: Error: Duplicate entry '0' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_seo_url SET store_id = '0', language_id = '1', query = 'product_id=158', keyword = 'tesztelunk' in /home/tolokapu/public_html/zednew/system/library/db/mysqli.php:41
Stack trace:
#0 /home/tolokapu/public_html/zednew/system/library/db.php(45): DB\MySQLi->query('INSERT INTO oc_...')
#1 /home/tolokapu/public_html/zednew/admin/model/catalog/product.php(124): DB->query('INSERT INTO oc_...')
#2 /home/tolokapu/public_html/zednew/storage/modification/system/engine/loader.php(248): ModelCatalogProduct->addProduct(Array)
#3 /home/tolokapu/public_html/zednew/system/engine/proxy.php(47): Loader->{closure}(Array, Array)
#4 /home/tolokapu/public_html/zednew/admin/controller/catalog/product.php(23): Proxy->__call('addProduct', Array)
#5 /home/tolokapu/public_html/zednew/storage/modification/system/engine/action.php(79): ControllerCatalogProduct->add()
#6 /home/tolokapu/public_html/zednew/admin/controller/startup/router.ph in /home/tolokapu/public_html/zednew/system/library/db/mysqli.php on line 41
I checked my DB and I learned that each time I want to edit or add a new product the seo_url_id field value changes to zero. Even if I just want to edit a product. After certainly with the next product I get error that that is zero is already exist in the database.

Does anyone know what causes this problem?
Thanks

New member

Posts

Joined
Wed Sep 09, 2009 3:53 am

Post by JNeuhoff » Fri Apr 09, 2021 7:08 pm

Make sure your DB table oc_seo_url has an auto increment for its primary index on seo_url_id. Also, that the Next autoindex is set to value beyond the highest current value of seo_url_id. You can do all of this in your PHPMyAdmin.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by none » Fri Apr 09, 2021 10:46 pm

Thanks for your reply. Im not sure if Im doing it right. Could you check my attachment. Is it ok if I just tick that box and click "Go"?
Im sorry but I dont have huge knowledge in SQL queries.

Thanks

Attachments

Snap2000002952.jpg

Snap2000002952.jpg (111.81 KiB) Viewed 1606 times


New member

Posts

Joined
Wed Sep 09, 2009 3:53 am

Post by paulfeakins » Mon Apr 12, 2021 6:48 pm

none wrote:
Fri Apr 09, 2021 10:46 pm
Im sorry but I dont have huge knowledge in SQL queries.
Then maybe you should be paying a developer to do these things?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: sidclel and 88 guests