Update from 2.0.10 to 2.0.26a: prices disappeared and memory allocation errors

Started by marcodelpercio, December 28, 2013, 16:38:21 PM

Previous topic - Next topic

marcodelpercio

Hello,

That's mainly the reason why I wasn't updating. I knew that something weird could happend and in fact it happened.
Joomla 2.5.11 running perfectly VM 2.0.10 stable, downloaded latest version 2.0.26a, updated the component first and then the aio.

Results:
1) On homepage I had the module with featured products (showing only 3 products). I was forced to disable it since if active after many seconds it raises the following error:

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 523800 bytes) in C:\wamp\www\currentrical\libraries\loader.php on line 366

I already tried to search similar posts on the forum. Raised my memory to 1024M and max execution time to 290 seconds... but I'm still facing the error therefor I had to disable the entire module.

2) For the category layout I had a template override (into my template html folder) however after the update I was unable to see any price in category layout. Thinking it was my template override fault I removed my file in order to fallback to native vm category layout. The layout has changed to the default one however there're no more prices the same. I have double checked into config/prices and the checkbox active are the same as before. Still no prices. So I tried activating ALL the checkboxes to show everything about the prices... still no prices displaying. Then I thought it might be because I wasn't logged in, therefore I signed in as a test customer... still no prices.... what happened? I tried debugging com_virtuemart/views/category/tmpl/default.php and when debugging if I inspect $this->product->prices it contains an array whose keys are all the prices variants but the values are all uninitialized.... what's wrong?

3) For some very weird reason I get the memory allocation error even when I try to open some categories (only some of them). Now assuming the thumbnails are still there and the thumbnails dimensions haven't changed during the update, and the categories are all showing the same number of products per page (which hasn't changed)... why is VM requesting so much memory??? What's wrong?

Thanks




marcodelpercio

Hi,

I have been digging a bit deeper and apparently the prices disappeared are caused by a wrong shopper_group in the sql statement getting the products.
ALL the products in the old system have shopper_group_id = 2 (which is -default-). Now after the update they still all have shopper_group_id = 2 (which is -default-)  however the sql statement to fetch a single product is running like this:


...
AND (
    `virtuemart_shoppergroup_id` = "1"
    OR `virtuemart_shoppergroup_id` IS NULL
    OR `virtuemart_shoppergroup_id` = "0"
  )
...


which is of course wrong. I checked both the systems and they both have:
-anonymous- (with ID 1)
-default- (with ID 2)
The -default- is also starred as "default" shopper group however when I'm not logged in the sql query runs as above (i.e. ignoring the -default- shopper group) why? I also tried disabling the group -anonymous- but nothing changes.

I am pretty sure the damage was caused by the update, why?



jjk

Quote from: marcodelpercio on December 28, 2013, 16:38:21 PM
That's mainly the reason why I wasn't updating. I knew that something weird could happend and in fact it happened.
Joomla 2.5.11 running perfectly VM 2.0.10 stable, downloaded latest version 2.0.26a, updated the component first and then the aio.
Fatal error: Allowed memory size of 536870912 bytes exhausted...
I already tried to search similar posts on the forum. Raised my memory to 1024M and max execution time to 290 seconds... but I'm still facing the error therefor I had to disable the entire module.

From VM 2.0.10 to 2.026a is quite a big update step as 2.0.10 already is almost 1½ years old and a LOT of things have been changed. At least it looks like you were testing the update locally first. I'm using xampp instead of wamp for testing locally, but I suppose in wamp you also have to stop and restart apache in order to load your new memory and execution time settings in php.ini. (And if wamp has more than one php.ini file, check if you edited the correct one)

Concerning shoppergroups and prices, perhaps this helps: http://forum.virtuemart.net/index.php?topic=112376.msg377861#msg377861

You may also try to go to Tools & Migration and click on 'Install or if necessary update tables'. There also is a button at Components > virtuemart-aio > 'Update VM plugin tables'

However, experiment with discardable copies of your live shop until you have everthing working again.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

marcodelpercio

Hi,

Thanks for your reply I actually found the way to "fix" the disappeared prices by running

UPDATE `#__virtuemart_product_prices` SET `virtuemart_shoppergroup_id` = NULL


very odd anyway since if that's necessary to run latest version why wasn't it done by the update?

I perfectly know that I have to restart the daemon, as I said I'm now running in local with 1024M but some things keep eating up memory and I have no idea why.
Furthermore 1024M is just a local test cause in production there's no way I'm gonna have such a big value. Any idea of what could be or how could I trace it back quickly?

P.S. Back to the prices imo it's very confusing having -anonymous- and -default- together
P.P.S  I was actually explicitly avoiding the update since everytime I had to make even a small updates there was always something broken during the update process and I didn't want to risk troubles with my customer, I'm sorry to say that cause I love the VM project since vm 1 , so please don't take me wrong I don't want to sound rude but in my modest experience in 2.x there's always something broken in every update and my latest experience is unfortunately confirming my concern.

Thanks

Milbo

I think you used a migrated store. vm1 had prices with shoppergroups, but they were not used in vm2 until version vm2.0.14. We did not deleted the old entries. So people who started with vm2, had no shoppergroups entered. But people with migrated stores had the old group entered. They used it to adjust the old ids to the their new shoppergroups to get their old system fast running again. The normally used RAM is usually below 20 MB. Only for pdfs you need more. So there is something else eating the RAM. Or there is some loop due old data.


Assumingly you updated from 2.0.0 up to 2.0.10 then you already had the worst trouble already. That was the time with the most update hazzles.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

shopper999

Could you please create a blank file
"/logs/com_virtuemart.log.php"

and try again?
(Problem described in detail: http://forum.virtuemart.net/index.php?topic=121130.msg413744#msg413744)  (thank you shopper, link updated by Milbo)