Prestashop: Cache invalidation seems not to work

Created on 11 Jul 2019  路  11Comments  路  Source: PrestaShop/PrestaShop

I use memcached.
After a product is cached, any modification in the backoffice, like changing price or other features, is persisted in the database but does not invalidate the cache, so it's not reflected in neither frontoffice nor backoffice afterwards.

Steps to reproduce the behavior:

  1. Setup memcached with Prestashop
  2. Create a product
  3. Look at it in frontoffice
  4. Change properties in backoffice and hit Save
  5. Reload frontoffice. No change

PrestaShop version: 1.7.5.1
PHP version: 7.2

1.7.5.2 Can't Reproduce Performance Products

All 11 comments

Same issue #10420
Please read this document too https://devdocs.prestashop.com/1.7/scale/optimizations/#7-prestashop-settings (for me was helpful)

Hi @Bettelstab,

In my case, I did not manage to reproduce the issue with PS1.7.6.0 & PS1.7.5.1.
I attached a screen record
https://drive.google.com/file/d/1zKJ0scK5qw_lonh7Lq6lHsPmF8GD0h60/view
Thanks to check & feedback.

@centoasa
My settings are as described. My database is not on the same machine, nor is my memcached server. What did solve your issue in the end?

@khouloudbelguith
Thanks for investigating! What makes me think this is because of memcached is that, after rebooting the cache server, everything is updated as intended.
I checked again and in fact, description, reference and summary are all updated, while price and custom properties like color are not.

I also use read replication for my database, but the lag should not really be an issue (20ms).

@Bettelstab, We need to retrieve the PHP error log and the debug mode report in order to find out what's wrong.
Don't you know how to get this information? Please read the following article:
http://build.prestashop.com/howtos/misc/how-to-create-bug-report/

Thanks!

PHP error log seems unrelated:
[02-Jul-2019 11:05:40] NOTICE: Terminating ... [02-Jul-2019 11:05:40] NOTICE: exiting, bye-bye! [02-Jul-2019 11:06:33] NOTICE: fpm is running, pid 2649 [02-Jul-2019 11:06:33] NOTICE: ready to handle connections[06-Jul-2019 19:29:11] NOTICE: Terminating ... [06-Jul-2019 19:29:11] NOTICE: exiting, bye-bye![06-Jul-2019 19:30:05] NOTICE: fpm is running, pid 2597 [06-Jul-2019 19:30:05] NOTICE: ready to handle connections[11-Jul-2019 11:10:08] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spar e_servers), spawning 8 children, there are 3 idle, and 36 total children [11-Jul-2019 11:10:15] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spar e_servers), spawning 8 children, there are 4 idle, and 41 total children [11-Jul-2019 11:10:16] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spar e_servers), spawning 16 children, there are 3 idle, and 42 total children

No problems recognizable in debug mode. I fixed all warnings I found in server error log (didn't help) and now there are only missing index notices left.

Other information:
nginx 1.14.1 on AWS EC2
memcached 1.5.10 on AWS ElastiCache
Aurora MySQL 5.7.12

@Bettelstab, could you please try to clear cache manually by deleting all the folder into var/cache (prod & dev).
Could you please try to run those command lines to remove the cache also:

php -d memory_limit=-1 ./bin/console cache:clear
php -d memory_limit=-1 ./bin/console cache:clear --env=prod

Thanks to check & feedback

@khouloudbelguith Sure :) Clearing cache folders manually didn't change the behavior. Executing the other commands returns the following output:

```// Clearing the cache for the prod environment with debug false

In AbstractMySQLDriver.php line 115:

An exception occured in driver: could not find driver

In PDOConnection.php line 53:

could not find driver

In PDOConnection.php line 49:

could not find driver

cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--id_shop [ID_SHOP]] [--id_shop_group [ID_SHOP_GROUP]] [--]

```
Not sure if that worked as intended. No visible effect to me at least. I also tried to clear Opcache without success.

Strangely, when I first tried today with my test article (after rebooting Memcached yesterday night for another reason) it just worked, also accepting several new changes, but 5 minutes later it broke again.

@Bettelstab, You need to have a module called pdo_mysql. You need to check if the extension is enabled and loaded via php -m and phpinfo()

Thanks!

Sorry, it's installed of course. I just had to use php7.

 [OK] Cache for the "prod" environment (debug=false) was successfully cleared.        

But no effect. :(

Hi @Bettelstab,

Despite our several trials, we could not reproduce your issue with the provided information.
It seems that your issue is not a PrestaShop's core bug but most likely a server configuration or customization problem.
I invite you to contact our support team: http://addons.prestashop.com/en/388-support to help you solve your issue.

Thanks!

Fine. I'll try to reproduce it with a fresh local installation next to see what happens. Thanks for investigating.

Was this page helpful?
0 / 5 - 0 ratings