Magento2: [InvalidArgumentException] Cache frontend 'default' is not recognized.

Created on 6 Nov 2018  路  20Comments  路  Source: magento/magento2

Hi, everyone!
I'm facing an issue that started this week on Monday. When we try to run bin/magento setup:install we face this exception [InvalidArgumentException] Cache frontend 'default' is not recognized. that blocks our setup process.

We realyze that under the stack trace, that the Monolog module recently receive an update, from 1.23.0 to 1.24.0. And this new version was released yesterday (2018/11/05).

There still have an open issue: https://github.com/magento/magento2/issues/8285, however its related with a custom module. We're not using any custom module.

Preconditions

Magento ver. 2.2.2 EE

Steps to reproduce

  1. In a Magento default instance
  2. Run bin/magento setup:install (with the required options)

Expected result

Install process should complete normally

Actual result

[InvalidArgumentException] Cache frontend 'default' is not recognized.

Exception trace:
 () at /var/www/html/vendor/magento/framework/App/Cache/Frontend/Pool.php:150
 Magento\Framework\App\Cache\Frontend\Pool->get() at /var/www/html/vendor/magento/framework/App/Cache/Type/FrontendPool.php:86
 Magento\Framework\App\Cache\Type\FrontendPool->get() at /var/www/html/vendor/magento/framework/App/Cache/Type/Config.php:49
 Magento\Framework\App\Cache\Type\Config->_getFrontend() at /var/www/html/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php:65
 Magento\Framework\Cache\Frontend\Decorator\Bare->load() at /var/www/html/vendor/magento/framework/Interception/PluginList/PluginList.php:288
 Magento\Framework\Interception\PluginList\PluginList->_loadScopedData() at /var/www/html/vendor/magento/framework/Interception/PluginList/PluginList.php:266
 Magento\Framework\Interception\PluginList\PluginList->getNext() at /var/www/html/generated/code/Magento/Framework/Logger/Monolog/Interceptor.php:87
 Magento\Framework\Logger\Monolog\Interceptor->setHandlers() at /var/www/html/vendor/monolog/monolog/src/Monolog/Logger.php:150
 Monolog\Logger->__construct() at /var/www/html/vendor/magento/framework/Logger/Monolog.php:23
 Magento\Framework\Logger\Monolog->__construct() at /var/www/html/generated/code/Magento/Framework/Logger/Monolog/Interceptor.php:14
 Magento\Framework\Logger\Monolog\Interceptor->__construct() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111
 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:66
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:144
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:230
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:144
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:230
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:56
 Magento\Framework\ObjectManager\ObjectManager->create() at /var/www/html/vendor/magento/framework/App/Cache/Frontend/Factory.php:198
 Magento\Framework\App\Cache\Frontend\Factory->_applyDecorators() at /var/www/html/vendor/magento/framework/App/Cache/Frontend/Factory.php:162
 Magento\Framework\App\Cache\Frontend\Factory->create() at /var/www/html/vendor/magento/framework/App/Cache/Frontend/Pool.php:67
 Magento\Framework\App\Cache\Frontend\Pool->_initialize() at /var/www/html/vendor/magento/framework/App/Cache/Frontend/Pool.php:146
 Magento\Framework\App\Cache\Frontend\Pool->get() at /var/www/html/vendor/magento/framework/App/Cache/Type/FrontendPool.php:86
 Magento\Framework\App\Cache\Type\FrontendPool->get() at /var/www/html/vendor/magento/framework/App/Cache/Type/Config.php:49
 Magento\Framework\App\Cache\Type\Config->_getFrontend() at /var/www/html/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php:65
 Magento\Framework\Cache\Frontend\Decorator\Bare->load() at /var/www/html/vendor/magento/framework/Interception/PluginList/PluginList.php:288
 Magento\Framework\Interception\PluginList\PluginList->_loadScopedData() at /var/www/html/vendor/magento/framework/Interception/PluginList/PluginList.php:266
 Magento\Framework\Interception\PluginList\PluginList->getNext() at /var/www/html/generated/code/Magento/Framework/Logger/Monolog/Interceptor.php:87
 Magento\Framework\Logger\Monolog\Interceptor->setHandlers() at /var/www/html/vendor/monolog/monolog/src/Monolog/Logger.php:150
 Monolog\Logger->__construct() at /var/www/html/vendor/magento/framework/Logger/Monolog.php:23
 Magento\Framework\Logger\Monolog->__construct() at /var/www/html/generated/code/Magento/Framework/Logger/Monolog/Interceptor.php:14
 Magento\Framework\Logger\Monolog\Interceptor->__construct() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111
 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:66
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php:80
 Magento\Framework\Stdlib\Cookie\PhpCookieManager->__construct() at /var/www/html/generated/code/Magento/Framework/Stdlib/Cookie/PhpCookieManager/Interceptor.php:14
 Magento\Framework\Stdlib\Cookie\PhpCookieManager\Interceptor->__construct() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111
 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:66
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:144
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:230
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:144
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:230
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:144
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:230
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:144
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:230
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:70
 Magento\Framework\ObjectManager\ObjectManager->get() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:180
 Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:156
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:230
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php:56
 Magento\Framework\ObjectManager\ObjectManager->create() at /var/www/html/setup/src/Magento/Setup/Model/ObjectManagerProvider.php:78
 Magento\Setup\Model\ObjectManagerProvider->createCliCommands() at /var/www/html/setup/src/Magento/Setup/Model/ObjectManagerProvider.php:64
 Magento\Setup\Model\ObjectManagerProvider->get() at /var/www/html/setup/src/Magento/Setup/Module/ConnectionFactory.php:96
 Magento\Setup\Module\ConnectionFactory->create() at /var/www/html/setup/src/Magento/Setup/Validator/DbValidator.php:82
 Magento\Setup\Validator\DbValidator->checkDatabaseConnection() at /var/www/html/setup/src/Magento/Setup/Model/Installer.php:1206
 Magento\Setup\Model\Installer->assertDbAccessible() at /var/www/html/setup/src/Magento/Setup/Model/Installer.php:770
 Magento\Setup\Model\Installer->installSchema() at n/a:n/a
 call_user_func_array() at /var/www/html/setup/src/Magento/Setup/Model/Installer.php:342
 Magento\Setup\Model\Installer->install() at /var/www/html/setup/src/Magento/Setup/Console/Command/InstallCommand.php:146
 Magento\Setup\Console\Command\InstallCommand->execute() at /var/www/html/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at /var/www/html/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at /var/www/html/vendor/magento/framework/Console/Cli.php:104
 Magento\Framework\Console\Cli->doRun() at /var/www/html/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at /var/www/html/bin/magento:23

image

Clear Description Format is valid

All 20 comments

Hi @williankeller. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [x] Summary of the issue
  • [x] Information on your environment
  • [x] Steps to reproduce
  • [x] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@williankeller do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [x] no (But I don't know how this setup process work, if follow these steps)

@magento-engcom-team give me 2.2.2 instance

Hi @williankeller. Thank you for your request. I'm working on Magento 2.2.2 instance for you

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [x] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [x] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 6. Add label Issue: Confirmed once verification is complete.

  • [ ] 7. Make sure that automatic system confirms that report has been added to the backlog.

Hi @williankeller, here is your Magento instance.
Admin access: http://34.228.235.121/i-19084-2-2-2//admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

Hi @williankeller i'm think that this issue can't be reproduce on 2.2-* instances because if they have an error they will not be deployed.

@williankeller,

I'm facing an issue that started this week on Monday. When we try to run bin/magento setup:install we face this exception [InvalidArgumentException] Cache frontend 'default' is not recognized. that blocks our setup process.

Try locking monolog at 1.23.x for now as 2.3-develop does.

Hi all!
An important thing to share, this error happens into Enterprise Edition, under 2.2.2 version.

Hi @williankeller , thank you for your report. Please follow these guidelines for proper tracking of your issue. You can report Commerce-related issues in one of two ways:
You can use the Support portal associated with your account
or
If you are a Partner reporting on behalf of a merchant, use the Partner portal.

GitHub is intended for Magento Open Source users to report on issues related to Open Source only. There are no account management services associated with GitHub.

Hi @orlangur, sure! We really did it. And it works perfectly!
Should this solution be the final for this ticket?

@williankeller no, third party libraries are updated from time to time by core team, then Magento is thoroughly tested and all observed bugs are fixed before such update is released.

Just that there is no need to use fresher version of some library unless there is a crucial feature for your project or some critical fix.

With my bug I used redis cache, I fixed the problem by reset nginx, redis cache. May be helpful

@magento-engcom-team, @williankeller i found the problem cause by circular dependency. (Magento\Framework\Cache\Frontend\Decorator\Logger depends on Magento\Framework\Cache\InvalidateLogger and vice versa)
it should be fixed in the next version of magento2.

I am also having the same problem as this one. Created a plugin for Magento\FrameworkApp\Request\Http in Magento2.3. It is showing the below error while compiling or running any commands.

In Pool.php line 150:

  Cache frontend 'default' is not recognized. 

It works fine if removing the plugin from di.xml.

If anyone has already known the solution please give it here. Thanks in Advance.

Plugins can not be used on following:
Objects that are instantiated before Magento\Framework\Interception is bootstrapped

@shakthivel-p isn't it the case?

Plugins can not be used on following:
Objects that are instantiated before Magento\Framework\Interception is bootstrapped

@shakthivel-p isn't it the case?

Also, you can try to execute composer install, so the autoload is regenerated.

@orlangur Thanks for your answer I didn't know about that. Anyway Thanks.

@orlangur
I am having another doubt.

I am trying to bypass the CSRF validation for my Controller. I had seen a few workaround in the below link.

https://magento.stackexchange.com/questions/253414/magento-2-3-upgrade-breaks-http-post-requests-to-custom-module-endpoint

But I need my Module compatible with both Magento 2.2 and 2.3. So, I had overridden a core file Magento\Framework\App\Request\Http like below

public function isAjax()
{
       if ($this->getRequestUri() == 'custom/url') {
            return true;
       }
        if ($this->isXmlHttpRequest()) {
            return true;
        }
        if ($this->getParam('ajax') || $this->getParam('isAjax')) {
            return true;
        }
        return false;
}

To bypass the validateRequest() function in Magento\Framework\App\Request\CsrfValidator

private function validateRequest(
    HttpRequest $request,
    ActionInterface $action
): bool {
    $valid = null;
    if ($action instanceof CsrfAwareActionInterface) {
        $valid = $action->validateForCsrf($request);
    }
    if ($valid === null) {
        $valid = !$request->isPost()
            || $request->isAjax()
            || $this->formKeyValidator->validate($request);
    }

    return $valid;
}

It was working fine. I want to know does it affect the technical review in the Magento Marketplace in any way (or) is there any other better way. Thanks in advance.

need my Module compatible with both Magento 2.2 and 2.3

Don't think this is the right way to go. Regarding Marketplace - try reaching corresponding channels in Slack.

@orlangur Okay Thanks.

Was this page helpful?
0 / 5 - 0 ratings