2

Whenever I upload a new extension to my app/code folder, the site goes systematically down. I upload it using the magento user so there is no owner issue. I am in production mode.

More specifically this happens just after registering the extension:

php bin/magento setup:upgrade
php bin/magento cache:flush

Here is the error msg in the browser:

An error has happened during application run. See exception log for details.

I solve the issue the following way:

rm -rf ./var/cache/ ./var/pages_cache/
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento setup:static-content:deploy -f
rm -rf ./var/cache/

Then restart varnish and invalidate cdn cache.

However I would really like to solve the underlying issue.

And here is the log exception at the same time:

[2019-08-25 11:14:04] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\Framework\App\Http\Interceptor does not exist at /var/www/magento/vendor/magento/framework/Code/Reader/ClassReader.php:19)"} []

3

As per Magento. when you have run php bin/magento setup:upgrade command then all cache ,pages_cache and static content and Code compiler are clear that why you are getting error**

An error has happened during application run. See exception log for details.

At production mode, Magento does not auto-generate static content, class compilation, So after running setup upgrade command, you need to run below command.

  • php bin/magento setup:di:compile for [Code compileation]1.
  • php bin/magento setup:static-content:deploy for Static content deploy.

So, the best way to install an extension or run the setup upgrade, you first need to Enable Maintenance mode. then run the following commands.

Steps should be the following:

  1. Enable Maintenance mode byphp bin/magento maintenance:enable

  2. Enable extension byphp bin/magento module:enable VendorName_ModuleName

  3. Run Setup Upgradephp bin/magento setup:upgrade.
  4. Run di compilationphp bin/magento setup:di:compile.
  5. Run Static content deployphp bin/magento setup:static-content:deploy -f.
  6. Disable Maintenance mode byphp bin/magento maintenance:disable.

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.