Cobra Forum

Plesk Panel => Others => Topic started by: mahesh on Jan 29, 2025, 07:30 AM

Title: Backup can not be restored in a Plesk server: useradd: Invalid configuration:
Post by: mahesh on Jan 29, 2025, 07:30 AM
Question
Backup can not be restored in a Plesk server: useradd: Invalid configuration: UID_MIN (10000), UID_MAX (9998)
Symptoms
Warning: Restore domain "example.com"
Execution of /opt/psa/admin/plib/api-cli/domain.php --update example.com -guid fd70d397-4e14-4c0e-a97d-ead226567c82 -creation-date 2019-09-28 -description '' -hosting true -hst_type phys -do-not-apply-skeleton -ip 192.0.2.2 -www-root httpdocs -login jdoe -passwd '' -passwd_type sym -hard_quota 0B -shell /bin/false -ignore-nonexistent-options failed with return code 1.
Stderr is
An error occurred during domain update: An error occurred during changing of hosting settings: System user update is failed: Unable to create system user: Unable to execute usermng: usermng: /usr/sbin/useradd execution failed:
useradd: Invalid configuration: UID_MIN (10000), UID_MAX (9998)
useradd: can't create user
usermng: Unable to add user: jdoe

Cause
The values in /etc/login.defs are set to create users with UID above 10000, when the MAX UID value is set to be 9998, which makes the configuration invalid and that must be corrected in order for the attempt to proceed.

Resolution
1. Log into your server via SSH
2. Edit the file /etc/login.defs file with your favorite command-line text editor and set UID_MIN, UID_MAX , GID_MIN and GID_MAX values on the system level as follows:

UID_MIN 1000
UID_MAX 60000
GID_MIN 1000
GID_MAX 60000
3. Save the changes and close the file

Retry taking the action during which this error appeared afterwards.