cancel
Showing results for 
Search instead for 
Did you mean: 

Composer throwing various PHP related fatal errors after updating to latest version (2.2.2)

SOLVED

Composer throwing various PHP related fatal errors after updating to latest version (2.2.2)

Hello everyone,

Been a while since I've been part of a forum, but alas.. I'm out of ideas and getting rather frustrated not knowing what the solution to my problem is. As a note before going into details: I'm by no means a dedicated developer, but learning is definitely something I want and need to do when it comes to Magento 2. So here we go..

With the growth of our company, my employer finally decided to take the dive and adopt Magento 2, after having had Magento 1 for a very very long time. The past few days/weeks, the installation of Magento 2 was running perfectly fine on our test server, with composer installing extensions with ease and zero errors.

Up until I tried installing the Mollie integration extension, which threw the following error:

 Higher matching version 2.4.0 of mollie/magento2 was found in public repository packagist.org
                               than 2.0.0 in private https://repo.magento.com. Public package might've been taken over by a malicious entity,
                               please investigate and update package requirement to match the version from the private repository


Now naturally, I thought this might've been an issue with my current composer version, since it was outdated. I ran a composer selfupdate and it updated with no issues to the latest version, which at the time of writing is 2.2.2

After updating and adding the Mollie related packages to my composer.json, I ran composer update to fetch the files, only to be met with several odd errors relating to PHP. Using the vendor directory that we've had from the start and running a composer diagnose throws in the same errors:

PHP Fatal error:  Uncaught TypeError: Argument 3 passed to Composer\Package\Locker::__construct() must be an instance of Composer\Repository\RepositoryManager, instance of Composer\Installer\InstallationManager given, called in phar:///usr/local/bin/composer/src/Composer/Factory.php on line 446 and defined in /var/www/html/magento2/vendor/composer/composer/src/Composer/Package/Locker.php:54
Stack trace:
#0 phar:///usr/local/bin/composer/src/Composer/Factory.php(446): Composer\Package\Locker->__construct()
#1 phar:///usr/local/bin/composer/src/Composer/Factory.php(643): Composer\Factory->createComposer()
#2 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(445): Composer\Factory::create()
#3 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(388): Composer\Console\Application->getComposer()
#4 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(356): Composer\Console\Application->hintCommonErrors()
#5 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(117): C in /var/www/html/magento2/vendor/composer/composer/src/Composer/Package/Locker.php on line 54

Fatal error: Uncaught TypeError: Argument 3 passed to Composer\Package\Locker::__construct() must be an instance of Composer\Repository\RepositoryManager, instance of Composer\Installer\InstallationManager given, called in phar:///usr/local/bin/composer/src/Composer/Factory.php on line 446 and defined in /var/www/html/magento2/vendor/composer/composer/src/Composer/Package/Locker.php:54
Stack trace:
#0 phar:///usr/local/bin/composer/src/Composer/Factory.php(446): Composer\Package\Locker->__construct()
#1 phar:///usr/local/bin/composer/src/Composer/Factory.php(643): Composer\Factory->createComposer()
#2 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(445): Composer\Factory::create()
#3 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(388): Composer\Console\Application->getComposer()
#4 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(356): Composer\Console\Application->hintCommonErrors()
#5 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(117): C in /var/www/html/magento2/vendor/composer/composer/src/Composer/Package/Locker.php on line 54

In addition to that, the website itself returns a whopping streak of HTTP 500 errors, rip website. (Note: Runs on Apache2)

I rolled back to an earlier version of composer to see if there was an issue with the one I just installed and ran the composer diagnose command, this resulted in showing me the information as you'd expect as a result from the command.

I then tried removing my vendor directory (after backing up the old one) and ran composer install to fetch all of the required components once more. This ended up going pretty well, up till the point it extracted the mollie/mollie-api-php (v2.39.0) archive, which was the last archive it had to extract, after which literally every single archive failed to install.

I've recorded this bit, as well as some of the composer commands I had used as to give you guys more insight on the situation: https://www.youtube.com/watch?v=8mclJhYEV9E

At the point of the video, I had started using a clean / fresh vendor directory. Removing the clean one and changing the name of bkup_vendor to vendor would generally bring back the PHP errors once more. Using a clean vendor directory on the other hand would fix the PHP issues, but the website throws an autoload error, telling me to run composer install. (Which, obviously failed / fails)

I wouldn't know where to start looking, as I've already checked the set directory permissions, PHP settings, composer.json and whatnot. Nor do I know whether or not composer has a directory in which error logs are saved. I've tried searching this issue far and wide, but couldn't find someone in a similar predicament.

Hope you guys can pitch in on the situation and perhaps someone here already experienced the same. Let me know if you need more information and I'll make sure to post it here!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Composer throwing various PHP related fatal errors after updating to latest version (2.2.2)

New day, new year! Hope everyone here has had a good New Year's Eve. Smiley Happy

I've found the root of the problem, these are the steps I performed to make it work again:

 

  1. Updated Composer to v2.2.3.
  2. Checked if composer diagnose works: yep.
  3. Removed the vendor directory and composer.lock file.
  4. Removed mollie/magento from the require list inside composer.json, apparently this one was still in there..
  5. Ran composer install.
  6. Success!

So at this moment either my configuration doesn't like Mollie, or the extension is busted. Either way, I'll have to dig a bit deeper to find out why Mollie's extension won't work.

I'll leave this post here in case someone hits the same brick wall as I did.

View solution in original post

1 REPLY 1

Re: Composer throwing various PHP related fatal errors after updating to latest version (2.2.2)

New day, new year! Hope everyone here has had a good New Year's Eve. Smiley Happy

I've found the root of the problem, these are the steps I performed to make it work again:

 

  1. Updated Composer to v2.2.3.
  2. Checked if composer diagnose works: yep.
  3. Removed the vendor directory and composer.lock file.
  4. Removed mollie/magento from the require list inside composer.json, apparently this one was still in there..
  5. Ran composer install.
  6. Success!

So at this moment either my configuration doesn't like Mollie, or the extension is busted. Either way, I'll have to dig a bit deeper to find out why Mollie's extension won't work.

I'll leave this post here in case someone hits the same brick wall as I did.