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)"} []