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

PHP-FPM 8.3 child exited with code 70 #479

Closed
aloz77 opened this issue Jan 14, 2024 · 3 comments
Closed

PHP-FPM 8.3 child exited with code 70 #479

aloz77 opened this issue Jan 14, 2024 · 3 comments

Comments

@aloz77
Copy link

aloz77 commented Jan 14, 2024

After upgrading to PHP 8.3 PHP-FPM can't run with snuffleupagus enabled.

  • No issues with PHP 8.3 without snuffleupagus enabled
  • No issues with PHP 8.2 with snuffleupagus enabled.
# tail /var/log/php8.3-fpm.log
[14-Jan-2024 02:03:14] NOTICE: fpm is running, pid 2750186
[14-Jan-2024 02:03:15] NOTICE: ready to handle connections
[14-Jan-2024 02:03:15] NOTICE: systemd monitor interval set to 10000ms
[14-Jan-2024 02:03:15] WARNING: [pool www] child 2750188 exited with code 70 after 0.281764 seconds from start
[14-Jan-2024 02:03:15] NOTICE: [pool www] child 2750397 started
[14-Jan-2024 02:03:15] WARNING: [pool www] child 2750189 exited with code 70 after 1.057567 seconds from start
[14-Jan-2024 02:03:15] NOTICE: [pool www] child 2750399 started
...

snuffleupagus was rebuilt as follows.

rm snuffleupagus/ -Rf
git clone https://github.com/jvoisin/snuffleupagus
cd snuffleupagus/src
phpize
./configure --enable-snuffleupagus
make
make install
# tail /etc/php/8.3/fpm/php.ini -n 3
extension=snuffleupagus.so
sp.configuration_file=/etc/php/8.3/snuffleupagus.ini

# cat /etc/php/8.3/snuffleupagus.ini
sp.global.secret_key("***");
sp.harden_random.enable();
sp.disable_xxe.enable();
# phpize -v
Configuring for:
PHP Api Version:         20230831
Zend Module Api No:      20230831
Zend Extension Api No:   420230831

What could be the issue or how to debug?

@jvoisin
Copy link
Owner

jvoisin commented Jan 14, 2024

70 is "internal server error". Is there anything in webserver's logs? If not, you might want to increase the verbosity of php-fpm's logs.

@aloz77
Copy link
Author

aloz77 commented Jan 15, 2024

Yes, the web log shows this issue:

2024/01/15 04:15:21 [error] 3453566#3453566: *1053618 FastCGI sent in stderr: "PHP message: PHP Fatal error:  [snuffleupagus][0.0.0.0][config][log] Invalid configuration file in Unknown on line 0" while reading response header from upstream, client: 127.0.0.1, server: _, request: "GET /php-fpm-status?full&json HTTP/1.1", upstream: "fastcgi://127.0.0.1:9003", host: "localhost"
2024/01/15 04:15:21 [error] 3453566#3453566: *1053618 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 127.0.0.1, server: _, request: "GET /php-fpm-status?full&json HTTP/1.1", upstream: "fastcgi://127.0.0.1:9003", host: "localhost"

The issue disappear after taking the config file from https://github.com/jvoisin/snuffleupagus/blob/master/config/default_php8.rules

However I don't know what in my config file was causing the issue.

@jvoisin
Copy link
Owner

jvoisin commented Jan 15, 2024

$ cat src/tests/regressions/issue_479.out 
PHP Fatal error:  [snuffleupagus][0.0.0.0][config][log] Unexpected keyword 'disable_xxe' on line 3 in Unknown on line 0

Fatal error: [snuffleupagus][0.0.0.0][config][log] Unexpected keyword 'disable_xxe' on line 3 in Unknown on line 0

Fatal error: [snuffleupagus][0.0.0.0][config][log] Invalid configuration file in Unknown on line 0
$

You should replace disable_xxe with xxe_protection, I just pushed 8ea689e to prove it :)

jvoisin added a commit that referenced this issue Jan 15, 2024
@jvoisin jvoisin closed this as completed Jan 16, 2024
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

No branches or pull requests

2 participants