Symptoms
When adding an FTP account you encounter a warning
The system failed to edit the user:
The <abbr title="File Transfer Protocol">FTP</abbr>
user <username> at the domain domain.tld already exists.
In the cPanel error log, you'll see something like this:
Entry for cptest missing in /etc/shadow at
/usr/local/cpanel/Cpanel/PwCache/Helpers.pm
line 30.\n\tCpanel::PwCache::Helpers::cluck
(\"Entry for cptest missing in /etc/shadow\")
called at /usr/local/cpanel/Cpanel/PwCache.pm line
Description
When adding a new user for the FTP accounts, you may encounter a warning that the user already exists. Be sure to check the "User Manager" section of the cPanel interface as well as the FTP Accounts for the accounts previously created as it may be listed in one, but not both.
Workaround
If this warning occurs, you'll need to verify the user name is part of /etc/passd and /etc/shadow. You can use 'grep' from the command line to search these files. As an example:
grep cptest /etc/passwd /etc/shadow
To quickly check for a list of the users reported in the error log, you can run the following to list the users that are reported missing from the /etc/shadow and or /etc/passwd file:
grep "Cpanel::PwCache::Helpers::cluck" /usr/local/cpanel/logs/error_log |awk '{print $3, $4, $5, $6}' |sort |uniq -c |sort -n
If the users are missing, you'll need to restore the files from backups, or manually readd the users to the files using. If you enabled cPanel backups and enabled System Backups, /etc/passwd and /etc/shadow will be present and can be used to restore the missing users.
Comments
0 comments
Article is closed for comments.