While restoring a cPanel account, I encountered the following error.
“Account Creation Status: failed (Sorry, a passwd entry for that username already exists.)”
Please check for entries of that usernames in the following files and if there is any, remove those entries.
/var/cpanel/databases/users.db
/etc/dbowners
It did the trick for me. After removing these entries, execute the following command.
userdel -f username
This will also fix the error, “Account Creation Status: failed (Sorry, a mysql user with the name already exists”