concretecms-community-store / community_store

An open, free and community developed eCommerce system for Concrete CMS
https://concretecms-community-store.github.io/community_store/
MIT License
106 stars 66 forks source link

Address issue on checkout #760

Closed ebmudremyc closed 1 year ago

ebmudremyc commented 1 year ago

We get this error in Production, and cannot reproduce in staging:

Exception [BASE_DIR]/updates/concrete-cms-8.5.12/concrete/attributes/address/controller.php:285 extract() expects parameter 1 to be array, null given (2)

The step is checkout/submit

It only happens when shippable items are in the cart, so I suspect it has to do with an undefined variable. The order is entered into the database, without a shipping address, but payment is successful. All checkout is guest-only.

Also, we are using redis as our session handler in Prod, file handler on Stage so wondering if that has anything to do with it.

I don't think it's a bug in the store code, but something in our environment (AWS: redhat, php74, redis, MariaDB on RDS)

Any insight would be appreciated. Thanks!

Mesuva commented 1 year ago

That's a weird one, in particular that it's breaking on the shipping address but not the billing one.

I think this comes back to a createAttributeValue call on the shipping address attribute. But the only place I'm spotting that being used in Community Store is when you are saving order attributes down to an order. Are you using any custom order attributes?

ebmudremyc commented 1 year ago

No custom attributes. We think it's a session lock or unlock issue or timeout issue as it seems it gets the shipping address from the session at that point.

We are going to try using redis on out staging env to see if we can reproduce it, and maybe tune some redis parameters.

ebmudremyc commented 1 year ago

We solved this by locking the redis sessions and increasing some defaults.

redis.session.lock_retries = 20
redis.session.lock_wait_time = 4000
redis.session.locking_enabled = 1
Mesuva commented 1 year ago

That's great you got it sorted.

I don't really know about much about Redis, I guess i find it a bit odd that other values in the cache would be ok, but the shipping one in particular tripped things up.. maybe it being saved at a later point brought this issue to the surface.