“cPanel & WHM update failure in upcp script” persists after forced update

Jim Ratliff

Member
Jan 1, 2018
18
3
3
Oakland CA
cPanel Access Level
Root Administrator
Subject: “cPanel & WHM update failure in upcp script” persists after forced update

I received an email from my server tonight that:
cPanel & WHM update failure in upcp script
Maintenance ended; however, it did not exit cleanly (256). Review the update logs to determine why the update failed.
I reviewed the log and the last activity before the Post Maintenance message was:
Code:
Processing: Updating plugins data cache
 - Processing command `/usr/local/cpanel/bin/refresh_plugin_cache`
 - Finished command `/usr/local/cpanel/bin/refresh_plugin_cache` in 0.016 seconds
95% complete
Anticipating next steps, I executed both:
Code:
yum update
/scripts/upcp --force
However, I once again got the same “cPanel & WHM update failure in upcp script” email from the server. The log showed that it once again got only as far as the refresh_plugin_cache command at 95% complete.

I assume this was unrelated, but I did discover something puzzling to me in the log: It's complaining that my hostname ("sierra") isn't valid, even though WHM never complained when I chose it to begin with:
Code:
Processing: Validating server hostname”, I see
   Processing: Validating server hostname
- Processing command `/usr/local/cpanel/scripts/check_valid_server_hostname --notify`
  [/usr/local/cpanel/scripts/check_valid_server_hostname] Changing hostname to sierra...Failed!
  [/usr/local/cpanel/scripts/check_valid_server_hostname]
  [/usr/local/cpanel/scripts/check_valid_server_hostname] sierra is not a valid hostname
  [/usr/local/cpanel/scripts/check_valid_server_hostname] Warnings were seen during rename:
  [/usr/local/cpanel/scripts/check_valid_server_hostname]
  [/usr/local/cpanel/scripts/check_valid_server_hostname] Please refer to RFCs 952 and 1123 to determine valid hostname.
- Finished command `/usr/local/cpanel/scripts/check_valid_server_hostname --notify` in 3.397 seconds
Any ideas on how to take it from 95% complete to 100% complete?

Thanks!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,226
463
Hello,

First, it looks like you need to update your hostname to a fully-qualified domain name (e.g. server.domain.tld) using "WHM >> Change Hostname". As far as the cPanel update error, could you run the command below and let us know the output?

Code:
awk '$4=="E"' /var/cpanel/updatelogs/update.xxxxxxxxxx.log
Thank you.
 

Jim Ratliff

Member
Jan 1, 2018
18
3
3
Oakland CA
cPanel Access Level
Root Administrator
Thanks! I entered:
Code:
awk '$4=="E"' /var/cpanel/updatelogs/update.xxxxxxxxxx.log
and got this response:

Code:
~ jim$ awk '$4=="E"' /var/cpanel/updatelogs/update.xxxxxxxxxx.log
awk: can't open file /var/cpanel/updatelogs/update.xxxxxxxxxx.log
 source line number 1
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,226
463
Hi Jim,

I apologize, I should have mentioned that you need to replace "update.xxxxxxxxxx.log" with the name of the most recent update log in the /var/cpanel/updatelogs/ directory.

Thank you.
 

Jim Ratliff

Member
Jan 1, 2018
18
3
3
Oakland CA
cPanel Access Level
Root Administrator
Thanks, Michael. This looks promisingly informative:
Code:
E    [/usr/local/cpanel/scripts/fixetchosts] The “/usr/local/cpanel/scripts/fixetchosts” command (process 10320) reported error number 255 when it ended.
E Post Maintenance ended, however it did not exit cleanly (256). Please check the logs for an indication of what happened
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,226
463
Hello,

That shows the cPanel update is failing when it attempts to run the following command:

Code:
/usr/local/cpanel/scripts/fixetchosts
Could you run that command manually after updating the server's hostname using "WHM >> Change Hostname" and let us know if it still fails?

Thank you.
 

Jim Ratliff

Member
Jan 1, 2018
18
3
3
Oakland CA
cPanel Access Level
Root Administrator
Thanks, Michael! I changed the hostname to a FQDN. Then I entered:
Code:
/usr/local/cpanel/scripts/fixetchosts
It immediately returned with no errors or anything else. I assume that means that the command worked.

Thanks, again. I appreciate your quick and on-target help!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,226
463
Hello,

You can also run the "/scripts/upcp" command to confirm the cPanel update process completes successfully. If this is a VPS on the OpenVZ/Virtuozzo platform, you may also want to review the following thread:

SOLVED - Hostname resets on reboot

Thank you.
 

Jim Ratliff

Member
Jan 1, 2018
18
3
3
Oakland CA
cPanel Access Level
Root Administrator
Michael, the "/scripts/upcp" command is still failing with an error for fixetchosts:
Code:
E    [/usr/local/cpanel/scripts/fixetchosts] The “/usr/local/cpanel/scripts/fixetchosts” command (process 6810) reported error number 255 when it ended.
E Post Maintenance ended, however it did not exit cleanly (256). Please check the logs for an indication of what happened
 

Jim Ratliff

Member
Jan 1, 2018
18
3
3
Oakland CA
cPanel Access Level
Root Administrator
Updating my last post…

For some reason, it's still complaining about my hostname. About 10 hours ago, I changed the hostname to a FQDN (sierra.mydomain.org) and I received a "Hostname change status" email confirming it:
The server recently changed hostname from “sierra” to “sierra.example.com”. As part of this change, a background task was launched to update the hostname in individual users' Horde databases. The outcome of this task was: Success.
Now however the log produced by "/scripts/upcp" still shows:
Code:
Processing: Validating server hostname
- Processing command `/usr/local/cpanel/scripts/check_valid_server_hostname --notify`
  [/usr/local/cpanel/scripts/check_valid_server_hostname] Changing hostname to sierra...Failed!
  [/usr/local/cpanel/scripts/check_valid_server_hostname]
  [/usr/local/cpanel/scripts/check_valid_server_hostname] sierra is not a valid hostname
  [/usr/local/cpanel/scripts/check_valid_server_hostname] Warnings were seen during rename:
  [/usr/local/cpanel/scripts/check_valid_server_hostname]
  [/usr/local/cpanel/scripts/check_valid_server_hostname] Please refer to RFCs 952 and 1123 to determine valid hostname.
- Finished command `/usr/local/cpanel/scripts/check_valid_server_hostname --notify` in 0.128 seconds
 
Last edited by a moderator:

Jim Ratliff

Member
Jan 1, 2018
18
3
3
Oakland CA
cPanel Access Level
Root Administrator
I re-changed the hostname and ran "/scripts/upcp" and this time it went through to 100% completion without complaining about the hostname. In WHM » Change Hostname, I've verified that the new/correct hostname has stuck. (Somehow it reverted previously.)

So… I think I'm fine now.