Question

I just reinstalled magento using composer install

Then I tried to run this command php bin/magento setup:upgrade and also tried running other setup commands. I got the following error:

Class NewRelic\Monolog\Enricher\Handler does not exist#0 /vagrant/www/vendor/magento/framework/Code/Reader/ClassReader.php(26): ReflectionClass->__construct('NewRelic\\Monolo...')
#1 /vagrant/www/vendor/magento/framework/ObjectManager/Definition/Runtime.php(54): Magento\Framework\Code\Reader\ClassReader->getConstructor('NewRelic\\Monolo...')
#2 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('NewRelic\\Monolo...')
#3 /vagrant/www/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('NewRelic\\Monolo...')
#4 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(203): Magento\Framework\ObjectManager\ObjectManager->get('NewRelic\\Monolo...')
#5 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(179): Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray(Array)
#6 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(273): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, NULL, Array, 'handlers', 'Magento\\CloudCo...')
#7 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument('Magento\\CloudCo...', Array, Array)
#8 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\CloudCo...', Array, Array)
#9 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\CloudCo...', Array, Array)
#10 /vagrant/www/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\CloudCo...')
#11 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(167): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\CloudCo...')
#12 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(273): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Psr\\Log\\LoggerI...', NULL, 'logger', 'Magento\\CloudCo...')
#13 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument('Magento\\CloudCo...', Array, Array)
#14 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\CloudCo...', Array, Array)
#15 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\CloudCo...', Array, Array)
#16 /vagrant/www/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\CloudCo...')
#17 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(167): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\CloudCo...')
#18 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(273): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'logger', 'Magento\\Framewo...')
#19 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument('Magento\\Framewo...', Array, Array)
#20 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Framewo...', Array, Array)
#21 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
#22 /vagrant/www/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array)
#23 /vagrant/www/vendor/magento/framework/App/Cache/Frontend/Factory.php(197): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array)
#24 /vagrant/www/vendor/magento/framework/App/Cache/Frontend/Factory.php(161): Magento\Framework\App\Cache\Frontend\Factory->_applyDecorators(Object(Magento\Framework\Cache\Frontend\Decorator\TagScope))
#25 /vagrant/www/vendor/magento/framework/App/Cache/Frontend/Pool.php(69): Magento\Framework\App\Cache\Frontend\Factory->create(Array)
#26 /vagrant/www/vendor/magento/framework/App/Cache/Frontend/Pool.php(151): Magento\Framework\App\Cache\Frontend\Pool->_initialize()
#27 /vagrant/www/vendor/magento/framework/App/Cache.php(38): Magento\Framework\App\Cache\Frontend\Pool->get('default')
#28 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(121): Magento\Framework\App\Cache->__construct(Object(Magento\Framework\App\Cache\Frontend\Pool))
#29 /vagrant/www/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#30 /vagrant/www/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#31 /vagrant/www/vendor/magento/framework/App/Cache/Proxy.php(44): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#32 /vagrant/www/vendor/magento/framework/App/Cache/Proxy.php(67): Magento\Framework\App\Cache\Proxy->_getCache()
#33 /vagrant/www/vendor/magento/framework/App/ProductMetadata.php(80): Magento\Framework\App\Cache\Proxy->load('mage-version')
#34 /vagrant/www/vendor/magento/framework/Console/Cli.php(98): Magento\Framework\App\ProductMetadata->getVersion()
#35 /vagrant/www/bin/magento(22): Magento\Framework\Console\Cli->__construct('Magento CLI')
#36 {main}

Anyone has any idea on how to fix this? Thank you.

Was it helpful?

Solution

was able to fix it by installing newrelic monolog composer require newrelic/monolog-enricher

OTHER TIPS

remove the generated code directory.

rm -rf generated/

upgrade magento and compile:

php bin/magento setup:upgrade
php bin/magento setup:di:compile

Now deploy the magento :

php bin/magento setup:static-content:deploy

And lastly do the caching :

php bin/magento cache:clean

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top