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

php74-fpm and pcre error with composer if you install any extension #44

Closed
tannoiser opened this issue Nov 19, 2021 · 18 comments · Fixed by #45
Closed

php74-fpm and pcre error with composer if you install any extension #44

tannoiser opened this issue Nov 19, 2021 · 18 comments · Fixed by #45

Comments

@tannoiser
Copy link

Hi,

starting from today november 19th, php74-fpm image throw an error in preg_match_all() function.

Step to reproduce:

docker run --name fpmtest phpdockerio/php74-fpm
docker exec -it fpmtest bash
apt-get update && apt-get -y --no-install-recommends install php7.4-mysql
composer -V

the output error is:

PHP Fatal error:  Uncaught ErrorException: preg_match_all(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in phar:///usr/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php:137
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle()
#1 phar:///usr/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php(137): preg_match_all()
#2 phar:///usr/bin/composer/vendor/symfony/console/Output/Output.php(155): Symfony\Component\Console\Formatter\OutputFormatter->format()
#3 phar:///usr/bin/composer/vendor/symfony/console/Output/Output.php(132): Symfony\Component\Console\Output\Output->write()
#4 phar:///usr/bin/composer/vendor/symfony/console/Application.php(641): Symfony\Component\Console\Output\Output->writeln()
#5 phar:///usr/bin/composer/vendor/symfony/console/Application.php(127): Symfony\Component\Console\Application->renderException()
#6 phar:///usr/bin/composer/src/Composer/Console/Application.php(128): Symfony\Component\Console\Application->run()
#7 phar:///usr/ in phar:///usr/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php on line 137

Fatal error: Uncaught ErrorException: preg_match_all(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in phar:///usr/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php:137
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle()
#1 phar:///usr/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php(137): preg_match_all()
#2 phar:///usr/bin/composer/vendor/symfony/console/Output/Output.php(155): Symfony\Component\Console\Formatter\OutputFormatter->format()
#3 phar:///usr/bin/composer/vendor/symfony/console/Output/Output.php(132): Symfony\Component\Console\Output\Output->write()
#4 phar:///usr/bin/composer/vendor/symfony/console/Application.php(641): Symfony\Component\Console\Output\Output->writeln()
#5 phar:///usr/bin/composer/vendor/symfony/console/Application.php(127): Symfony\Component\Console\Application->renderException()
#6 phar:///usr/bin/composer/src/Composer/Console/Application.php(128): Symfony\Component\Console\Application->run()
#7 phar:///usr/ in phar:///usr/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php on line 137
@cfroystad
Copy link

The problem seems related to oerdnj/deb.sury.org#1682

@thisisablock
Copy link

its related to all new php updates which rely on a PCRE update / bugfix.
https://www.php.net/index.php#id2021-11-19-1

Our only way to fix this was to downgrade in the container. The image has nothing to do with this issue because its loading just the latest minor version of php.

apt-cache policy php7.4

choose an older version (for example php7.4 | 7.4.3-4ubuntu2.7)
and downgrade your whole php stack.

apt-get install php7.4=7.4.3-4ubuntu2.7 php7.4-cli=7.4.3-4ubuntu2.7 php7.4-common=7.4.3-4ubuntu2.7 php7.4-fpm=7.4.3-4ubuntu2.7 php7.4-json=7.4.3-4ubuntu2.7 php7.4-opcache=7.4.3-4ubuntu2.7 php7.4-readline=7.4.3-4ubuntu2.7 php7.4-json=7.4.3-4ubuntu2.7 php7.4-opcache=7.4.3-4ubuntu2.7 php7.4-curl=7.4.3-4ubuntu2.7 php7.4-gd=7.4.3-4ubuntu2.7 php7.4-intl=7.4.3-4ubuntu2.7 php7.4-mbstring=7.4.3-4ubuntu2.7 php7.4-mysql=7.4.3-4ubuntu2.7 php7.4-soap=7.4.3-4ubuntu2.7 php7.4-sqlite3=7.4.3-4ubuntu2.7 php7.4-xml=7.4.3-4ubuntu2.7 php7.4-zip=7.4.3-4ubuntu2.7

@luispabon
Copy link
Contributor

Thanks for the report, I was just looking into it.

It indeed seems like an issue with php 7.4.26. The current build (last night) of our image is on 7.4.25 and .26 must've come out in the last few hours.

@thisisablock
Copy link

@luispabon

8.0.13, 7.4.26 and 7.3.33 are affected

@luispabon
Copy link
Contributor

luispabon commented Nov 19, 2021

@thisisablock I can't reproduce it on 7.3.33, but indeed on the others.

image

@Danack
Copy link

Danack commented Nov 19, 2021

@thisisablock your link didn't work for me - I guess https://bugs.php.net/bug.php?id=81424 is the relevant issue.

btw apparently adding a apt-get dist-upgrade -y && \ before the PHP install makes the issue go away.

@luispabon
Copy link
Contributor

Ah, looks like there's also a new version if libpcre that is not getting installed with the other updates, hence the crash. Gonna kick off new builds now

@thisisablock
Copy link

@luispabon can confirm - 7.3.33 is safe

@luispabon
Copy link
Contributor

Unfortunately the new build won't fix the problem as it stands as libpcre isn't being updated. I reckon and I've said as much on the ondrej repo's issue above that the php packages should directly depend on this newer version of pcre (provided by the ppa).

I'll work in a workaround.

@luispabon
Copy link
Contributor

Workaround is in place, builds in progress:

https://github.com/phpdocker-io/base-images/actions/runs/1481517715

Apologies for the slow builds, I recently added arm32 and 64 builds which take some time.

@luispabon
Copy link
Contributor

Builds are up, they're working for me. If any of you could please docker pull and check to confirm I'd be thankful.

@thisisablock
Copy link

thanks luis! have a nice weekend

@mihitha
Copy link

mihitha commented Nov 19, 2021

Thanks @luispabon , It is working for me now. (7.4)

@mihitha
Copy link

mihitha commented Nov 19, 2021

8.0 also working for me now.

@tannoiser
Copy link
Author

I also can confirm 7.4 works. I'll think to keep in any case the dist-upgrade just in case.
beside the size of the container, are there any other contraindications?

@luispabon
Copy link
Contributor

luispabon commented Nov 19, 2021

Thanks all for double checking. Closing this now

@tannoiser I personally avoid upgrades on containers because it makes builds non-reproducible, and due to the way layering works on images, container size can balloon. This is part of the reason why images are being built daily, instead of waiting for a new php release. In any case it's not inherently wrong - you do you.

@JorgeSivil
Copy link

JorgeSivil commented Nov 19, 2021

Thanks for the quick response @luispabon.

This leads me to ask you if there's a way to lock the container tag to prevent these kind of issues, so we can manually control the update of PHP / dependencies, giving more security on build status on this side.

I went to https://hub.docker.com/r/phpdockerio/php74-fpm/tags and it only shows "latest"

@luispabon
Copy link
Contributor

Indeed there's only latest and it is like so by design. Static tags wouldn't have helped on this issue anyhow, unless I'd also gone and installed into the base image all of the php extension packages for that version of php. And I totally don't want to do that as the images would balloon in size.

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

Successfully merging a pull request may close this issue.

7 participants