Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After 2.3.0-alpha upgrade 'Zend\Mvc\Controller\LazyControllerAbstractFactory' not found #15441

Closed
fooman opened this issue May 23, 2018 · 7 comments
Labels
Component: Setup Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@fooman
Copy link
Contributor

fooman commented May 23, 2018

Preconditions

  1. install Magento 2.2

Steps to reproduce

  1. composer config minimum-stability alpha
  2. composer require magento/product-community-edition:2.3.0-alpha --no-update
    (also copy updated require-dev dependencies)
  3. composer update
  4. bin/magento setup:upgrade

Expected result

  1. Upgrade should run

Actual result

php -dlog_errors_max_len=0 -f bin/magento
PHP Fatal error:  Uncaught Error: Class 'Zend\Mvc\Controller\LazyControllerAbstractFactory' not found in /var/www/vendor/zendframework/zend-servicemanager/src/ServiceManager.php:314
Stack trace:
#0 /var/www/vendor/zendframework/zend-servicemanager/src/Config.php(137): Zend\ServiceManager\ServiceManager->addAbstractFactory('Zend\\Mvc\\Contro...')
#1 /var/www/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php(225): Zend\ServiceManager\Config->configureServiceManager(Object(Zend\Mvc\Controller\ControllerManager))
#2 [internal function]: Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent))
#3 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(490): call_user_func(Array, Object(Zend\ModuleManager\ModuleEvent))
#4 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(248): Zend\EventManager\EventManager->triggerListeners('loadModules.pos...', Object(Zend\ModuleManager\ModuleEvent))
#5 /var/www/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(129): Zend\EventManager\EventManager->triggerEvent(Object(Zend\ModuleManager\ModuleEvent))
#6 /var/www/setup/src/Magento/Setup/Application.php(35): Zend\ModuleManager\ModuleManager->loadModules()
#7 /var/www/vendor/magento/framework/Console/Cli.php(71): Magento\Setup\Application->bootstrap(Array)
#8 /var/www/bin/magento(22): Magento\Framework\Console\Cli->__construct('Magento CLI')
#9 {main}
  thrown in /var/www/vendor/zendframework/zend-servicemanager/src/ServiceManager.php on line 314

The issue can be fixed by manually editing composer.json autoload section to

    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/",
            "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
        },

and then run composer dumpautoload.

However overall I think we should strive to not have to make any changes to the composer.json file during an upgrade beyond the version number bump of magento/product-community-edition.

After the initial composer create-project magento/project-community-edition the root composer.json file essentially is out of Magento's control and ideally everything we need to pull in/want to change should happen via magento/product-community-edition

In this particular case I do not understand why this 1 file gets such special treatment and gets added under setup/src. Better options in my mind would be:

  1. Upgrade zend-mvc to include this wanted file
  2. Provide the file and autoload information via a separate module
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label May 23, 2018
@buskamuza
Copy link
Contributor

Hi @fooman , please run https://github.com/magento/magento2/blob/2.3-develop/dev/tools/UpgradeScripts/pre_composer_update_2.3.php before composer update during upgrade process.
We know about this issue and are working on the docs and blog post on this (not ready yet).
Sorry for the confusion.

@engcom-backlog-nickolas engcom-backlog-nickolas added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Component: Setup labels Jul 16, 2018
@engcom-backlog-nickolas

Hello @fooman, thank you for your report.
We've acknowledged the issue and added to our backlog.

@kirkmadera
Copy link

kirkmadera commented Dec 10, 2018

I received this error when attempting to run this script because my composer json had numerically indexed repositories without keys.

Fatal error: Uncaught TypeError: strtolower() expects parameter 1 to be string, integer given in /var/www/myproject/pre_composer_update_2.3.php:151
Stack trace:
#0 /var/www/myproject/pre_composer_update_2.3.php(151): strtolower(0)
#1 {main}

thrown in /var/www/myproject/pre_composer_update_2.3.php on line 151

Should update the script to consider this as this will be pretty common.

@ronniereid
Copy link

I also received this error. What is the workaround?

Thanks in advance.

I received this error when attempting to run this script because my composer json had numerically indexed repositories without keys.
...
Should update the script to consider this as this will be pretty common.

@kirkmadera
Copy link

The fix was to edit my composer.json and replace the numerically indexed repositories array with a string indexed one.

@fooman
Copy link
Contributor Author

fooman commented Mar 5, 2019

2.3.0 was released with these changes included. See https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html for detailed upgrade instructions.

@fooman fooman closed this as completed Mar 5, 2019
@bangermeier
Copy link

Is there a similar script for cloud?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Setup Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

7 participants