3

During deployments we sometimes have the problem, that all the caches disable themselves, for no apparent reason.

During deployment, we basically execute the following commands:

bin/magento maintenance:enable
bin/magento setup:upgrade
bin/magento setup:static-content:deploy de_DE en_US en_GB --theme vendor/theme
bin/magento setup:static-content:deploy de_DE en_US en_GB --area adminhtml
bin/magento setup:di:compile
bin/magento maintenance:disable

There are some other commands in between, but not related to Magento directly (i.e. no bin/console command, e.g. Varnish & Redis cache flushing).

This is extremely irritating since this will basically crash the server, when the maintenance mode is disabled for the live site and no cache whatsoever is active!

How can this happen? Why does Magento touch the cache setting by itself at all? What could be responsible for that?

  • Magento Version: 2.2.8
  • PHP Version: 7.1
6
  • Most likely the command bin/magento setup:di:compile does this, I personally don't use it on production mode. According to Magento, this serves the following purpose: Application code generation (factories, proxies, and so on) Area configuration aggregation (that is, optimized dependency injection configurations per area) Interceptor generation (that is, optimized code generation of interceptors) Interception cache generation Repositories code generation (that is, generated code for APIs) Service data attributes generation (that is, generated extension classes for data objects) Commented May 27, 2019 at 13:17
  • Hm... what do you mean you do not use this on production? This command is solely necessary for the production mode - you do not need it in developer mode at all.
    – fritzmg
    Commented May 27, 2019 at 13:30
  • I don't use it because it generates an error. If I want to install a module, I put the files in app/code and after that I run the enable module command, upgrade command, cleaning cache commands, deploy commands for languages, and the commands for fixing the permissions on folders. Commented May 27, 2019 at 13:36
  • check this, maybe it helps you understand better magento.stackexchange.com/questions/184237/… Commented May 27, 2019 at 13:40
  • Well I understand what it does. But it is not recommended to skip this step, since it will slow down the website (for the first requests), since Magento has to generate the dependency injection files on the fly. And judging by what the command does I do not see any reason or evidence, that it has anything to do with cache handling or why it would touch those settings.
    – fritzmg
    Commented May 27, 2019 at 13:44

0