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 in newest version from composer #10382

Closed
thiagorb opened this issue Dec 22, 2021 · 15 comments · Fixed by #10386
Closed

Fatal error in newest version from composer #10382

thiagorb opened this issue Dec 22, 2021 · 15 comments · Fixed by #10386
Labels
Milestone

Comments

@thiagorb
Copy link

We are having problems with the version 2.2.0 from composer. I created the a minimal reproduction below. With version 2.1.14 this doesn't happen.

My composer.json:

{
	"autoload": {
		"files": [
			"app/AppKernel.php"
		]
	},
	"require": {
		"doctrine/orm": "2.7.*"
	},
	"config": {
		"allow-plugins": {
			"composer/package-versions-deprecated": true
		}
	}
}

Output of composer diagnose:

Checking composer.json: WARNING
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking pubkeys: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.2.0
PHP version: 7.4.25
PHP binary path: /usr/bin/php7.4
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019
cURL version: 7.52.1 libz 1.2.8 ssl OpenSSL/1.0.2u
zip: extension present, unzip not available, 7-Zip present (7z)

When I run this command:

php composer.phar install

I get the following output:

No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Updating dependencies
Lock file operations: 25 installs, 0 updates, 0 removals
  - Locking composer/package-versions-deprecated (1.11.99.4)
  - Locking doctrine/annotations (1.13.2)
  - Locking doctrine/cache (1.12.1)
  - Locking doctrine/collections (1.6.8)
  - Locking doctrine/common (3.2.0)
  - Locking doctrine/dbal (2.13.6)
  - Locking doctrine/deprecations (v0.5.3)
  - Locking doctrine/event-manager (1.1.1)
  - Locking doctrine/inflector (1.4.4)
  - Locking doctrine/instantiator (1.4.0)
  - Locking doctrine/lexer (1.2.1)
  - Locking doctrine/orm (2.7.5)
  - Locking doctrine/persistence (2.2.3)
  - Locking psr/cache (1.0.1)
  - Locking psr/container (1.1.2)
  - Locking symfony/console (v5.4.1)
  - Locking symfony/deprecation-contracts (v2.5.0)
  - Locking symfony/polyfill-ctype (v1.23.0)
  - Locking symfony/polyfill-intl-grapheme (v1.23.1)
  - Locking symfony/polyfill-intl-normalizer (v1.23.0)
  - Locking symfony/polyfill-mbstring (v1.23.1)
  - Locking symfony/polyfill-php73 (v1.23.0)
  - Locking symfony/polyfill-php80 (v1.23.1)
  - Locking symfony/service-contracts (v2.5.0)
  - Locking symfony/string (v5.4.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 25 installs, 0 updates, 0 removals
  - Installing composer/package-versions-deprecated (1.11.99.4): Extracting archive
PHP Fatal error:  Uncaught Error: Class 'Symfony\Component\HttpKernel\Kernel' not found in /var/www/auxmoney-web/thiago/app/AppKernel.php:5
Stack trace:
#0 phar:///var/www/auxmoney-web/thiago/composer.phar/src/Composer/Autoload/AutoloadGenerator.php(1422): require()
#1 phar:///var/www/auxmoney-web/thiago/composer.phar/src/Composer/Plugin/PluginManager.php(249): Composer\Autoload\composerRequire('af17a070b6916a0...', 'app/AppKernel.p...')
#2 phar:///var/www/auxmoney-web/thiago/composer.phar/src/Composer/Installer/PluginInstaller.php(79): Composer\Plugin\PluginManager->registerPackage(Object(Composer\Package\CompletePackage), true)
#3 [internal function]: Composer\Installer\PluginInstaller->Composer\Installer\{closure}(NULL)
#4 phar:///var/www/auxmoney-web/thiago/composer.phar/vendor/react/promise/src/React/Promise/FulfilledPromise.php(20): call_user_func(Object(Closure), NULL)
#5 phar:///var/www/auxmoney-web/thiago/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php(74): React\Promise\FulfilledPromise->then(Object in /var/www/auxmoney-web/thiago/app/AppKernel.php on line 5

Fatal error: Uncaught Error: Class 'Symfony\Component\HttpKernel\Kernel' not found in /var/www/auxmoney-web/thiago/app/AppKernel.php:5
Stack trace:
#0 phar:///var/www/auxmoney-web/thiago/composer.phar/src/Composer/Autoload/AutoloadGenerator.php(1422): require()
#1 phar:///var/www/auxmoney-web/thiago/composer.phar/src/Composer/Plugin/PluginManager.php(249): Composer\Autoload\composerRequire('af17a070b6916a0...', 'app/AppKernel.p...')
#2 phar:///var/www/auxmoney-web/thiago/composer.phar/src/Composer/Installer/PluginInstaller.php(79): Composer\Plugin\PluginManager->registerPackage(Object(Composer\Package\CompletePackage), true)
#3 [internal function]: Composer\Installer\PluginInstaller->Composer\Installer\{closure}(NULL)
#4 phar:///var/www/auxmoney-web/thiago/composer.phar/vendor/react/promise/src/React/Promise/FulfilledPromise.php(20): call_user_func(Object(Closure), NULL)
#5 phar:///var/www/auxmoney-web/thiago/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php(74): React\Promise\FulfilledPromise->then(Object in /var/www/auxmoney-web/thiago/app/AppKernel.php on line 5

And I expected this to happen:
No error.

@Robvdhout
Copy link

Robvdhout commented Dec 22, 2021

I see the same problem happening. I think it's because #10065 is now loading the files before the ClassLoader is hooked into the autoload functionality. edit: nvm, #10279 fixed that.
@thiagorb We added composer self-update 2.1.14 in our scripts before doing composer install.

@thiagorb
Copy link
Author

In our case we removed "files", cause it wasn't actually needed. Seems to be working fine so far.

@Seldaek
Copy link
Member

Seldaek commented Dec 22, 2021

Looks like this was caused by #9530 - I think we can probably safely exclude files autoloading from the root package as indeed loading this before the dependencies are available is a bad idea. I'll work on a fix.

@Seldaek
Copy link
Member

Seldaek commented Dec 22, 2021

I gotta ask though, seeing #10383 and #10384 and this issue here.. where were you all when we asked to test 2.2.0-RC1? 🤨

@cmuench
Copy link

cmuench commented Dec 22, 2021

I gotta ask though, seeing #10383 and #10384 and this issue here.. where were you all when we asked to test 2.2.0-RC1? raised_eyebrow

I was in the same situation and releasing an releasing new versions of Magerun :-)
No worry, together we will fix the issue.
Would also be nice if Adobe could do the Composer beta tests for Magento 2 / Adobe Commerce.

@cmuench
Copy link

cmuench commented Dec 22, 2021

@Seldaek Until this I had less to no issues with Composer.
That's a hidden compliment.
Maybe I can add some automation to test the Magento builds for upcoming Composer versions.
Thanks for your work.

@Seldaek
Copy link
Member

Seldaek commented Dec 22, 2021

Ok you can try now with composer self-update --snapshot which should fix it. I'll get a release out a bit later still need to investigate a couple other reports.

@fbourigault
Copy link

I ran into a similar issue and I can confirm that current snapshot is working.

@edurenye
Copy link

This worked well for me too, thank you!

@ahegyes
Copy link

ahegyes commented Dec 22, 2021

All my Github Actions builds started failing today and I traced it back to this issue. The snapshot works though! Thank you!

@jonashrem
Copy link

jonashrem commented Dec 22, 2021

@Seldaek

I gotta ask though, seeing #10383 and #10384 and this issue here.. where were you all when we asked to test 2.2.0-RC1? raised_eyebrow

I actually saw this happening, but thought it was Magento being incompatible with the new whitelist magento/magento2#34831 . Should have looked more into the details I think.

😳

@Seldaek
Copy link
Member

Seldaek commented Dec 22, 2021

2.2.1 is out now with the fix.

@fritzmg
Copy link
Sponsor

fritzmg commented Dec 22, 2021

I gotta ask though, seeing #10383 and #10384 and this issue here.. where were you all when we asked to test 2.2.0-RC1? 🤨

We saw this happening too, but were unsure whether it's a Composer issue - and then 2.2 got released before I could report it ;)

@Seldaek
Copy link
Member

Seldaek commented Dec 22, 2021

Heh no worries, life happens, I just was surprised at the amount of people hitting this issue.

@cmuench
Copy link

cmuench commented Dec 23, 2021

2.2.1 is out now with the fix.

Can confirm that the Magento installation is working again.

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

Successfully merging a pull request may close this issue.

9 participants