Upgrading laminas version 3 from laminas version 2

Our current project is on Laminas2. Last year we had updated our project from ZF2 to Laminas2.
Now we want to upgrade to laminas3(php 8.1) and we have started the migration but it is not going as smooth as expected.
We are facing lots of issues. Did we took any wrong step? We are following the migration documents.

Hello and welcome to our forums! :smiley:

Which issues? Please provide error message and/or stack traces.

You will need to be much more specific than that :slight_smile:

Software is complex and breaks in different ways depending on how it was built: what are you experiencing, exactly?

Have you written automation tests? Static analysis? What guides were you following, precisely?

To be more specific :slightly_smiling_face:

  1. we are making use of Laminas/Di/Di and as per documentation, changing it to Laminas/Di/Injector gives us error related to Laminas\Di\Injector could not be resolved to a factory.
  2. If we try using it with laminas-servicemanager as suggested for use of IOT, the steps mentioned merely installing laminas-di with laminas-component-installer should make things work but it doesn’t.
  3. We modified the configuration array from di key to dependencies => auto key as suggested in one of the documentation of laminas.dev, but that does not seem to work.Background, we migrated from zf2 to laminas-2 and now we have migrated to laminas-3 with respect to the dependencies but the changes need to be done for migration of laminas dependencies v2 to laminas dependencies v3. Also we need to make changes to code as it appears zf2 code needs to be updated to zf3 (which in most documentations mentioned, has to be done prior to migrating to laminas). So is it possible and what are the simplest steps to migrate for the above changes?

Looking at these traces:

| nilamrsharma
June 28 |

  • | - |

Thank you for quick reply, Below errors are occurring now ,

[Wed Jun 15 23:23:06.944030 2022] [php:notice] [pid 22] [client [172.17.0.1:21991](http://172.17.0.1:21991)] Exception: Call to a member function addFileChannel() on null --- Backtrace: #0 /var/www/shipwire.www/swclient/vendor/shipwire/internal-shipwire-api-client/src/Shipwire/ApiClient/AbstractController.php(226): Shipwire\\ApiClient\\AbstractController->logAccess()\n#1 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Shipwire\\ApiClient\\AbstractController->onDispatch()\n#2 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\\EventManager\\EventManager->triggerListeners()\n#3 /var/www/shipwire.www/swclient/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\\EventManager\\EventManager->triggerEventUntil()\n#4 /var/www/shipwire.www/swclient/vendor/laminas/laminas-mvc/src/Controller/AbstractRestfulController.php(307): Laminas\\Mvc\\Controller\\AbstractController->dispatch()\n#5 /var/www/shipwire.www/swclient/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\\Mvc\\Controller\\AbstractRestfulController->dispatch()\n#6 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\\Mvc\\DispatchListener->onDispatch()\n#7 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\\EventManager\\EventManager->triggerListeners()\n#8 /var/www/shipwire.www/swclient/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\\EventManager\\EventManager->triggerEventUntil()\n#9 /var/www/shipwire.www/swclient/public/index.php(15): Laminas\\Mvc\\Application->run()\n#10 {main}, referer: [https://merchant.developer.corp.shipwire.com/index/login](https://merchant.developer.corp.shipwire.com/index/login)

This one looks like shipwire/internal-shipwire-api-client is at fault: nothing really framework-related. Looks like a missing dependency?

[Thu Jun 16 00:45:33.497009 2022] [php:notice] [pid 29] [client [172.17.0.1:41805](http://172.17.0.1:41805)] Exception: Service with name "json-pp" could not be created. Reason: Could not resolve value for parameter "vars" of type any in class Shipwire\\ApiClient\\PostProcessor\\Json (requested as json-pp) --- Backtrace: #0 /var/www/shipwire.www/swclient/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(234): Laminas\\ServiceManager\\ServiceManager->doCreate()\n#1 /var/www/shipwire.www/swclient/module/Main/Module.php(793): Laminas\\ServiceManager\\ServiceManager->get()\n#2 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Main\\Module->errorProcess()\n#3 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(171): Laminas\\EventManager\\EventManager->triggerListeners()\n#4 /var/www/shipwire.www/swclient/vendor/laminas/laminas-mvc/src/DispatchListener.php(146): Laminas\\EventManager\\EventManager->triggerEvent()\n#5 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\\Mvc\\DispatchListener->onDispatch()\n#6 /var/www/shipwire.www/swclient/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\\EventManager\\EventManager->triggerListeners()\n#7 /var/www/shipwire.www/swclient/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\\EventManager\\EventManager->triggerEventUntil()\n#8 /var/ww

Similar here: looks like your json-pp requires arguments that are not being provided? Possibly change in constructor signature? Also here, not related to the framework.

Exception: Too few arguments to function Shipwire\\Log\\ErrorHandling::errorHandler(), 4 passed in /var/www/shipwire.www/shopify-layer/module/Main/Module.php on line 90 and exactly 5 expected  --- Backtrace: #0 /var/www/shipwire.www/shopify-layer/module/Main/Module.php(90)Laminas\\EventManager\\EventManager->triggerListeners()\n#3 /var/www/shipwire.www/shopify-layer/vendor/laminas/laminas-mvc/src/Application.php(154): Laminas\\EventManager\\EventManager->triggerEvent()\n#4 /var/www/shipwire.www/shopify-layer/vendor/laminas/laminas-mvc/src/Application.php(266): Laminas\\Mvc\\Application->bootstrap()\n#5 /var/www/shipwire.www/shopify-layer/public/index.php(15): Laminas\\Mvc\\Application::init()\n#6 {main}
[php:notice] [pid 15] [client [10.42.0.21:44868](http://10.42.0.21:44868)]  ====== OnBoostrap Load =======, referer: [https://shopify.developer.corp.shipwire.com/](https://shopify.developer.corp.shipwire.com/)
[php:notice] [pid 15] [client [10.42.0.21:44868](http://10.42.0.21:44868)] Exception: Too few arguments to function Shipwire\\Log\\ErrorHandling::errorHandler(), 4 passed in /var/www/shipwire.www/shopify-layer/module/Main/Module.php on line 90 and exactly 5 expected --- Backtrace: #0 /var/www/shipwire.www/shopify-layer/module/Main/Module.php(90): Shipwire\\Log\\ErrorHandling::errorHandler()\n#1 /var/www/shipwire.www/shopify-layer/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Main\\Module->onBootstrap()\n#2 /var/www/shipwire.www/shopify-layer/vendor/laminas/laminas-eventmanager/src/EventManager.php(171): Laminas\\EventManager\\EventManager->triggerListeners()\n#3 /var/www/shipwire.www/shopify-layer/vendor/laminas/laminas-mvc/src/Application.php(154): Laminas\\EventManager\\EventManager->triggerEvent()\n#4 /var/www/shipwire.www/shopify-layer/vendor/laminas/laminas-mvc/src/Application.php(266): Laminas\\Mvc\\Application->bootstrap()\n#5 /var/www/shipwire.www/shopify-layer/public/index.php(15): Laminas\\Mvc\\Application::init()\n#6 {main}, referer: [https://shopify.developer.corp.shipwire.com/](https://shopify.developer.corp.shipwire.com/) (edited) 

We are getting many error but for now stuck in these above error

Also here, looks like a change of signature in shipwire’s logger.