3

I have installed Magento 2.2.4 with composer. Everything is working but when I am running this command.

php bin/magento setup:di:compile

It is giving me an error

**[RuntimeException] Source class "\Magento\Payment\Model\Method\Virtual" forMagento\Payment\Model\Method\VirtualLogger" generation does not exist.** 

I have cleared all cache and removed these folders also

rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/* var/session/* var/view_preprocessed/* pub/static/*

Your help will be appreciated. Thanks in advance

nb171994
  • 31
  • 1
  • 9

4 Answers4

2

This issue occurs only when you have a plugin for class "Psr\Log\LoggerInterface"

In our case, it was in WeltPixel's extension

app/code/WeltPixel/Backend/etc/di.xml

Removing the content

 <type name="Psr\Log\LoggerInterface">
         <plugin name="weltpixel-backend-logger"
                 type="WeltPixel\Backend\Plugin\Logger" sortOrder="15"/>
 </type>

solved the problem.

Just search your file system for text

name="Psr\Log\LoggerInterface"

and remove the plugin temporarily until the time we have an official solution on GitHub issue https://github.com/magento/magento2/issues/14950

Ravinder
  • 136
  • 4
  • Thank you for your response, Actually we rolled back to Magento 2.2.2 because of this issue. So I hope they will fix this issue in their next version. – nb171994 May 10 '18 at 06:54
  • Okay. However, are you using any of WeltPixel's extension? – Ravinder May 10 '18 at 10:35
  • Yes, I am using weltpixel backend, quickview and google tag manager. – nb171994 May 11 '18 at 09:40
  • Thanks, this happened when I added \Psr\Log\LoggerInterface to an Observer then tried to setup:upgrade on a production site (worked fine in development....) rm -rf generated/code generated/metadata bin/magento setup:upgrade bin/magento setup:di:compile bin/magento setup:static-content:deploy en_NZ Resolved this for me. (Note remove en_NZ if not NZ language for theme/css etc) Happened in Magento 2.3.0 so still appears to be a problem. – Liam Mitchell Oct 28 '19 at 05:38
1

1、note: var/generation has been moved to generated/code and var/di has been moved to generated/metadata in m2.2, so we only delete generation.

rm -rf generation/* var/cache/* var/page_cache/* var/view_preprocessed/* var/composer_home/cache/*

2、try :

composer install
i Len
  • 11
  • 1
0

ditto. i also see a similar issue logged on https://github.com/magento/magento2/issues/14950

note: var/generation has been moved to generated/code and var/di has been moved to generated/metadata in m2.2

edit: i've also contacted WeltPixel following some comments on github and they have said.

"We are aware of this issue that came with Magento 2.2.4 , and we already fixed it. The fix will be included in the next products releases next week, after all tests are completed."

karty
  • 13
  • 4
0

First clear all the cache by running following command in terminal:

rm -rf var/di/* var/generation/* var/cache/* var/page_cache/* var/view_preprocessed/* var/composer_home/cache/*

Then try the following:

php bin/magento setup:di:compile
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f

Hopefully it will solve your issue.