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: Uncaught Error: Call to undefined method Composer\Console\Application::areExceptionsCaught() #10022

Closed
PhilETaylor opened this issue Jul 25, 2021 · 4 comments
Labels
Milestone

Comments

@PhilETaylor
Copy link

PhilETaylor commented Jul 25, 2021

Enough info below to understand the issue I think - On mac, but again that will probably be irrelevant

The same happens using 2.1.5 stable composer self-up --2 as it does in the snapshot version below.

relates to this method call that doesnt exist in the class introduced in merged PR #10017, looks like that PR is missing the actual function in the PR

if ($this->areExceptionsCaught()){


mkdir test-composer-snapshot

cd test-composer-snapshot

composer self-update --snapshot
# You are already using the latest available Composer version bbe3769bcddedde5c89c28705a26a2fd933ccb0e (snapshot channel).

composer -V
# Composer version 2.1-dev (2.1-dev+bbe3769bcddedde5c89c28705a26a2fd933ccb0e) 2021-07-23 08:35:14


composer install # or composer update



Composer could not find a composer.json file in /Users/phil/Sites/test-composer-snapshot
To initialize a project, please create a composer.json file. See https://getcomposer.org/basic-usage
PHP Fatal error:  Uncaught Error: Call to undefined method Composer\Console\Application::areExceptionsCaught() in phar:///usr/local/bin/composer/src/Composer/Console/Application.php:422
Stack trace:
#0 phar:///usr/local/bin/composer/src/Composer/Command/BaseCommand.php(63): Composer\Console\Application->getComposer(true, false)
#1 phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php(96): Composer\Command\BaseCommand->getComposer(true, false)
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php(245): Composer\Command\InstallCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(835): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(185): Symfony\Component\Console\Application->doRunCommand(Object(Composer\Command\InstallCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(314): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(117): Composer\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(125): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 phar:///usr/local/bin/composer/bin/composer(67): Composer\Console\Application->run()
#9 /usr/local/bin/composer(25): require('phar:///usr/loc...')
#10 {main}
  thrown in phar:///usr/local/bin/composer/src/Composer/Console/Application.php on line 422

Fatal error: Uncaught Error: Call to undefined method Composer\Console\Application::areExceptionsCaught() in phar:///usr/local/bin/composer/src/Composer/Console/Application.php:422
Stack trace:
#0 phar:///usr/local/bin/composer/src/Composer/Command/BaseCommand.php(63): Composer\Console\Application->getComposer(true, false)
#1 phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php(96): Composer\Command\BaseCommand->getComposer(true, false)
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php(245): Composer\Command\InstallCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(835): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(185): Symfony\Component\Console\Application->doRunCommand(Object(Composer\Command\InstallCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(314): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(117): Composer\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(125): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 phar:///usr/local/bin/composer/bin/composer(67): Composer\Console\Application->run()
#9 /usr/local/bin/composer(25): require('phar:///usr/loc...')
#10 {main}
  thrown in phar:///usr/local/bin/composer/src/Composer/Console/Application.php on line 422
@Seldaek
Copy link
Member

Seldaek commented Jul 28, 2021

Oops, that fix is really no fix at all sorry, private property :)

@Seldaek Seldaek reopened this Jul 28, 2021
@Shikachuu
Copy link

Shikachuu commented Aug 4, 2021

Hey,
This issue is still causing problems using the offical docker image form docker hub.
More specifically, it happens when there is a syntax error in the composer.json.

We are running tag composer:2, which is currently this verison: Composer version 2.1.5 2021-07-23 10:35:47.
The command which breaks: composer install --quiet --no-scripts --optimize-autoloader --ignore-platform-reqs

Temporary we fixed it with downgrading to 2.1.2, but we still struggle with local builds.
Which versions are affected by this bug? Is it safe to update 2.1.2 to 2.1.4?

@PhilETaylor
Copy link
Author

@Shikachuu I cannot replicate your issue. If my composer.json is just {,} then I (correctly) get the following when using Composer version df99150 (todays snapshot channel)

Screenshot 2021-08-07 at 15 53 49

This was only fixed 10 days ago (28th July) in git so would not have been in the Composer version 2.1.5 2021-07-23 10:35:47 as that was released 5 days before the fix!

@Seldaek
Copy link
Member

Seldaek commented Aug 19, 2021

2.1.6 is out now with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants