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

Fatal error on non-minimal install (selecting optional packages) #13

Closed
PAStheLoD opened this issue Dec 10, 2020 · 5 comments · Fixed by #15
Closed

Fatal error on non-minimal install (selecting optional packages) #13

PAStheLoD opened this issue Dec 10, 2020 · 5 comments · Fixed by #15
Labels
Bug Something isn't working
Milestone

Comments

@PAStheLoD
Copy link

Bug Report

Q A
Version(s) 0.2.1

Summary

I'm using composer create-project --stability dev laminas/laminas-mvc-skeleton /opt/backend , when composer asks about minimal install (optional packages) I tried various combinations (most of the packages, just one, or just a different one), but the error is the same. (mvc-skeleton is at 1.2.x-dev 12ff936 currently)

...
Updating root package
    Running an update to install optional packages
PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function Composer\Installer::setUpdate(), 0 passed in /opt/backend_try2/vendor/laminas/laminas-skeleton-installer/src/OptionalPackagesInstaller.php on line 321 and exactly 1 expected in phar:///usr/local/bin/composer/src/Composer/Installer.php:1053
Stack trace:
#0 /opt/backend_try2/vendor/laminas/laminas-skeleton-installer/src/OptionalPackagesInstaller.php(321): Composer\Installer->setUpdate()
#1 /opt/backend_try2/vendor/laminas/laminas-skeleton-installer/src/OptionalPackagesInstaller.php(107): Laminas\SkeletonInstaller\OptionalPackagesInstaller->runInstaller()
#2 /opt/backend_try2/vendor/laminas/laminas-skeleton-installer/src/Plugin.php(84): Laminas\SkeletonInstaller\OptionalPackagesInstaller->__invoke()
#3 [internal function]: Laminas\SkeletonInstaller\Plugin->installOptionalDependencies()
#4 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(172): call_user_func()
#5 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(101): Composer\EventDispatcher\EventDispatcher->doDispatch()
#6 phar:///usr/local/bin/composer/src/Composer/Installer.php(339): Composer\EventDispatcher\EventDispatcher->dispatchScript()
#7 phar:///usr/local/bin/composer/src/Composer/Command/CreateProjectCommand.php(241): Composer\Installer->run()
#8 phar:///usr/local/bin/composer/src/Composer/Command/CreateProjectCommand.php(156): Composer\Command\CreateProjectCommand->installProject()
#9 phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php(245): Composer\Command\CreateProjectCommand->execute()
#10 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(835): Symfony\Component\Console\Command\Command->run()
#11 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(185): Symfony\Component\Console\Application->doRunCommand()
#12 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(310): Symfony\Component\Console\Application->doRun()
#13 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(117): Composer\Console\Application->doRun()
#14 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(122): Symfony\Component\Console\Application->run()
#15 phar:///usr/local/bin/composer/bin/composer(63): Composer\Console\Application->run()
#16 /usr/local/bin/composer(24): require('...')
#17 {main}
  thrown in phar:///usr/local/bin/composer/src/Composer/Installer.php on line 1053
@PAStheLoD PAStheLoD added the Bug Something isn't working label Dec 10, 2020
@weierophinney
Copy link
Member

What version of Composer are you using? (composer --version will give you the version)

@PAStheLoD
Copy link
Author

Composer version 2.0.8 2020-12-03 17:20:38

And many thanks for the fast reply!

@froschdesign
Copy link
Member

@PAStheLoD
As a temporary workaround, you can use Composer with version 1.10.x via manual download. This will run the installation.
We have to check the error with version 2 of Composer.

Thanks for reporting! 👍

@rbroen
Copy link
Contributor

rbroen commented Dec 14, 2020

At the suggestion of froschdesign, I am adding my findings here:

On https://github.com/laminas/laminas-skeleton-installer/blob/0.3.x/src/OptionalPackagesInstaller.php line 321 $installer->setUpdate(); is called without a parameter.
On https://github.com/composer/composer/blob/master/src/Composer/Installer.php on line 1053 public function setUpdate($update), this does not seem an optional parameter....
I can imagine this being a problem, with or without strict mode.

In my case changing OptionalPackagesInstaller with a $installer->setUpdate(false); solved the issue.
Should I submit a pull request in the laminas/laminas-skeleton-installer project?

@weierophinney
Copy link
Member

Fixed with #15

@weierophinney weierophinney added this to the 0.2.2 milestone Dec 15, 2020
@weierophinney weierophinney linked a pull request Dec 15, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants