cannot get uid for user critical
PHP-FPM: cannot get uid for user '...' — FPM initialization failed
PHP-FPM won't start because a pool's user/group references a system account that no longer exists.
What you see
[15-Jun-2026 09:12:04] ERROR: [pool example.com] cannot get uid for user 'example_usr' [15-Jun-2026 09:12:04] ERROR: FPM initialization failed php-fpm.service: Failed with result 'exit-code'.
What’s actually happening
php-fpm refuses to start and the whole service dies — not just one pool. systemctl status php-fpm (or php8.2-fpm) shows it failed, and the FPM log names the pool and the missing user. Because one bad pool aborts initialization, every PHP site on the box goes down, typically surfacing as 502 Bad Gateway from nginx or 503 from Apache. The process exits with status 78 (configuration error). It almost always lands right after a cPanel/Plesk account got deleted or a system user was renamed.
Common causes
- A pool's user= or group= points at an account that was deleted (a removed cPanel/Plesk subscription leaving its pool .conf behind).
- A system user was renamed but the FPM pool file still has the old name.
- The pool .conf was copied from another server where that user existed.
- A typo in user= / group= that doesn't match any line in /etc/passwd.
- A migration or restore recreated pool configs before the corresponding users were recreated.
How to fix it
- Find which pool names a missing usergrep -rEn '^(user|group)' /etc/php-fpm.d/ (Debian/Ubuntu: /etc/php/8.2/fpm/pool.d/). For each value, check id <username>; the one that returns 'no such user' is your culprit.
- Point the pool at a valid userEdit the offending .conf and set user= and group= to an account that exists (id confirms it). For a real site, that's its proper owner; for a leftover, often the panel's default. Then sudo systemctl restart php-fpm.
- Remove the pool if the account is genuinely goneIf the site was deleted and the pool is an orphan, delete or rename its .conf out of the pool directory (mv example.com.conf example.com.conf.disabled), then restart FPM. Don't leave dead pools around — they re-break the service on the next restart.
- Recreate the user if it should existIf the account was removed by mistake, recreate it: sudo useradd -M -s /usr/sbin/nologin example_usr (match the original uid/gid and home if other files depend on them), then restart FPM.
- Validate config and restart cleanlysudo php-fpm -t (or php-fpm8.2 -t) returns 'configuration file test is successful'. Then sudo systemctl restart php-fpm and confirm with systemctl status that it's active, not exit-code 78.
Stop it recurring
When deleting or renaming a hosting account, remove or update its PHP-FPM pool config in the same step so no pool points at a vanished user.
Related errors