Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jun 2006
    Posts
    128
    Plugin Contributions
    0

    Default Retrieving export/newsletter lists hangs on database query

    I have this mod installed on a 1.3.8a cart and has been working fine up until recently.
    But, now, when I select Email Address Exporter from the Tools menu, the page will not completely load. It loads the choices for file type, but the drop down for Desired Recipient List does not load.

    It never completes and the page load times out.

    Any ideas?

    This is a client's heavily modded cart with the most recent mods installed being (the only 2 things installed right before it quit working):

    XSS Protection Patch
    Master Password

  2. #2
    Join Date
    Jun 2006
    Posts
    128
    Plugin Contributions
    0

    Default Re: Email address exporter

    Still no success in figuring out the issues, however the client has asked their host if any recent changes have been made to update/upgrade things on their end. This is the email they sent her:

    ************************************

    MySQL databases / tables have been optimized, however, the following query appears to be the cause of the issue :
    Mysql> SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM Zen_customers c LEFT JOIN Zen_orders o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL;

    And it is still hanging there...

    You might want to provide the mysql query provided above to zencart so they can take a further look at it.

    ************************************

    On a hunch, I went into her admin to attempt to send a newsletter and the same thing happens. The page never finishes loading and it's blank from the dropdown menu down.

    Any help would be greatly appreciated.

    Other mods that have been added recently include double email address entry, but that has no sql with it and upon removing it, nothing changed.

    Honestly, doesn't this sound like a conflict with the optimization her host recently made?

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

    Default Re: Email address exporter

    That query is simply comparing the customers table with the orders table and showing any customers who don't have corresponding orders. It's not all that complex, and shouldn't put much strain on the server. If the problem only "suddenly started" then it's likely caused by one of:
    a) hosting company mucking with database operation
    b) you've imported new customer records from some external source but the data isn't complete or isn't normalized across appropriate tables
    c) one or both of the tables has some damage and needs repair
    d) someone's been mucking in the raw database data and broken something
    e) or, hopefully not but ... maybe your site's been hacked?

    What happens if you attempt to run that query manually via phpMyAdmin?

    What happens if you add the word "EXPLAIN" before the query and run it again in phpMyAdmin? Post the results.

    What are the results of a file-by-file comparison of your server files vs your known good backups? Anything suspicious which might suggest someone unauthorized has been visiting?
    .

    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. #4
    Join Date
    Jun 2006
    Posts
    128
    Plugin Contributions
    0

    Default Re: Email address exporter

    Thanks for your quick response.

    I just tried to run it directly on phpMyAdmin and it does the same thing. Hangs up and never completes.

    Running the same query with the word "EXPLAIN" in front of it took a very long time, but resulted in the attached screenshot.

    The host did admit that the DB and tables had been recently "optimized" but claim that has nothing to do with it.

    Nobody has been adding any customers other than by the front end of the cart.

    They have all the most up to date security patches installed so I'm pretty sure they haven't been hacked.

    I don't know how to tell if the if the tables are damaged and need repair.

    Thanks for your help.
    Attached Images Attached Images  

  5. #5
    Join Date
    Jun 2006
    Posts
    128
    Plugin Contributions
    0

    Default Re: Email address exporter

    Oh, I also thought maybe I should install a fresh zen-cart on her server to use diagnostically. See if it works out of the box. Without all the mods since it's a heavily modded cart and my partner and I have only recently started adding more mods for her.

    Anyhow, on the new test cart the newsletter function works fine and loads the 2 customers that were created.

    I did note on installing the test cart that it was throwing a caution that PHP API mode = cgi-fcgi and it is a linux server. Could that create a problem?

    We didn't install her problematic cart so I have no idea if that is a warning that existed when the cart was originally installed or or something that has changed since the host has done their *optimizing".
    Attached Images Attached Images  

  6. #6
    Join Date
    Jun 2006
    Posts
    128
    Plugin Contributions
    0

    Default Re: Email address exporter

    I have spent the day adding the mods and performing the same actions which we had done to her live cart (immediately prior to her email export mod malfunctioning) to her test cart and still the test cart is working correctly.

    Until she can provide me with a list of mods that were installed before we were asked to work on her cart, that's as far as my diagnostics can take me.

    Here are my notes about what I did on the new test cart and the results:
    Added Email Address Exporter
    Everything works correctly.

    Added the following mods to test cart and still everything functions correctly:
    Master Password
    Double Email Address Entry
    Backup MySQL

    Added the fix for coupon restrictions:
    http://www.zen-cart.com/forum/showthread.php?t=138711
    Still works fine.

    Added the security patch:
    http://www.zen-cart.com/forum/showthread.php?t=142927
    Still works fine.

    Thinking perhaps the patch was incorrectly performed originally on your live site, I redid the patch exactly how I had JUST done it to the test site and still the page for email address export will not load. (it loads fine on test site).
    Should I perform a "repair table" on those 2 tables in question? I have never done that before and don't want to attempt something that could make the problem even worse.

    She's got a customer base of nearly 4000 customers. Could the amount of stored data be any issue?

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

    Default Re: Email address exporter

    Quote Originally Posted by signs View Post
    I did note on installing the test cart that it was throwing a caution that PHP API mode = cgi-fcgi and it is a linux server. Could that create a problem?
    That's not as common a problem as it was 2-3 years ago when many hosts were still running archaic versions of PHP.
    I consider that warning irrelevant nowadays.
    .

    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. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Email address exporter

    As far as installing patches and addons, I wouldn't be too concerned about PHP files unless they have built-in SQL scripts that are altering the database structure.

    It seems the problem is with your database.

    Go to phpMyAdmin, select your database from the pulldown. Then click on the "Export" tab. Then check ONLY the "Zen_orders" and "Zen_customers" tables. Then check the box that says "Structure Only". Uncheck the "download" option, since I just want you to output the structure to the screen. Don't worry about all the other checkboxes. Click Go.
    Copy and paste the DROP TABLE / CREATE TABLE statements that it shows you ... into a reply here.

    I'd be interested in knowing if it's the same as defaults.
    .

    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.

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

    Default Re: Email address exporter

    Quote Originally Posted by signs View Post
    She's got a customer base of nearly 4000 customers. Could the amount of stored data be any issue?
    Well, the 10,000 orders and 4000 customers isn't the same as 5 and 5, so it's clearly more than just a simple couple of records to sort through. And, yes, the size is likely a minor contributing problem. But I've seen many stores with larger amounts of data than that which aren't reporting the same problem.
    Quote Originally Posted by signs View Post
    Should I perform a "repair table" on those 2 tables in question? I have never done that before and don't want to attempt something that could make the problem even worse.
    Well ... if in doubt, do a backup of the data, and restore it to another database to be sure the backup is good.
    Then do the repair and see what happens. It's unlikely to cause a problem. But one should always do a backup when in doubt.


    Another thing you could try is this:
    You said you have another store installed which is working fine.
    The following instructions WILL BREAK that store, but will let you test JUST this query in a "cleaner" setup.
    - do the same export as I mentioned earlier, BUT choose "structure and data" instead of structure-only. Also be sure the "drop table" option IS checked.
    - assuming the new database also uses the "Zen_" prefix that your live store is using, just import this new backup into your new store. (You could do a backup of the whole new/test store database first.)
    (If the prefix is different, import it anyway, and then find the correct table names, delete the existing names, and rename the ones you just imported from "Zen_xxxxx" to whatever the right new name is.
    - Then test ONLY the Newsletter or Email-address-exporter page.
    I doubt you'll see it work properly. But it rules out a few things.
    - Then test it in phpMyAdmin just like you did earlier.
    - Now, remember, doing it this way will have just busted all the customer and order data in the new/test site, so I suggest running a new install on it again, or restore it from a backup.
    .

    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. #10
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Retrieving export/newsletter lists hangs on database query

    BTW, I've moved this thread to this new location since it's not related specifically to the Email Address Exporter where you first started the discussion.
    .

    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.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v138a Newsletter Sending Hangs
    By beyerg in forum General Questions
    Replies: 0
    Last Post: 10 Mar 2015, 06:53 PM
  2. sorting product lists with jquery (query category names to div classes)?
    By poosk in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Mar 2011, 08:39 AM
  3. Installation hangs at Database Setup
    By gaver in forum Installing on a Linux/Unix Server
    Replies: 14
    Last Post: 24 Apr 2010, 04:27 AM
  4. Newsletter Hangs when sending on GoDaddy
    By jsmith1611 in forum General Questions
    Replies: 1
    Last Post: 9 Dec 2009, 10:24 PM
  5. Retail vs Wholesale Newsletter Lists
    By eastwin in forum General Questions
    Replies: 0
    Last Post: 3 Aug 2009, 08:32 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