views:

77

answers:

1

I'm going to lay this out as simply as I can while still telling all pertinent details. I'll list site details below:

http:///www.bubblegenius.com (front page currently locked off) You can access the site inside and see exactly what's happening by going to http://www.bubblegenius.com/soap.html.

A client of mine ran a Magento-run ecommerce store on a shared host. After successfully running the store there for a few months, she started experiencing what seemed to be memory issues. The site would occasionally stop working or produce "fatal errors" when adding items to the cart.

When clicking Add to Cart the screen would go white--blank--without any warning error. When I turned on error checking in the index.php file, and tried to add a product to the cart, I received the following:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 62914560 bytes) in /home/bubblege/public_html/app/code/core/Mage/Core/Model/Session/Abstract.php on line 234

I've tried upping php memory to 128M, 512M, even 2048M inside php.ini, .htaccess, and even setting it in index.php with

ini_set('memory_limi', '2048M');

Upping the memory limit to 512 or above doesn't produce the above Fatal Error, but won't allow any item to be added to the cart. It produces the following message:

"The item cannot be added to the cart."

Now here's the kicker: We moved my client over to a VPS running 768MB Guaranteed (w\ 1.5GB Burst RAM), and I worked extensively with the server techs to optimize the server.

However, since moving to the VPS, the errors have continued. The site works fine until you try to add an item to the shopping cart.

I've searched every magento message board looking for a solution to this bug. I've disabled all extensions, and even tried installing from a new version of Magento and from a previous version.

I've done database repairs, optimization, did a compare and fix with a clean database running a clean version of Magento.

As of now, I'm authorized to offer up to two hundred dollars to find someone who can fix this issue once and for all. If you have any insights and answers to this, and think you can fix this, please contact me either here or directly. I can provide server access details and would be able to walk through any questions and possible solutions with you.

Also, my background is not really server-admin centric but I know my way around a box, and I've been working with Magento for a few years. Several of my other clients are running sites without issue.

A: 

Have you tried running the same code and database on a local computer of yours? That's a good start. If the problem does not persist, there's an environment issue at play. If the issue does persist, try running the same database against a fresh copy of Magento (code straight from the repo, basically). If the problem subsides, you probably have a code issue. If not, database is likely to blame.

Next, add a new product type and a new product. Try to add those to the cart. Use a new customer, etc.

Debugging after that depends on the issues you found, but somewhere in the Magento logic you are getting tripped up. I'm guessing that it is the database, since Magento depends on several things existing in the database correctly. Stepping through the code with a debugger may show you where it bails from the process.

Let us know how that goes. :)

Joseph Mastey
Thanks for the input. I have done numerous different tests, including the ones you've mentioned. I've done A/B testing with new db's, old db's, new prods, new customers. The problem does seem to be in the database. I haven't tried codestepping--do you have any suggestions on how to go about doing that? I have Firebug and it doesn't reveal anything untoward. Is there anything robust that can walk through Magento?
f8xmulder
xdebug would be the best option, but failing that start adding debug statements into the code. isolate which line of code is setting the "cannot add to cart message" and use debug_print_backtrace() to figure out a little more about what is bombing out. that may lead you to the right place.
Joseph Mastey
I'm getting xdebug installed as we speak. I'll give that a go and see what it finds. Thanks for the idea.
f8xmulder
Well, got xdebug installed, made sure it was working properly (it was) and then replicated steps to get the error.Nothing. No error, just a blank white screen. I tried adjusting the memory and it did the same thing.
f8xmulder
Did you actually step through the code? It may be tedious going through Magento's call stack, but by stepping manually through (with a few intelligent breakpoints), you can see what is causing the big memory issue.
Joseph Mastey
Ah, well it turns out I have to compile xdebug for Zend, grab some vim scripts, install a firefox extension, so as soon as I get through all that, I'll let you know what I find.I was able to see some xdebug output while within the store, which is why I thought I had it configured correctly. I've never used xdebug, so I'm trying to learn it...
f8xmulder
Yeah, that's the concern if you aren't familiar w/ a "proper" debugger. In a pinch, you can use var_dump et al to do the same.
Joseph Mastey