Magento2: Custom composer modules break Component Manager

Created on 22 Sep 2016  路  19Comments  路  Source: magento/magento2

Preconditions

  1. PHP 7.0.9
  2. Magento 2.1 (stable version)

    Steps to reproduce

  3. Install some extension via Composer.
    I tried the following command composer require snowdog/language-pl_pl

  4. Go to Magento Marketplace and install some extension from here. I installed the following package https://marketplace.magento.com/magenerds-language-de-de.html (this step is probably not required to reproduce the issue)
  5. Go to System -> Tools -> Web Setup -> Component Manager

    Expected result

No PHP error. The list of installed extensions is presented.

Actual result

The spinner is loading all the time.
You can see that the url /setup/index.php/componentGrid/components returns the following PHP error:

An error occurred

An error occurred during execution; please try again later.

Additional information:

RuntimeException

File:
/var/www/magento/setup/src/Magento/Setup/Model/PackagesData.php:88
Message:
Couldn't get available versions for package snowdog/language-pl_pl
Stack trace:
#0 /var/www/magento/setup/src/Magento/Setup/Controller/ComponentGrid.php(98): Magento\Setup\Model\PackagesData->syncPackagesData()
#1 /var/www/magento/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Magento\Setup\Controller\ComponentGrid->componentsAction()
#2 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#3 /var/www/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#4 /var/www/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#5 /var/www/magento/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#6 /var/www/magento/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#7 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#8 /var/www/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#9 /var/www/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#10 /var/www/magento/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#11 /var/www/magento/setup/index.php(31): Zend\Mvc\Application->run()
#12 {main}

I think the issue is related to the https://repo.magento.com/packages.json file that doesn't include custom (local) composer modules.
Magento can't find custom (local) extension data in this file, so it is unable to generate the list.

Setup Ready for Work bug report

Most helpful comment

For everybody still seeing this issue, I believe the reason is because it was pushed onto a branch for 2.2. I just submitted a PR to port the fix back to 2.1-develop. If you can't wait for it to come as an update you can take a look at the code here: https://github.com/magento/magento2/pull/9692/files . Note that I am not an experienced contributor to Magento so YMMV. Review and use at your own risk 馃槈
Thanks to @korostii for pointing in the right direction.

All 19 comments

I am having the same issue

Related to example 3 here https://github.com/magento/magento2/issues/4986#issuecomment-226027025 (in this example no extra repository needs to be added since it's done via packagist)

Hi @dmaciej,

Thank you for submission. I created internal ticket MAGETWO-59256 to investigate and fix this issue.

Hi. Is there any temporary "fix" for this issue, without removing the custom module?

Fix for this issue was delivered to develop branch.
Closed.

@shiftedreality am I just messing up something or does this still persist in 2.1.4? Just tested and got the same error after a composer update to 2.1.4

This problem appears to persist in 2.1.3 even. I have installed a french language pack via composer in a brand new CE 2.1.3. Trying to upgrade through the Web Setup Wizard. It doesn't even accept my Private Key and Public Key with the following error message:
"Couldn't get available versions for package imaginaerum/magento2-language-fr-fr"

Problem remains in 2.1.4, for example with bitExpert/magento2-force-login module

I'm finding that this problem also exists when the Magento 2.1.4 installation is made from Softaculous in the cPanel. My workaround is to not use the Component Manager and install the extension manually (when I can).
John

Fixed in develop branch? Where? Someone please post the link to the corrected code. Great to know that we can run things properly if we're running a dev site, but not production. Problem persists in 2.1.5.

Where is a solution ??

Any solution yet?

I can confirm it still doesn't work in 2.1.4

same here: 2.1.6

Same issue in 2.1.6

@spjuggalojoe, have you tried looking for that internal ticket ID? The related commits usually have it mentioned:
https://github.com/magento/magento2/search?q=MAGETWO-59256&type=Commits

Please note that it recently became possible to create a pull request targeting 2.1-develop branch as explained here. That would probably somewhat speed up the deliverance of the fix.

For everybody still seeing this issue, I believe the reason is because it was pushed onto a branch for 2.2. I just submitted a PR to port the fix back to 2.1-develop. If you can't wait for it to come as an update you can take a look at the code here: https://github.com/magento/magento2/pull/9692/files . Note that I am not an experienced contributor to Magento so YMMV. Review and use at your own risk 馃槈
Thanks to @korostii for pointing in the right direction.

https://github.com/magento/magento2/pull/9692/files
This fix worked for me. Thanks to JTimNolan

Internal ticket to track issue progress: MAGETWO-70137

Was this page helpful?
0 / 5 - 0 ratings