Page 4 of 7 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 69
  1. #31
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: 1062:Duplicate entry for key 1 in db_cache

    Actually, in retrospect, I'm not surprised at the cache_entry_name always being the same. It's an MD5 hash of the SQL query, and the query it's caching is unsurprisingly always going to be the same every time the cache entry is built/rebuilt/updated and thus the key's repetition is to be expected.

    (Only a small handful of queries get cached this way, hence the limited sample size, but let's leave that topic off the table for now.)

    This leads me to suspect a race condition of sorts, between the GC/expiry and creation of new records, perhaps in the busyness of rebuilding caches when the site has been idle for longer than cache and/or session expiration lengths.

    As you observed, there appear to be no ill effects other than the errors logged, and I'm unsurprised that no further errors would appear, since the system will simply carry on with the next stage ... or the user will refresh the screen and things will carry on. (Okay, if they get a blank screen then that IS an ill effect, of course! but I don't recall seeing anyone saying that was a coexistent symptom.)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  2. #32
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: 1062:Duplicate entry for key 1 in db_cache

    Quote Originally Posted by DrByte View Post
    Actually, in retrospect, I'm not surprised at the cache_entry_name always being the same. It's an MD5 hash of the SQL query, and the query it's caching is unsurprisingly always going to be the same every time the cache entry is built/rebuilt/updated and thus the key's repetition is to be expected.
    This is why I think it is relevant though. Why *this* key? Answer: Because it'll be created by the same query. What would/could be so 'special' about this particular query? (whatever it is). I don't know. A query created with undefined variables perhaps? A query with a 'select *' from a particular table perhaps?
    Quote Originally Posted by DrByte View Post
    This leads me to suspect a race condition of sorts, between the GC/expiry and creation of new records, perhaps in the busyness of rebuilding caches when the site has been idle for longer than cache and/or session expiration lengths.
    It does have that appearance to it, but I still can't quite mentally reconcile this and the fact that it is always the same key/query (and no others).

    Quote Originally Posted by DrByte View Post
    As you observed, there appear to be no ill effects other than the errors logged, and I'm unsurprised that no further errors would appear, since the system will simply carry on with the next stage ... or the user will refresh the screen and things will carry on. (Okay, if they get a blank screen then that IS an ill effect, of course! but I don't recall seeing anyone saying that was a coexistent symptom.)
    Me neither. I do occasional wonder how many sites are in use that are generating these errors without the owners knowledge though. Still not a significant problem in itself, unless those merchants are with a host that offers minimal storage capacity (as recently discussed in another thread).

    Cheers
    Rod

  3. #33
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: 1062:Duplicate entry for key 1 in db_cache

    Quote Originally Posted by RodG View Post
    A query with a 'select *' from a particular table perhaps?
    Yes, exactly: select * from configuration;
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #34
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: 1062:Duplicate entry for key 1 in db_cache

    Quote Originally Posted by DrByte View Post
    Yes, exactly: select * from configuration;
    Doh!

    Cheers
    Rod

  5. #35
    Join Date
    Mar 2005
    Location
    Waxahachie, Texas
    Posts
    174
    Plugin Contributions
    0

    Default Re: 1062:Duplicate entry for key 1 in db_cache

    Thanks to all who are discussing this. DrByte is a great guy, but I'm sure he thought I was losing my mind when no one else reported it.

    DrByte, If it's an issue with the time-out, I'll gladly volunteer my site for a way to turn off same. We work in a secure area, and we don't have to do any certification with our credit card machine. In fact, there are cards (e.g., SquareUp) that run on iPhones that don't have any security requirements other than the data one enters (CVV, expiration date). Also, if you want to look at it, I'll gladly PM you our server info.
    Thanks,
    Ray

  6. #36
    Join Date
    Mar 2005
    Location
    Waxahachie, Texas
    Posts
    174
    Plugin Contributions
    0

    Default Re: 1062:Duplicate entry for key 1 in db_cache

    FYI -- My latest cache entries were at 4:42 a.m. and 5:05 a.m. We weren't timing out, as we weren't awake. There were no orders that came in during that time.
    Thanks,
    Ray

  7. #37
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: 1062:Duplicate entry for key 1 in db_cache

    Quote Originally Posted by rayw1679 View Post
    FYI -- My latest cache entries were at 4:42 a.m. and 5:05 a.m. We weren't timing out, as we weren't awake. There were no orders that came in during that time.
    It would be useful to know what visitor activity was happening at that time. Apache server access-logs and errorlogs from 5 min before until 5 min after would be ideal.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #38
    Join Date
    Mar 2005
    Location
    Waxahachie, Texas
    Posts
    174
    Plugin Contributions
    0

    Default Re: 1062:Duplicate entry for key 1 in db_cache

    ** logs detached **

    Thank you for your continued interest, DrByte. If I did this correctly, the files you requested should be attached.
    Last edited by DrByte; 16 Mar 2013 at 05:23 AM. Reason: removed attachment
    Thanks,
    Ray

  9. #39
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: 1062:Duplicate entry for key 1 in db_cache

    Initial observation: according to your logs, bingbot was making 3 hits per second trying to index your site. Other spiders were also active but not as aggressive.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #40
    Join Date
    Mar 2011
    Posts
    20
    Plugin Contributions
    0

    Default Re: 1062:Duplicate entry for key 1 in db_cache

    Quote Originally Posted by DrByte View Post
    Initial observation: according to your logs, bingbot was making 3 hits per second trying to index your site. Other spiders were also active but not as aggressive.
    For what it is worth and in case it helps with duplication of this problem:

    I just spotted that I've been having this same Duplicate entry error log appearing several times almost every day since January 6. No error logs had been generated other than that since upgrade. I have my raw access logs for the period since it started. At every instance of the error appearing that I've checked so far (~dozen instances) it always corresponds in time to a spider (bingbot, ##########, msnbot, 360spider) hitting my site aggressively, as in multiple times within a few seconds. I've seen a couple of instances of DB not connected at spider hit times. I haven't really messed with anything at all, other than having cleared out my admin log table when recommended (I have the backups/exports for that). I've seen two cache entry names. It was consistent on that first one for a while, then switched over sometime in January to another cache entry name which looks like has been the same ever since.

    I'm on v150, clean install upgrade from 139h last September, running no add-ons, very few customizations. MySQL 5.5.23-55, PHP Version: 5.2.17.

 

 
Page 4 of 7 FirstFirst ... 23456 ... LastLast

Similar Threads

  1. Replies: 3
    Last Post: 21 Jan 2016, 10:35 PM
  2. ERROR message help 1062 Duplicate entry for key 1 in db_cache
    By shartlesville in forum General Questions
    Replies: 4
    Last Post: 30 Aug 2012, 03:21 AM
  3. 1062 Duplicate entry '1-1' for key 1
    By spooky130 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 18 Jun 2011, 05:33 AM
  4. Replies: 6
    Last Post: 30 Dec 2008, 12:49 AM
  5. 1062 Duplicate entry db_cache ?
    By FoneGuy in forum General Questions
    Replies: 5
    Last Post: 30 Jan 2008, 07:42 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