Magento 2.3.1 Shell – Bin/Magento Error After Update

magento2.3.1shell

Hello i have updated from 2.2.8 to 2.3.1 now php bin/magento is not working:

php bin/magento list

Fatal error: Uncaught Error: Class 'Zend\Mvc\Controller\LazyControllerAbstractFactory' not found in .../vendor/zendframework/zend-servicemanager/src/ServiceManager.php:314
Stack trace:
#0 .../vendor/zendframework/zend-servicemanager/src/Config.php(137): Zend\ServiceManager\ServiceManager->addAbstractFactory('Zend\\Mvc\\Contro...')
#1 .../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 .../vendor/zendframework/zend-eventmanager/src/EventManager.php(490): call_user_func(Array, Object(Zend\ModuleManager\ModuleEvent))
#4 .../vendor/zendframework/zend-eventmanager/src/EventManager.php(248): Zend\EventManager\EventManager->trigger in .../vendor/zendframework/zend-servicemanager/src/ServiceManager.php on line 314

Best Answer

Following the upgrade instructions here https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html should take care of this issue. In particular for this error make sure to update your autoload section.