Jump to content

LiteSpeed Call to a member function query() on null /classes/db/DbPDO.php on line 134


jaxTus

Recommended Posts

Hi,

I'm experiencing an issue with LiteSpeed Cache module v1.4.0 in PS 1.6.1.16

We use RockPos module for instore sales and the POS link is failing to load throwing a 500 server error.

This only happens when the LiteSpeed module is set to "Two views - one for all logged-in users and another for logged-out users"

Whenthe POS link https://www.ridersline.com.au/shop/pos is hit the server is logging the errors as the following:

2021-08-20 10:28:12.148978 [NOTICE] [656518] [110.174.171.127:49819:HTTP2-21#APVH_ridersline.com.au:443] [STDERR] PHP Fatal error:  Call to a member function query() on null in /home/ridersli/public_html/shop/classes/db/DbPDO.php on line 134


2021-08-20 10:28:12.148919 [NOTICE] [656518] [110.174.171.127:49819:HTTP2-21#APVH_ridersline.com.au:443] [STDERR] PHP Notice:  Undefined property: DbPDO::$link in /home/ridersli/public_html/shop/classes/db/DbPDO.php on line 134

If we disable LiteSpeed module or change the setting to be "No - everyone shares the same view" the POS link loads and works fine with no error.

If have contacted RockPos support but they are saying it's an issue with the LiteSpeed module and their tech team won't help any further.

Has anyone experienced this or can provide any support as to how to fix so our POS will load under two separate cache views?

Wondering if creating an ESI Block for the RockPos module would solve the problem however, I'm unsure how to set that up.

We need the LiteSpeed module to be set as "Two Views" otherwise front end menu and user account access does not work correctly due to pages being cached with logged-out states.

Thanks in advance for you insights and help on this.

Link to comment
Share on other sites

Hi @jaxTus I am Louis from Rock POS team. I am sorry that you had some bad experience in the work. But have you contacted Technicans from LiteSpeed Team? As our technical guy has checked the issue carefully, and he told me it could be the LiteSpeed module that did something wrong with .htaccess file. 

Please inform me if you have contacted LiteSpeed team and the problem has not been resolved. I would love to help you.

Link to comment
Share on other sites

  • 5 months later...
  • 2 weeks later...

Hi DobraFSD,

No, this issue has not been resolved. Any help we be appreciated.

I have no idea what the below debug log is telling me for litespeed.

Hoping someone knows how to config litespeed so RockPos will work without having to change Customer Group setting manually every time we want to use the POS

The litespeed lscache.log shows the following when attempting to login to RockPos:

*DEBUG*     2022/02/28 - 17:19:43: [194.223.9.97:65372:434971] (6) setNotCacheable - Route not cacheable: AdminRockPosSalesController - Not FC_FRONT
*DEBUG*     2022/02/28 - 17:19:43: [194.223.9.97:65372:434971] (8) hookActionDispatcher type=2 controller=AdminRockPosSalesController req=/shop/psAdmin/index.php?controller=AdminRockPosSales&token=f0c1e6a52d7315186c26ad8262236e9d :Route not cacheable: AdminRockPosSalesController - Not FC_FRONT
*DEBUG*     2022/02/28 - 17:19:43: [194.223.9.97:65372:434971] (6) setNotCacheable - Response code is 302
*DEBUG*     2022/02/28 - 17:19:43: [194.223.9.97:65372:434971] (4) SetHeader X-Litespeed-Cache-Control: no-cache
*DEBUG*     2022/02/28 - 17:19:43: [194.223.9.97:65372:555203] (6) setNotCacheable - Route not cacheable: hspointofsaleprosalesModuleFrontController - Not in defined cacheable controllers
*DEBUG*     2022/02/28 - 17:19:43: [194.223.9.97:65372:555203] (8) hookActionDispatcher type=1 controller=hspointofsaleprosalesModuleFrontController req=/shop/pos?token=931b8f16e00e3f2dfcdb52c74e290d8a :Route not cacheable: hspointofsaleprosalesModuleFrontController - Not in defined cacheable controllers

Edited by jaxTus (see edit history)
Link to comment
Share on other sites

It is a problem of Litespeed. Check https://github.com/litespeedtech/lscache_prestashop/issues/44

I´ve already wrote them, but they are not making so much effort in finding the origin of the problem.

They expect a reproduceable pattern, but mine errors are the same but not related with RockPos.

If you have a pattern which can reproduce error, please contact Litespeed and reference the github issue i linked before.

Link to comment
Share on other sites

Looks like race condition is from prestashop and they already addressed this issue in newer versions. 

https://github.com/PrestaShop/PrestaShop/issues/23281

The LiteSpeed cache module need an update to reflect those kind of changes, because are not exactly the same conditions. 

While they update, you can bypass the issue adding the following to Context Vary Bypass setting in module configuration.

If problem is related to `getIsoId` :

ctry

If problem is related to `getLang` : 

lang

This will bypass certain cookie settings within the module that are the origin of the issue.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...