Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 3
STORE CRASHES AFTER CURRENCY CHANGE [URGENT]
 
sixcarbon
Jr. Member
 
Total Posts:  6
Joined:  2009-12-09
 

While changing the currency in the Shopping Cart or the Checkout Page, the store crashes and I get the following:

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 523800 bytes) in /home/domain/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 832

I tried increasing the memory but still the problem exists. Please advise ASAP!

 
Magento Community Magento Community
Magento Community
Magento Community
 
sixcarbon
Jr. Member
 
Total Posts:  6
Joined:  2009-12-09
 

Also getting this at times:

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 76 bytes) in /home/domain/public_html/lib/Zend/Db/Select.php on line 166

 
Magento Community Magento Community
Magento Community
Magento Community
 
satish
Enthusiast
 
Total Posts:  812
Joined:  2008-03-24
34,mantri Sadan,Shivaji Nagar,Nagpur,MS,India 4400
 

Thru php.ini or some other means you need to increase memory to 128MB and then check.

Satish

 
Magento Community Magento Community
Magento Community
Magento Community
 
sixcarbon
Jr. Member
 
Total Posts:  6
Joined:  2009-12-09
 

I have already increased it to 128MB. It seems to be an SQL error.

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

On a decent server, configured to run Magento, I’m also finding that switching currency causes a huge load on the server.

This was not a problem for a 1.3.2.4 of Magento.

Exists in 1.4,1.5,1.6,1.7

Problem exists no matter how much memory I throw at it. Disabled all extensions.

Changing currency with products in the cart = timeout error.

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

Well, I had 2 problems… This is the thing that caused the memory leak though. Located in a module the following line of code.

Mage::getModel('checkout/cart')->getQuote()->getId();

I changed to the following to fix.

Mage::getSingleton('checkout/session')->getQuoteId();

Removed all of my problems with slow down and sped the cart back up to full speed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dr770
Jr. Member
 
Total Posts:  12
Joined:  2008-05-06
 

@elfling

in which file you made this change?

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

I searched through the modules on the site and replaced it.

There were 2 modules.. 1 was J2T AutoAdd module
The other was a free module for payment method restriction

Disabling all the modules and enabling each module one by one and refreshing the cart page lead me to the module that was causing the problem

 
Magento Community Magento Community
Magento Community
Magento Community
 
Creepin
Jr. Member
 
Total Posts:  28
Joined:  2012-03-28
 

I had a similar problem with memory exhausted and taking too much time, when changing currency and logging in. I talked with elfling in another post.

I tried to disable all modules and enables one after another. but no change. then I logged all mysql queries and noticed that IG_CashOnDelivery Module and Klarna Invoice Module send queries again and again. so luckily I do not need both modules and uninstalled them and now it works like a charm. So what i can say: disabling module needn\’t be enough! Look for the SQL Queries!

Thanks to elfling!

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

No problem. Glad you got it sorted smile

To check those processes for anyone else having problems, see function

show processlist

 
Magento Community Magento Community
Magento Community
Magento Community
 
Creepin
Jr. Member
 
Total Posts:  28
Joined:  2012-03-28
 

Hey elfling!

The problem is there again. but this time i cannot find any solution. I can see in the SQL query log that some queries are fired and fired again when changing the currency. But there is nothing with a module this time. What do you mean by “show processlist”? I cannot find this method. My Hosting provider is now also looking for the error

best regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

Ah.. ok, if you log in with SSH or terminal to the server. Then you would type in show processlist;

But, it all depends on your host and if they allow shell access.

Nothing in your logs?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Creepin
Jr. Member
 
Total Posts:  28
Joined:  2012-03-28
 

Thanks. Unfortunately I have no clue of Shell or SSH. I can just see in the SQL Query Log that approx 110 queries are repeated 200 times, then a new connect and this happens 4 Times until the Internal Error stops the execution.

I have attached two files. First is going from product page to cart (works fine) and second is cart reload after currency change (just first 1500 lines). the currency change itself seems to work fine but the reload after it is causing the problem. I compared the two files, and from one point they are doing different things. Maybe if you have time, you may have a quick view on the files, and maybe you can see where the error occurs. Would be great!

thanks!

EDIT!!!!!:

That is so embarassing! When I searched for

Mage::getModel('checkout/cart')->getQuote()

in my code to find any occurrences (as you mentioned before), i must have put that line in one of my modules by accident. After I found out my own module was causing the error, I found that line and wanted to sink into the ground.

File Attachments
debug_normal.txt  (File Size: 110KB - Downloads: 226)
debug_wrong.txt  (File Size: 106KB - Downloads: 83)
 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

hehe, I’ve known that feeling before!

So all sorted then?

If so, then excellent news. I’ve found it a few times with certain things that calling on say ->store()->getId() from a quote will cause issues, but getStoreId() will work perfectly fine.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Creepin
Jr. Member
 
Total Posts:  28
Joined:  2012-03-28
 

Everything’s sorted yes. I hope I will never encounter this issue again!

 
Magento Community Magento Community
Magento Community
Magento Community
 
omnivision
Jr. Member
 
Total Posts:  9
Joined:  2011-06-28
 

Hi,

I\’m having exactly the same error in my shop.
Trying to switch from Euro to Dollar with an item in my cart results in a 500 time out error.
With nothing in my cart it works perfect....

Looking at my log it says:
PHP Fatal error:  Allowed memory size of 155189248 bytes exhausted (tried to allocate 32 bytes) in /var/www/html/lib/Varien/Simplexml/Element.php on line 195

I did a search in my entire code for Mage::getModel(\’checkout/cart\’)->getQuote() but can\’t find it anywhere…

Any other ideas what could be going wrong here...?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 3