I tried to upgrade magento from 2.3.5-p2 to 2.4.0 but I got an error in the frontend, so I changed back to 2.3.5-p2, deleted my whole vendor folder and executed composer update again.

But now my frontend does not work anymore and I get

There has been an error processing your request Class
Magento\Csp\Model\BlockCache does not exist

If I execute php bin/magento setup:upgrade then I get There are no commands defined in the "setup" namespace.

And if I execute php bin/magento list then I get:

Magento CLI 2.3.5-p1

Usage: command [options] [arguments]

Options: -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands: help Displays help for a command list Lists commands

In ServiceManager.php line 1129:

An abstract factory could not create an instance of magentosetupconsolecommanddbstatuscommand(alias: Magento\Setup\Console\Command\DbStatusCommand).

In ServiceManager.php line 940:

An exception was raised while creating "Magento\Setup\Console\Command\DbStatusCommand"; no instance returned

In ClassReader.php line 26:

Class Vertex\Tax\Setup\Schema\Triggers\MigrateVertexInvoiceSent does not exist

[company@company company.de]$ php bin/magento setup:upgrade

There are no commands defined in the "setup" namespace.

So I deleted my setup folder and copied another one from a working magento 2 copy, but it still fails with the same error.

1 Answer 1


I changed my PHP version via cPanel from 7.3 to 7.2 for the project and back to 7.3, then it worked suddenly. Not sure why.

Be careful, I think magento or the cPanel changed permissions of my magento folder and of the .htaccess file in the magento root. Check the permission there too!

I have set the permission of my project folder to 755 with chmod 755 project-folder

  • You should NOT use PHP 7.3.x. As official docs say ( devdocs.magento.com/guides/v2.4/install-gde/… ), Magento 2.4.0 is developed and tested on PHP 7.4.x. PHP 7.3.x should be only used in the upgrading process.
    – KaMZaTa
    Sep 13, 2020 at 11:09
  • Yes, but I have bugs with PHP 7.4 and customers cant login anymore.
    – Black
    Sep 14, 2020 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.