0

I'm getting this error on my homepage

ReflectionException: Class Magento\Framework\App\Http\Interceptor does not exist in /var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php:19 Stack trace: #0 /var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\Framewo...') #1 /var/www/html/vendor/magento/framework/ObjectManager/Definition/Runtime.php(49): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\Framewo...') #2 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\Framewo...') #3 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...', Array) #4 /var/www/html/vendor/magento/framework/App/Bootstrap.php(235): Magento\Framework\ObjectManager\ObjectManager->create('Magento\Framewo...', Array) #5 /var/www/html/index.php(38): Magento\Framework\App\Bootstrap->createApplication('Magento\Framewo...') #6 {main}

So I tried to setup:di:compile

I had an error in vendor/aheadworks/module-acr/Controller/Adminhtml/Wysiwyg/Directive.php

It was using a missing class use Magento\Framework\App\Action\HttpGetActionInterface;

So I wrote that class in order to make the setup:di:compile works

Compilation was started. Interception cache generation... 7/7 [============================] 100% 31 secs 380.0 MiB Generated code and dependency injection configuration successfully.

But I keep getting the same error on my main page, any ideas ?

  • If above error comes after any installation or updations? – Dhiren Vasoya Jul 30 at 13:42
  • @DhirenVasoya I don't think so I didn't worked on this project since some time and I just wanted to go back to my active git branch which I were working the last time was on it. so I don't think there is any new installation here. But I'm working on a shared database so I might have something wrong ? – Claims Jul 30 at 13:44
  • Oh wait I don't even remembered I had a similar issue some days ago : magento.stackexchange.com/questions/317766/… It's not the same error but I guess the fix will work anyway. – Claims Jul 30 at 13:51
  • ok, otherwise disable this aheadworks/module-acr then check. – Dhiren Vasoya Jul 30 at 13:52
0

try to clean generated folder. Than:

  • composer install
  • bin/magento setup:upgrade
  • bin/magento setup:di:compile
  • bin/magento setup:static-content:deploy -f
  • bin/magento cache:flush

cheers

| improve this answer | |
  • The strange thing is that I can't end di compile I'm getting Fatal error: Interface 'Magento\Framework\App\Action\HttpGetActionInterface' not found in /var/www/html/vendor/aheadworks/module-acr/Controller/Adminhtml/Wysiwyg/Directive.php on line 21 even considering the module Aheadworks_Acr is disabled – Claims Jul 30 at 15:25
  • Ok, the magento 2 directives explain that changes cannot be made within the vendor folder except by using modules installed via composer or through the use of ece-tool patches. Based on this assumption, you can delete the contents of the vendor folder (first make a backup of that folder on another point) and then try to run the commands I told you above. @Claims – Riccardo Ugolini Jul 31 at 6:52
  • Sadly I keep getting this error on di compile even after deleting and re-generating all my vendor. – Claims Jul 31 at 7:56
  • Ok I finally found what's was wrong here, it was not directly magento related, it was a docker issue, I had an other project running under the same port...meanings I didn't paid attention that my project didn't up correctly...meannings all the command I was running were not effective on the good project nor container ! – Claims Jul 31 at 8:13
  • all clear, update the issue and ... cheers – Riccardo Ugolini Aug 3 at 8:14
0

Run the following commands.

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
sudo chmod -R 777 var/ generated/ pub/
| improve this answer | |
  • Sadly I keep getting the error on di compile. due to this module acr. But what I don't understand is that even if I disable the module if my config.php, he keeps trying to load it. – Claims Jul 30 at 15:33
  • Then check, does any one call those files into the another module or somethnigs. – Dhiren Vasoya Jul 31 at 4:57
0

I suggest 2 steps:

step 1: disable this module we have identified as having an issue

php bin/magento module:disable Aheadworks_Acr

if the command above returns an error, go to app/etc/config.php and set the entry for this module to 0 manually

at this point, the module is disabled and It does seems this module is the culprit for some custom config that is not configured correctly somehow.

step 2:

The problem with config is they get to be part of the cache and they can be persistent. Because your issue has to do with config, I advise to clear var/cache folder manually and also if you use redis, do redis-cli flushall.

Once these 2 steps are complete, you should be able to run

php bin/magento cache:clean successfully

and your site should be back up.

Now, it may just be a syntax issue on your Aheadworks module and these guys have been on the market for long enough to say the module is likely working fine but somehow a syntax issue has cropped up..

| improve this answer | |
0

So In fact the real problem here was due to a wrong docker installation (This project was runing under the same port as an other one). Meanings all the commands were in fact running under the wrong project.

| improve this answer | |

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.