Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Duplicate Mysql query

    There appears to be a duplicate Mysql query executing with same field in the primary key I am not sure what is causing this problem, I have recently upgraged the site from 1.5.3 to 1.5.5a and I have recently installed the responsive theme sheffield blue ... so lots of potential for where the problem might be I guess. Here is the exact problem being logged by zencart admin.

    PHP Fatal error: 1062: Duplicate entry 'zc_6f04dac868865df99eb25f13ecae29f6' for key 'PRIMARY' :: insert into cabdb_cache set cache_entry_name = 'zc_6f04dac868865df99eb25f13ecae29f6'

    This happens lots of times by the way, hope somebody can help, thanks.

    I am also getting a parse error
    PHP Parse error: syntax error, unexpected $end in /public_html/includes/languages/english/schneiderstyle/time_out.php on line 19 - that (schneiderstyle) is in an older override folder I no longer use .... again any thoughts gratefully appreciated.
    Last edited by Pauls; 23 Jul 2016 at 09:20 PM.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: Duplicate Mysql query

    When you did your upgrade, did you pick up the change to /includes/classes/cache.php? In an as-shipped Zen Cart 1.5.5a file-set, there's no INSERT INTO the cache database table; it's been updated to an INSERT IGNORE INTO.

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

    Default Re: Duplicate Mysql query

    That issue of the duplicate key was resolved definitely in ZC 1.5.5 and I thought sooner (it at least made one of the known bugs list for one of the recent earlier versions.)

    Suggest double checking the upgrade (how was it performed?).

    As to the "random" override, either something else is purposefully loading that file or the template is considered active in your tools->template selection area. Or possibly the database entries in your configure.php files are incorrect (make sure that your DB_PREFIX is the same in both includes/configure.php and admin/includes/configure.php as well matches the same in your files of the store before upgrade.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: Duplicate Mysql query

    Hi lat9,
    thanks for the quick response, here is what my current cache.php states
    $sql = "insert ignore into " . TABLE_DB_CACHE . " (cache_entry_name, cache_data, cache_entry_created) VALUES (:cachename, :cachedata, unix_timestamp() )";

    So I think that is how it should be if I understand you correctly.

  5. #5
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: Duplicate Mysql query

    Quote Originally Posted by mc12345678 View Post
    That issue of the duplicate key was resolved definitely in ZC 1.5.5 and I thought sooner (it at least made one of the known bugs list for one of the recent earlier versions.)

    Suggest double checking the upgrade (how was it performed?).

    As to the "random" override, either something else is purposefully loading that file or the template is considered active in your tools->template selection area. Or possibly the database entries in your configure.php files are incorrect (make sure that your DB_PREFIX is the same in both includes/configure.php and admin/includes/configure.php as well matches the same in your files of the store before upgrade.
    This is a difficult one to answer MC ... I upgraded to the best of my ability .... and followed the instructions as much as possible, I could have made a mistake anywhere along the way ... and likely probably did ... could you help me narrow it down, where would you begin to look for the duplicate key error?

    Will check through your suggestions for the override, thanks.

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

    Default Re: Duplicate Mysql query

    Quote Originally Posted by Pauls View Post
    This is a difficult one to answer MC ... I upgraded to the best of my ability .... and followed the instructions as much as possible, I could have made a mistake anywhere along the way ... and likely probably did ... could you help me narrow it down, where would you begin to look for the duplicate key error?

    Will check through your suggestions for the override, thanks.
    Well, "from here" it would help to know which instructions. And even with that, did you load a complete fileset of the latest 1.5.5a to somewhere on your server (not overwriting the existing store), and then incorporate differences from your previous store, or did you copy all of the stores files and then incorporate the differences from ZC 1.5.5a into it? That type of thing.

    I would however, suggest looking into the configure.php files as the primary suspicion. Wondering if they in part refeerence to the old store location that is still there and perhaps old data in the database that has gotten upgraded.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: Duplicate Mysql query

    Quote Originally Posted by mc12345678 View Post
    Well, "from here" it would help to know which instructions. And even with that, did you load a complete fileset of the latest 1.5.5a to somewhere on your server (not overwriting the existing store), and then incorporate differences from your previous store, or did you copy all of the stores files and then incorporate the differences from ZC 1.5.5a into it? That type of thing.

    I would however, suggest looking into the configure.php files as the primary suspicion. Wondering if they in part refeerence to the old store location that is still there and perhaps old data in the database that has gotten upgraded.
    OK well, I uploaded the files needed for a ZC installation and followed the prompts from the ZC_install page thereafter ... this was if I recall correctly an 'upgrade' not a complete new site, which relied upon and still uses the previous 1.5.3 version database from which the site was previously running. Because you mentioned the config files I did take a look at them, and found that the 'define('SQL_CACHE_METHOD', 'database');' was set to database ... in the previous version I had that set to none ... so I have changed it in both configs includes, and admin/includes to 'none'. Not sure whether that will help but it may be relevant?

    I am also getting a fair few of this error include(/public_html/includes/modules/responsive_sheffield_blue/product_listing.php) called at [/public_html/includes/templates/responsive_sheffield_blue/templates/tpl_modules_product_listing.php:
    for various different pages in the template not just the one mentioned there ...

    And this which I believe is not a template file but a zencart file, a fair few of these errors too.
    PHP Fatal error: 1109:Unknown table 'p' in field list :: select count(p.products_id) as total ==> (as called by) public_html/includes/classes/split_page_results.php on line 78 <== in /public_html/includes/classes/db/mysql/query_factory.php on line 167

    regards

    Paul

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

    Default Re: Duplicate Mysql query

    Okay, so first thing is to try working from your most recent error log, resolve that and then the most recent one after solving that, etc. Until no error logs are being generated.


    Considering that the most recently posted logs relate to the responsive sheffield blue template, the place to start would be to look in the thread related to that template. Start from the end of the thread (a discussion related to the issues you've posted about has been had many times over and there is assistance associated to it.)

    As to the configure.php files, that particular setting isn't normally expected to cause the error(s) identified.

    As to the upgrade/rebuild, well, still not very clear about whether the new files were put into their own directory and other things added to them or if they were uploaded over top a copy or the original files. If the former, then other files wouldn't be "in the way", if the later (which it kind of seems like) then there are possibly files still around that were removed between ZC 1.5.3 and 1.5.5x.

    One of the generally suggested instructions to perform an upgrade (which involves loading a fresh install of the files to some location/folder that is not immediately where the live site's files are and a copy of the database to do what is necessary to get the database updated, the needed plugins installed/upgraded and then repeating necessary actions against the live site. That is: http://www.zen-cart.com/entry.php?3-...d-of-upgrading
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: Duplicate Mysql query

    Thanks for the advice and logic MC will give it a shot and see what develops.

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: Duplicate Mysql query

    @Pauls, it would help if you would post the full debug-log contents. Zen Cart 1.5.5a includes the myDebug Backtrace handling that will display a backtrace (i.e. which PHP modules were in the calling sequence when the error occurred).

    @mc12345678, The "duplicate key" issue that was corrected in Zen Cart 1.5.5a had to do with the sessions table, not the cache table.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v155 Help with a MySQL query
    By lat9 in forum General Questions
    Replies: 7
    Last Post: 26 Apr 2016, 10:11 PM
  2. mySQL Query of all Products
    By Keitex in forum General Questions
    Replies: 1
    Last Post: 5 Oct 2011, 02:25 AM
  3. How do I run a MySQL Query ?
    By HeyIts007 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 17 May 2011, 07:40 PM
  4. mysql query issue
    By Andy_GS in forum General Questions
    Replies: 0
    Last Post: 16 Mar 2009, 01:53 PM
  5. [Duplicate] 1.3.8 Query parameters missing.
    By JCakeC in forum Bug Reports
    Replies: 2
    Last Post: 12 Apr 2008, 04:31 PM

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