magento2: Command fails: bin/magento deploy:mode:set production

Hi,

when I try to run bin/magento deploy:mode:set production it fails while executing php -f /var/www/html/bin/magento setup:di:compile-multi-tenant 2>&1

I’m working on a clean Magento 2 EE instance.

Enabled maintenance mode
Static content deployment start
Requested languages: en_US
=== frontend -> Magento/blank -> en_US ===
..............
Successful: 2051 files; errors: 0

---

=== frontend -> Magento/luma -> en_US ===
..............
Successful: 2124 files; errors: 0

---

=== adminhtml -> Magento/backend -> en_US ===
..............
Successful: 1874 files; errors: 0

---

=== Minify templates ===
..............
Successful: 1130 files modified

---

New version of deployed files: 1448885114
Static content deployment complete
Start compilation
Command returned non-zero exit code:
`php -f /var/www/html/bin/magento setup:di:compile-multi-tenant 2>&1`

Running bin/magento setup:di:compile-multi-tenant throws this error:

PHP Fatal error:  Class 'StaticReview\Review\AbstractReview' not found in /var/www/html/dev/tools/Magento/Tools/StaticReview/PhpCsFixerReview.php on line 19
PHP Stack trace:
PHP   1. {main}() /var/www/html/bin/magento:0
PHP   2. Symfony\Component\Console\Application->run() /var/www/html/bin/magento:25
PHP   3. Magento\Framework\Console\Cli->doRun() /var/www/html/vendor/symfony/console/Symfony/Component/Console/Application.php:126
PHP   4. Symfony\Component\Console\Application->doRun() /var/www/html/vendor/magento/framework/Console/Cli.php:49
PHP   5. Symfony\Component\Console\Application->doRunCommand() /var/www/html/vendor/symfony/console/Symfony/Component/Console/Application.php:195
PHP   6. Symfony\Component\Console\Command\Command->run() /var/www/html/vendor/symfony/console/Symfony/Component/Console/Application.php:874
PHP   7. Magento\Setup\Console\Command\DiCompileMultiTenantCommand->execute() /var/www/html/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
PHP   8. Magento\Setup\Console\Command\DiCompileMultiTenantCommand->compileCode() /var/www/html/setup/src/Magento/Setup/Console/Command/DiCompileMultiTenantCommand.php:228
PHP   9. Magento\Setup\Module\Di\Code\Reader\Decorator\Directory->getList() /var/www/html/setup/src/Magento/Setup/Console/Command/DiCompileMultiTenantCommand.php:374
PHP  10. Magento\Setup\Module\Di\Code\Reader\ClassesScanner->getList() /var/www/html/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Directory.php:92
PHP  11. class_exists() /var/www/html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php:69
PHP  12. spl_autoload_call() /var/www/html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php:69
PHP  13. Composer\Autoload\ClassLoader->loadClass() /var/www/html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php:69
PHP  14. Composer\Autoload\includeFile() /var/www/html/vendor/composer/ClassLoader.php:301
PHP  15. include() /var/www/html/vendor/composer/ClassLoader.php:412

The class StaticReview\Review\AbstractReview not exists in any directory.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 54 (9 by maintainers)

Most upvoted comments

Bump, this still isn’t fixed in Magento 2.0.5

@ Magento guys, I find it hard to believe that 6 months after the “stable” release, you still cannot setup a production-like environment for Magento 2 if you use composer install --no-dev because of this bug, this really should get a high priority!

This is the output we get:

$ php bin/magento setup:di:compile-multi-tenant
PHP Fatal error:  Class 'StaticReview\Review\AbstractReview' not found in dev/tools/Magento/Tools/StaticReview/PhpCsFixerReview.php on line 19

(please ignore the comments above for people with their 3rd party modules, they should resolve this with their 3rd party)

I was getting also errors trying to set mode on my local mamp setup and it proved to be memory_limit.

So for everyone that uses MAMP and faces the same, note that when running from cli, it won’t use the customised /Library/Application Support/appsolute/MAMP PRO/conf/php7.0.8.ini that you might have set through MAMP template files, but it will load directly the default MAMP Application php.ini inside: /Applications/MAMP/bin/php/php7.0.8/conf/php.ini.

So just adjust the memory_limit there and php bin/magento deploy:mode:set ... will run and complete.

We got in the same issue after running php magento deploy:mode:set production We can see: Static deployment complete Start compilation Command returned non-zero exit code: ‘php -f /home/mysite/public_html/bin/magento setup:di:complete-multi-tenant 2>&1’

Curiously, if we run php magento setup:di:complete-multi-tenant or php magento setup:di:complete-multi-tenant 2>&1 no errors show up. Furthermore, when firing php magento deploy:mode:show is confirmed we’re still in default mode and the deployment to mode production failed

Please try my workarround #3850 to check if it is something with your extensions. and what does this command say:

php -f bin/magento setup:di:compile-multi-tenant

Same issue here. Tried to go from default to production. Same error. Then I set it to developer. But now I can’t go back to default or production. I’m stuck. I run it with PHP 7.0.4.