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

Mass failure after Ubuntu upgrade #798

Closed
2 of 5 tasks
iBotPeaches opened this issue Dec 6, 2023 · 7 comments · Fixed by shivammathur/php-ubuntu#3
Closed
2 of 5 tasks

Mass failure after Ubuntu upgrade #798

iBotPeaches opened this issue Dec 6, 2023 · 7 comments · Fixed by shivammathur/php-ubuntu#3
Assignees
Labels
bug Something isn't working

Comments

@iBotPeaches
Copy link

Describe the bug

All our builds are failing now (Including Laravel) after this change: shivammathur/php-ubuntu@83d1155

It manifest as an error of

Error: Child process error (exit code 255): PHP Fatal error:  Declaration of Symfony\Component\Cache\CacheItem::expiresAt(?DateTimeInterface $expiration): static must be compatible with PsrExt\Cache\CacheItemInterface::expiresAt($expiration) in /home/runner/work/xxx-Laravel/xxx-Laravel/vendor/symfony/cache/CacheItem.php on line 65
PHP Fatal error:  Declaration of Monolog\Logger::emergency(Stringable|string $message, array $context = []): void must be compatible with PsrExt\Log\LoggerInterface::emergency($message, array $context = []) in /home/runner/work/PinchAPenny-Laravel/PinchAPenny-Laravel/vendor/monolog/monolog/src/Monolog/Logger.php on line 681

Which I found is claimed as a "buggy" extension by Symfony: symfony/symfony#49984

Version

  • I have checked releases, and the bug exists in the latest patch version of v1 or v2.
  • v2
  • v1

Runners

  • GitHub Hosted
  • Self Hosted

Operating systems
Ubuntu

PHP versions
All

To Reproduce
Run PHPStan?

Expected behavior
Not a crash

Are you willing to submit a PR?
I'd just revert this shivammathur/php-ubuntu@83d1155

@iBotPeaches iBotPeaches added the bug Something isn't working label Dec 6, 2023
@stevebauman
Copy link

Just started getting this too on all of my builds in GitHub actions.

@ralphjsmit
Copy link

ralphjsmit commented Dec 6, 2023

Me too, all our GitHub Actions are crashing (in multiple repos).

@mattwellss
Copy link

While waiting for a fix, the psr extension can be disabled

Shared extensions can be disabled by prefixing them with a :. All extensions depending on the specified extension will also be disabled.

  steps:
    - uses: shivammathur/setup-php@[whatever]
      with:
        [other stuff]
        extensions: :psr

https://github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support

@percymamedy
Copy link

While waiting for a fix, the psr extension can be disabled

Shared extensions can be disabled by prefixing them with a :. All extensions depending on the specified extension will also be disabled.

  steps:
    - uses: shivammathur/setup-php@[whatever]
      with:
        [other stuff]
        extensions: :psr

https://github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support

That fix worked for me

@JonErickson
Copy link

Confirmed from Laravel staff in v10 you need to disable the psr extension.

laravel/framework#46165

@iBotPeaches
Copy link
Author

Sure - I can go fix a ton of builds with disabling psr. It isn't that urgent though if I hopefully believe in the morning - that the author will just revert this and things will resume.

As you can see this extension at the core is this outdated PECL extension - https://pecl.php.net/package/psr. This is leading to what we see here.

Screenshot 2023-12-06 at 4 50 55 PM

So I don't think it merits a default include in the image and should be "opt-in" only.

@jwage
Copy link

jwage commented Dec 6, 2023

Ran in to this as well:

Uncaught Exception: InvalidArgumentException Could not get class storage for psr\log\loglevel
Emitted in /home/runner/work/traderspost/traderspost/vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:46

Using GitHub actions with shivammathur/setup-php@v2

Ignoring :psr worked for me.

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.

8 participants