1

I have upgraded a Magento 2.1.9 store to 2.2.5. The upgrade seems successful, and everything is working in development mode, but I am not able to compile or put the store into production mode.

The error I get when running setup:di:compile is:

[ReflectionException]Class Magento\Framework\Acl\CacheInterface does not exist

I have removed the contents of var/, generated/, generation/ etc, and set filesystem permissions specified in the documentation.

The full stack trace for the error is here:

[ReflectionException]
Class Magento\Framework\Acl\CacheInterface does not exist


Exception trace:
() at /var/www/html/magento2.2/vendor/magento/framework/Code/Reader/ClassReader.php:29 
ReflectionParameter->getClass() at /var/www/html/magento-2.2/vendor/magento/framework/Code/Reader/ClassReader.php:29
Magento\Framework\Code\Reader\ClassReader->getConstructor() at /var/www/html/magento-2.2/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassReaderDecorator.php:35

Magento\Setup\Module\Di\Code\Reader\ClassReaderDecorator->getConstructor() at /var/www/html/magento-2.2/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Area.php:53
Magento\Setup\Module\Di\Code\Reader\Decorator\Area->getList() at /var/www/html/magento-2.2/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php:109
Magento\Setup\Module\Di\App\Task\Operation\Area->getDefinitionsCollection() at /var/www/html/magento-2.2/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php:84
Magento\Setup\Module\Di\App\Task\Operation\Area->doOperation() at /var/www/html/magento-2.2/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php:56
Magento\Setup\Module\Di\App\Task\Manager->process() at /var/www/html/magento-2.2/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php:206
Magento\Setup\Console\Command\DiCompileCommand->execute() at /var/www/html/magento-2.2/vendor/symfony/console/Command/Command.php:241
Symfony\Component\Console\Command\Command->run() at /var/www/html/magento-2.2/vendor/symfony/console/Application.php:843
Symfony\Component\Console\Application->doRunCommand() at /var/www/html/magento-2.2/vendor/symfony/console/Application.php:193
Symfony\Component\Console\Application->doRun() at /var/www/html/magento-2.2/vendor/magento/framework/Console/Cli.php:104
Magento\Framework\Console\Cli->doRun() at /var/www/html/magento-2.2/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at /var/www/html/magento-2.2/bin/magento:23

setup:di:compile

Any help with working out the cause of this error would be greatly appreciated

  • 1
    Do you have redis running? Try clearing redis cache – sulman Jul 29 '18 at 8:38
  • Hi Sulman, Thanks for your input, however I don't have any external caching on this as it is a dev environment only. – Simon Watts Jul 29 '18 at 9:41
1

Magento 2.2.2 has changed Class name for CacheInterface

Previously, it was Magento\Framework\Acl\CacheInterface which is changed to Magento\Framework\App\CacheInterface

So, you will require to update the class name in your code if you are upgrading your magento version to 2.2.2 or above.

0

I managed to figure this one out. For anybody else running into a similar problem Be careful when running grep to find the offending module.

I was using:

find . -type f -exec grep -l  'Acl\CacheInterface' {} \;

but this didn't find any matches, as the backslash needs escaping:

find . -type f -exec grep -l  'Acl\\CacheInterface' {} \;
0

In magento 2, we need to upgrade 2.1.9 to 2.2.5 forcefully. As magento does not upgrade it directly.

So as you upgraded magento to 2.2.5 then /setup folder classes still uses 2.1.9.

So simply download 2.2.5 magento2 and copy setup folder content of 2.2.5 and paste into 2.1.9.

You could directly paste into setup folder or can copy old setup and paste new one as fresh setup folder.

Clear cache, generation etc and run.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.