Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2016
    Location
    Helmond
    Posts
    5
    Plugin Contributions
    0

    Default Error 1062:Duplicate entry for key 'PRIMARY' in products_description

    www.carmo.nl
    ZC Version 1.5.4
    PHP versie: 5.4.45-0+deb7u8 (Zend: 2.4.0)
    Database: MySQL 5.5.55-0+deb7u1

    Hi everyone. We are unable to modify or add new products to the website, this is new since a couple of weeks. We receive an "Warning an error has occurred"

    When we open the log files we get this:

    [15-Jun-2017 17:10:14 Europe/Berlin] Request URI: /admin/product.php?cPath=4102_4104&product_type=1&action=insert_product,
    #1 trigger_error() called at [/store/includes/classes/db/mysql/query_factory.php:155]
    #2 queryFactory->show_error() called at [/store/includes/classes/db/mysql/query_factory.php:132]
    #3 queryFactory->set_error() called at [/store/includes/classes/db/mysql/query_factory.php:262]
    #4 queryFactory->Execute() called at [/store/admin/includes/functions/database.php:53]
    #5 zen_db_perform() called at [/store/admin/includes/modules/update_product.php:179]
    #6 require(/store/admin/includes/modules/update_product.php) called at [/store/admin/product.php:62]

    [15-Jun-2017 17:10:14 Europe/Berlin] PHP Fatal error: 1062:Duplicate entry '2510-3' for key 'PRIMARY' :: insert into shopproducts_description (products_name, products_description, products_url, products_id, language_id) values (‘Test product’, '', '', '2510', '3') ==> (as called by) /store/admin/includes/functions/database.php on line 53 <== in /store/includes/classes/db/mysql/query_factory.php on line 155

    I have looked on 50 different webpages now but I am unable to solve the issue.

    We also use the Zen-cart store manager, there i can add and modify products but not when using the CMS. Can you please assist or point me in the right direction. Many thanks.

    Cheers.

    Kevin
    Carmo electronics.
    The Netherlands.

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: PHP Fatel error: 1062

    Which operation was expected for the above error log related to products_id 2510? Was it a product update or an insert of a product?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Nov 2016
    Location
    Helmond
    Posts
    5
    Plugin Contributions
    0

    Default Re: PHP Fatel error: 1062

    Quote Originally Posted by mc12345678 View Post
    Which operation was expected for the above error log related to products_id 2510? Was it a product update or an insert of a product?
    Thank you for your fast reply. It gets better when i search in the database for that ID number the only thing that pops up, the new product i want to add. So it adds the product to the database (most of the time).

  4. #4
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: PHP Fatel error: 1062

    Quote Originally Posted by Carmokevin View Post
    Thank you for your fast reply. It gets better when i search in the database for that ID number the only thing that pops up, the new product i want to add. So it adds the product to the database (most of the time).
    Well, the sql error indicated that at least part of the product add occurred successfully based on the duplicate key error on insert. The thread title indicates that there is an issue with both adding and modifying entries.

    Generally speaking, an update of a product should not cause a duplicate key on insert issue because in a stock ZC install, insert of a new product is expected to populate all tables associated such that an edit would update those fields/tables.

    Thing is, in the OP it is mentioned that product is also "updated/managed" by the "Zen-Cart Store Manager", could you please elaborate on that "software" and/or its use as it might relate to this issue? There is the possibility of additional software attempting to duplicate the operations of the standard ZC process and that could cause a duplicate insert action.

    Another thing, because the duplicate record indicates a language_id of 3 (not 1) as an issue, another aspect of this issue could be related (remotely? Or possibly not at all) to the use of an unaltered/uncorrected ZC 1.5.4 and multiple languages as identified in: http://www.zen-cart.com/showthread.p...s)-with-v1-5-4
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Jun 2017
    Location
    Netherlands
    Posts
    1
    Plugin Contributions
    0

    Default Re: PHP Fatel error: 1062

    Problem solved,

    We found out that in the products_description and categories_description tables the default value of product_name was set to NULL in the structure settings.
    After the change we can add or modify any products.

    We have no clue if this has any connection with the store manager.

    Thank you for your time.

  6. #6
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: PHP Fatel error: 1062

    Quote Originally Posted by CarmoWout View Post
    Problem solved,

    We found out that in the products_description and categories_description tables the default value of product_name was set to NULL in the structure settings.
    After the change we can add or modify any products.

    We have no clue if this has any connection with the store manager.

    Thank you for your time.
    I didn't push for this in earlier response, but if you flush out the remaining aspects of the posting tips then it might help also identify why those two fiedls were assigned the way they were. It would be surprising if some other plugin modified the default database field settings as described. There basically is no reason to do so.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Nov 2016
    Location
    Helmond
    Posts
    5
    Plugin Contributions
    0

    Default Re: PHP Fatel error: 1062

    You are probably right. Thanks anyway for our assistance.

    Greetings

    Kevin

 

 

Similar Threads

  1. Replies: 3
    Last Post: 21 Jan 2016, 10:35 PM
  2. Replies: 2
    Last Post: 11 Dec 2012, 03:58 AM
  3. Replies: 3
    Last Post: 7 Nov 2012, 05:36 AM
  4. v151 PHP Fatal error:1062:Duplicate entry '1-1' for key 'PRIMARY'
    By Dopefish in forum General Questions
    Replies: 14
    Last Post: 19 Oct 2012, 02:58 AM
  5. Error when importing DB - #1062 - Duplicate entry '1' for key 'PRIMARY'
    By CheapStairParts in forum General Questions
    Replies: 0
    Last Post: 5 Jan 2011, 03:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR