eZ Platform Discussions

[eZ Launchpad] How to clear the cache?

version2

#1

Salut salut,

Since I discovered that it is necessary to delete the redis cache in addition to the eZ cache I have much less cache problem.
But now I’m facing a new problem that’s driving me crazy!

I exported my production bdd and crushed the one in my docker.

~/ez docker:enter
mysql -u my_user --password=********* --host=db ezplatform < my_prod_dump.sql

After that, of course, I emptied the caches:

~/ez docker:sfrun "cache:clear --env=dev"
~/ez docker:sfrun "cache:pool:clear cache.redis --env=dev"

But the BO refuses to understand.

The Browser shows me a mixed thaw between old and new data.
Sub-items lists always show the old data.
But if I go on an object that has been deleted I do have a 404 error

I removed the caches from my browser, I made a cache rm on the docker. Nothing does about it.

rm -rf /tmp/ezplatormcache/var/cache/*/*

I don’t know what to do anymore.


#2

just an educated guess maybe; I do not know if you are using solr or ezpublish legacy engine but have you tried: bin/console ezplatform:reindex before clearing the caches ? in most of my cases I always have to do that after exporting a database dump.

so worth a Try I would say


#3

Indeed now that you say it… it seems obvious to me…
But I have a mistake when indexing…

Purging index...
Re-Creating index for 97 items across 2 iteration(s), using 2 parallel child processes:
 1/2 [==============>-------------]  50%12:57:55 ERROR     [app] Child indexer process returned: General error [] []
 2/2 [============================] 100%12:57:55 ERROR     [app] Child indexer process returned: General error [] []
 2/2 [============================] 100%
Finished re-indexing

I don’t have a list at all!

With the debug I have the following error:

[php] User Deprecated: The Symfony\Component\Process\ProcessBuilder class is deprecated since Symfony 3.4 and will be removed in 4.0. Use the Process class instead.
[
  "exception" => ErrorException {
    #message: "User Deprecated: The Symfony\Component\Process\ProcessBuilder class is deprecated since Symfony 3.4 and will be removed in 4.0. Use the Process class instead."
    #code: 0
    #file: "/var/www/html/project/ezplatform/vendor/symfony/symfony/src/Symfony/Component/Process/ProcessBuilder.php"
    #line: 14
    #severity: E_USER_DEPRECATED
    trace: {
      /var/www/html/project/ezplatform/vendor/symfony/symfony/src/Symfony/Component/Process/ProcessBuilder.php:14 { …}
      /var/www/html/project/ezplatform/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:146 { …}
      Symfony\Component\Debug\DebugClassLoader->loadClass() {}
      /var/www/html/project/ezplatform/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Command/ReindexCommand.php:372 { …}
      /var/www/html/project/ezplatform/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Command/ReindexCommand.php:271 { …}
      /var/www/html/project/ezplatform/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Command/ReindexCommand.php:232 { …}
      /var/www/html/project/ezplatform/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Command/ReindexCommand.php:168 { …}
      /var/www/html/project/ezplatform/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:251 { …}
      /var/www/html/project/ezplatform/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:964 { …}
      /var/www/html/project/ezplatform/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:86 { …}
      /var/www/html/project/ezplatform/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:248 { …}
      /var/www/html/project/ezplatform/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:74 { …}
      /var/www/html/project/ezplatform/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:148 { …}
      /var/www/html/project/ezplatform/bin/console:31 {
        › $application = new Application($kernel);
        › $application->run($input);
        › 
      }
    }
  }
]


#4

It works with:

ez docker:sfrun "ezplatform:reindex --env=dev --processes=0"

Maybe a docker pb with the multithread…

Merci pour ton aide @amirkoklan !


#5

I’ve experienced this too. Not sure when to clear the symfony cache vs the redis cache. Been doing both as a nuclear option to make sure everything is cleared and nothing is lingering.


#6

I think docker is not responsible here, it sounds like it is the E_USER_DEPRECATED that triggers that error.

with --processes=0 I suppose you just remove the usage of the code that triggers it.

=> it might be a bug in the last version of the bundle!