Unable to fetch the cPanel user file

novatech

Member
Dec 31, 2005
12
0
151
When modifying a particular account under Modify Account, the following error occurs when saving:

"Unable to fetch the cPanel user file for username"

Any advice?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Please log into root SSH on the machine and do the following:

Code:
cd /var/cpanel/users
ls -lah username
cat username
Here replace username with the cPanel username. The correct permissions on the file should look like the following:

Code:
-rw-r-----  1 root username  596 Jun  8 14:03 username
Additionally, inside the file, the USER=username entry should have the username of that user. Some 3rd party plugins modify the username by appending .sometext to the end of the username. This can cause cPanel to be unable to read the user's file.

If the file does not exist at all, then there would be an issue. You can cat the contents of another user's file in that location to see what it looks like and then copy that to create a new file for that user, modifying the contents to correspond to the right settings for that user.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Was the username changed when transferring the account from one machine to another? I ask as we have an internal case (50545) about the USER= line not changing on transferring an account to a new machine even though everything else does change.

Please ensure to run this command as well now that you've corrected the USER= line in the /var/cpanel/users/username file:

Code:
/scripts/updateuserdomains
 

novatech

Member
Dec 31, 2005
12
0
151
The account was transferred from another cPanel box. I believe the username was changed on the old machine, and then moved. But it wasn't changed as part of the moving process.
 

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
938
21
168
Tristan, can you comment on why some plugins would change the details in the USER field? Do you know off hand which plugins do this? Today we had the same problem and it seems the username had been appended with some random text.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,608
79
458
cPanel Access Level
Root Administrator
Tristan, can you comment on why some plugins would change the details in the USER field? Do you know off hand which plugins do this? Today we had the same problem and it seems the username had been appended with some random text.
This may be due to a bug we are currently tracking down. Accounts that were transferred in the 11.24 era may have random data appended to the USER field.
 

rjbell4

Registered
Mar 23, 2010
3
0
51
I found this thread Googling for the same problem. I migrated some accounts from Plesk/Ensim. All those files have lines like "site7.3ZxffrK8JZKdAJXObKIWWCmYHmayK87O".

I'll correct all the usernames, and then run /scripts/updateuserdomains. That should be sufficient?
 

elmister

Active Member
Mar 2, 2004
35
1
158
I'm having the same issue, in this case it's a server thas was migrated from an older cPanel server. It's a cPanel to cPanel migration that was done 23th and 24th October 2010, i don't know the exact cPanel version but i know it had latest Release version, cPanel

Most or all accounts in that server are having this problem, editing manually each file doesn't seem confortable.

Note: After checking migration logs in /var/cpanel/logs i found the following

PHP:
<title>Web Host Manager 11.26.20 - Copy an account from another server</title>
 

crazyaboutlinux

Well-Known Member
Nov 3, 2007
939
1
66
Please log into root SSH on the machine and do the following:

Code:
cd /var/cpanel/users
ls -lah username
cat username
Here replace username with the cPanel username. The correct permissions on the file should look like the following:

Code:
-rw-r-----  1 root username  596 Jun  8 14:03 username
Additionally, inside the file, the USER=username entry should have the username of that user. Some 3rd party plugins modify the username by appending .sometext to the end of the username. This can cause cPanel to be unable to read the user's file.

If the file does not exist at all, then there would be an issue. You can cat the contents of another user's file in that location to see what it looks like and then copy that to create a new file for that user, modifying the contents to correspond to the right settings for that user.
i am also having the same issue, & this account was not transferred from another cPanel box
i did follow mentioned steps
-bash-3.2# cd /var/cpanel/users
-bash-3.2# ls -lah username
ls: username: No such file or directory
-bash-3.2# ls -lah xxxxx
-rw-r----- 1 root sglobal 666 Sep 9 17:54 sglobal
-bash-3.2# cat sglobal
# cPanel -- If you edit this file directly you must run /usr/local/cpanel/script
s/updateuserdomains afterwards to rebuild the system caches.
# If you edit MAX_EMAIL_PER_HOUR or MAX_EMAIL_PER_HOUR-[domain] you must run /us
r/local/cpanel/scripts/update_email_limits
BWLIMIT=2097152000
[email protected]
CONTACTEMAIL2=
DBOWNER=sglobal
DEMO=0
DNS=xxxxxxxxxxx.in
FEATURELIST=default
HASCGI=0
IP=69.xx.xxx.18
LANG=en
LOCALE=english
MAXADDON=0
MAXFTP=1
MAXLST=1
MAXPARK=0
MAXPOP=2
MAXSQL=1
MAXSUB=1
MTIME=1315524461
MXCHECK-xxxxxxxxxxx.in=0
OWNER=jinfo
PLAN=100MB_2pop
RS=x3
STARTDATE=1289823427
USER=yyyyyy
notify_disk_limit=
notify_email_quota_limit=
-bash-3.2#
 
Last edited:

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
The username (sglobal) for the file you opened is different than the USER= line in that same file:

Code:
USER=sunshine
Do you see how those don't match?
 

xtcweb

Member
Mar 19, 2010
6
0
51
had to edit quite a few of these files today.

all affected accounts were initially imported from ensim and probably moved from one cpanel server to another one in the meantime as well.

everything's fine now :)
 

AbsoluteZero

Member
Nov 20, 2003
6
0
151
Thread was a huge help. Thanks all. Just wanted to add a note to this for anyone having the same variant I was. I was getting this error message in the form:

Code:
Unable to fetch the cPanel user file for [I]username[/I].jFu8eBofRJWGD_cOgBNdwe8cBF1GItdh
Sure enough the cd /var/cpanel/users/[USERNAME] file had an entry:
Code:
USER=[I]username[/I].jFu8eBofRJWGD_cOgBNdwe8cBF1GItdh
As soon as this file was edited to delete the long alphanumeric string
Code:
USER=username
everything seems fine. I can't find any relationship between these particular accounts except they're some of the oldest on this server - some going back almost a decade - and I can't recall ever editing them through the WHM, so this could be an issue dating back many years - or perhaps to a previous server migration.