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

Created on 25 Jan 2017  路  9Comments  路  Source: magento/magento2

Preconditions

Using Magento 2.1.3 with sample data and PHP 7.0.8

Steps to reproduce

Create a new module and add a plugin for Magento\Framework\App\Request\Http in [module_root]/etc/di.xml
For example:

<type name="Magento\Framework\App\Request\Http">
    <plugin name="not_working_http_request_plugin"
        type="Company\CustomModule\Plugin\Http"
        sortOrder="70"
        disabled="false"/>
</type>

do not forget to create a file Company\CustomModule\Plugin\Http

Flush cache using php bin/magento cache:flush

Run php bin/magento setup:di:compile.

Result

2017-01-25 23-34-47

If you remove the plugin code from [module_root]/etc/di.xml and run the command php bin/magento setup:di:compile, you will receive this error again. The command php bin/magento cache:flush began to return an error There are no commands defined in the "cache" namespace.

If clearing the cache using , rm -rf var/di/* var/generation/* var/cache/* var/page_cache/* var/view_preprocessed/* var/composer_home/cache/* I can again use php bin/magento setup:di:compile

But if the return plugin code in file, the problem Cache frontend 'default' is not recognized. persists.

Setup Confirmed P2 ready for dev Reproduced on 2.1.x Reproduced on 2.2.x Reproduced on 2.3.x S2 bug report

Most helpful comment

I am having the same issue while trying to use a plugin for Magento\Framework\Logger\Monolog in Magento 2.3.1.
Is there a solution or a workaround? Thanks!

All 9 comments

We've created internal ticket MAGETWO-63843 to address this issue.
Thanks

I have the same issue.

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



Exception trace:
 () at /vhosts/www/magento2/vendor/magento/framework/App/Cache/Frontend/Pool.php:150
 Magento\Framework\App\Cache\Frontend\Pool->get() at /vhosts/www/magento2/vendor/magento/framework/App/Cache/Type/FrontendPool.php:84
 Magento\Framework\App\Cache\Type\FrontendPool->get() at /vhosts/www/magento2/vendor/magento/framework/App/Cache/Type/Config.php:49
 Magento\Framework\App\Cache\Type\Config->_getFrontend() at /vhosts/www/magento2/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php:65
 Magento\Framework\Cache\Frontend\Decorator\Bare->load() at /vhosts/www/magento2/vendor/magento/framework/Interception/PluginList/PluginList.php:270
 Magento\Framework\Interception\PluginList\PluginList->_loadScopedData() at /vhosts/www/magento2/vendor/magento/framework/Interception/PluginList/PluginList.php:248
 Magento\Framework\Interception\PluginList\PluginList->getNext() at /vhosts/www/magento2/var/generation/Magento/Framework/App/Request/Http/Interceptor.php:1179
 Magento\Framework\App\Request\Http\Interceptor->setAllowCustomMethods() at /vhosts/www/magento2/vendor/zendframework/zend-http/src/PhpEnvironment/Request.php:67
 Zend\Http\PhpEnvironment\Request->__construct() at /vhosts/www/magento2/vendor/magento/framework/HTTP/PhpEnvironment/Request.php:130
 Magento\Framework\HTTP\PhpEnvironment\Request->__construct() at /vhosts/www/magento2/vendor/magento/framework/App/Request/Http.php:116
 Magento\Framework\App\Request\Http->__construct() at /vhosts/www/magento2/var/generation/Magento/Framework/App/Request/Http/Interceptor.php:14
 Magento\Framework\App\Request\Http\Interceptor->__construct() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:93
 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:89
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php:57
 Magento\Framework\ObjectManager\ObjectManager->create() at /vhosts/www/magento2/vendor/magento/framework/App/Cache/Frontend/Factory.php:195
 Magento\Framework\App\Cache\Frontend\Factory->_applyDecorators() at /vhosts/www/magento2/vendor/magento/framework/App/Cache/Frontend/Factory.php:159
 Magento\Framework\App\Cache\Frontend\Factory->create() at /vhosts/www/magento2/vendor/magento/framework/App/Cache/Frontend/Pool.php:67
 Magento\Framework\App\Cache\Frontend\Pool->_initialize() at /vhosts/www/magento2/vendor/magento/framework/App/Cache/Frontend/Pool.php:146
 Magento\Framework\App\Cache\Frontend\Pool->get() at /vhosts/www/magento2/vendor/magento/framework/App/Cache.php:38
 Magento\Framework\App\Cache->__construct() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:93
 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:89
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:126
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php:71
 Magento\Framework\ObjectManager\ObjectManager->get() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:163
 Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:139
 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:53
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:82
 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() at /vhosts/www/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php:57
 Magento\Framework\ObjectManager\ObjectManager->create() at /vhosts/www/magento2/vendor/magento/framework/Console/Cli.php:144
 Magento\Framework\Console\Cli->getApplicationCommands() at /vhosts/www/magento2/vendor/magento/framework/Console/Cli.php:112
 Magento\Framework\Console\Cli->getDefaultCommands() at /vhosts/www/magento2/vendor/symfony/console/Symfony/Component/Console/Application.php:91
 Symfony\Component\Console\Application->__construct() at /vhosts/www/magento2/vendor/magento/framework/Console/Cli.php:83
 Magento\Framework\Console\Cli->__construct() at /vhosts/www/magento2/bin/magento:22

@konstanchuk, thank you for your report.
We've created internal ticket(s) MAGETWO-63843 to track progress on the issue.

I have the same problem after creating a plugin for Magento\Framework\App\Request\Http on M2.2.6. Verified that removing the plugin from di.xml fixed the issue.

me too
I created a plugin for Http and after that I have issues running bin/magento
on 2.3.0

I am also having the same problem created a plugin for Magento\Framework\App\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.

I am having the same issue while trying to use a plugin for Magento\Framework\Logger\Monolog in Magento 2.3.1.
Is there a solution or a workaround? Thanks!

I am having the same issue while trying to use a plugin for Magento\Framework\Encryption\Encryptor in Magento 2.3.4.
Is there a solution or a workaround? Thanks!

Bugs all over the place, this issue is still persisting on 2.3.4

Was this page helpful?
0 / 5 - 0 ratings