Articles in this section

Cannot apply PHP Settings or PHP service is down: cannot get uid for user 'john.doe'

Plesk for Linux kb: technical

Symptoms

  • Unable to apply PHP Settings:

    Error: phpinimng failed: configuration test '['/opt/plesk/php/8.2/sbin/php-fpm', '--test']' failed with code 78, and message:
    ERROR: [pool example.com] cannot get uid for user 'john.doe'
    ERROR: FPM initialization failed

  • One or more PHP-FPM service(s) is down and cannot be started with the following errors at the end of journalctl -u plesk-php82-fpm.service output:

    ERROR: [pool example.com] cannot get uid for user 'john.doe'
    ERROR: FPM initialization failed

  • Under /var/log/plesk-php**-fpm/error.logyou see the following:

    ERROR: [pool example.com] cannot get uid for user 'john.doe'
    ERROR: FPM initialization failed

Cause

Intermediate mysqld or sw-engine processe(s) outage during subscription's system user rename procedure. For example, caused by OOM.

Resolution

There is intension to improve Plesk Repair in current development version 18.0.61 
https://webpros.atlassian.net/browse/PPP-64844
  1. Connect to the server via SSH.
  2. Find the absent user(s) mentioned in PHP-FPM pool configurations:

    # grep user * /opt/plesk/php/*/etc/php-fpm.d | cut -d= -f2 | tr -d ' ' | while read -r user; do id "$user" >/dev/null; done
    id: john.doe: no such user
    id: jane.doe: no such user

  3. Find the configuration files with these mentions:

    # grep -rin 'john.doe|jane.doe' /opt/plesk/php/*/etc/php-fpm.d
    ...
    /opt/plesk/php/8.1/etc/php-fpm.d/example.com.conf:11:[example.com]
    ..
    /opt/plesk/php/8.2/etc/php-fpm.d/example.net.conf:11:[example.net]
    ...

  4. Create a backup of the file to be safe:

    # cp -p /opt/plesk/php/8.2/etc/php-fpm.d/example.com.conf /opt/plesk/php/8.2/etc/php-fpm.d/example.com.conf.bak

  5. Remove the found files:

    # rm -rf /opt/plesk/php/8.1/etc/php-fpm.d/example.com.conf /opt/plesk/php/8.2/etc/php-fpm.d/example.net.conf

  6. Log in to Plesk.
  7. For each domain, go to Domains > example.com > PHP Settings, change some setting and click Apply to recreate configuration file. Revert the setting, if necessary.

    Note: if there are too many domains, run the following to update the settings for all domains at once (might be a long process):

    # plesk bin php_settings -u

Note: In case that the issue persists try running the repair command for each affected domain like plesk repair web -y example.com

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.