Page MenuHomePhabricator

php7.2-fpm_check_restart should be resilient to php7adm error pages
Open, MediumPublic

Description

Today I found the following problem on two appservers:

elukey@mw1372:~$ sudo journalctl -u php7.2-fpm_check_restart | tail -n 3
Jun 26 09:58:06 mw1372 php7.2-fpm_check_restart[29658]: NOT restarting php7.2-fpm: free opcache 457 MB
Jun 26 09:58:07 mw1372 systemd[1]: php7.2-fpm_check_restart.service: Main process exited, code=exited, status=4/NOPERMISSION
Jun 26 09:58:07 mw1372 systemd[1]: php7.2-fpm_check_restart.service: Failed with result 'exit-code'.

I tried to copy the script to my home to add set -x, and I got more info:

APCU_FRAGMENTATION='parse error: Invalid numeric literal at line 1, column 10'

The main issue seems to be that php7adm may return an error page, that is not parsable by jq directly, ending up in return code of 4.