"Cannot run upgrade script on host | UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 273: ordinal not in range(128)" error while scanning host fails with error using VUM
search cancel

"Cannot run upgrade script on host | UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 273: ordinal not in range(128)" error while scanning host fails with error using VUM

book

Article ID: 335095

calendar_today

Updated On: 06-24-2025

Products

VMware vCenter Server

Issue/Introduction

  • Scanning host fails with error using VMware Update Manager. Getting the following error on the UI "UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 273: ordinal not in range(128)".

  • Following entries are observed in the log file -
    /var/log/vmware/vmware-updatemgr/vum-server/hostUpgrade/vmware-vum-server-logcpp.log :

[YYYY-MM-DD T HH:MM:SS 'VciScanTask.ScanTask{406}' 140312896878336 INFO]  [vciTaskBase, 1349] SerializeToVimFault fault: (integrity.fault.HostUpgradeRunScriptFailure)
 {    faultCause = (vmodl.MethodFault) null,     faultMessage = <unset>,     reason = ""    msg = "" } Converted fault: (vim.fault.ExtendedFault) {    faultCause = (vmodl.MethodFault) null,     faultMessage = <unset>,     faultTypeId = "com.vmware.vcIntegrity.HostUpgradeRunScriptFailure",     data = (vim.KeyValue) [       (vim.KeyValue) {          key = "faultCause",           value = ""       },        (vim.KeyValue) {          key = "faultMessage",           value = ""       },        (vim.KeyValue) {          key = "reason",           value = ""       }    ]    msg = "" }
[YYYY-MM-DD T HH:MM:SS 'VciScanTask.ScanTask{406}' 140312896878336 INFO]  [vciTaskBase, 1621] Description updated
[YYYY-MM-DD T HH:MM:SS 'VirtApplianceManager' 140313547577088 INFO]  [virtApplianceMgr, 1805] VADiscoveryTimerHandler: scheduled timer triggered
[YYYY-MM-DD T HH:MM:SS 'VciScanTask.ScanTask{406}' 140312896878336 INFO]  [vciTaskBase, 1362] VciTask { id: ScanTask{406}, type: com.vmware.vcIntegrity.ScanTask }: Setting VC task state to: error


VUA logs : This will be available under ESXi or under VUM logs : /var/log/vmware/vmware-updatemgr/vum-server/hostUpgrade

In this Example: The logs were under /var/log/vmware/vmware-updatemgr/vum-server/hostUpgrade

zcat vua-hostname.log.gz | less

YYYY-MM-DD T HH:MM:SS info vua[A9DDB70] [Originator@6876 sub=VUA] Command '/tmp/vuaScript-QGBDig/precheck.py' finished with exit status 1
--> stderr: --------
--> INFO:root:Running esxcfg-info
--> INFO:root:Running lspci
--> INFO:root:Running vmkfstools -P /vmfs/volumes/acdddb72-50b75987-ba60-30eaa5d4feb6
--> INFO:root:Reading /etc/shadow
--> INFO:root:Reading /etc/passwd
--> Traceback (most recent call last):
-->   File "/tmp/vuaScript-QGBDig/precheck.py", line 2353, in <module>
-->     sys.exit(main(sys.argv))
-->   File "/tmp/vuaScript-QGBDig/precheck.py", line 2311, in main
-->     init(product, version)
-->   File "/tmp/vuaScript-QGBDig/precheck.py", line 2088, in init
-->     systemProbe = SystemProbeESXi(version)
-->   File "/tmp/vuaScript-QGBDig/precheck.py", line 573, in __init__
-->     self.passwd = open('/etc/passwd').read()
-->   File "/build/mts/release/bora-13635690/bora/build/esx/release/vmvisor/sys-boot/lib64/python3.5/encodings/ascii.py", line 26, in decode
--> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 273: ordinal not in range(128)



Environment

VMware Update Manager 6.5

Cause

As per the above example, the script tries to read /etc/passwd file and fails with "UnicodeDecodeError error".

Resolution

Open an SSH session to the ESXi host and check the passwd file under /etc/passwd

Example:

[root@hostname:~] cat /etc/passwd
root:x:0:0:Administrator:/:/bin/sh
daemon:x:2:2:System daemons:/:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/:/sbin/nologin
dcui:x:100:100:DCUI User:/:/sbin/nologin
vpxuser:x:500:100:VMware VirtualCenter administration account:/:/bin/sh
DSX8029:x:1000:1000:Ibón Díaz:/:/bin/sh
DSX7689:x:1001:1001:Alfonso Pancorbo:/:/bin/sh
DSX7642:x:1002:1002:Ricardo Diaz-Meco:/:/bin/sh
DNX3761:x:1003:1003:Cesar Romero:/:/bin/sh


In the above output, we can see there are some invalid characters after the line "vpxuser:x:500:100:VMware VirtualCenter administration account:/:/bin/sh".

To resolve this issue, we need to edit /etc/passwd file and take out the lines which has the invalid characters or we can edit the file to have the default configurations like below. Make sure that we backup of the file before editing.

Edit the file with the command : vi /etc/passwd

root:x:0:0:Administrator:/:/bin/sh
daemon:x:2:2:System daemons:/:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/:/sbin/nologin
dcui:x:100:100:DCUI User:/:/sbin/nologin
vpxuser:x:500:100:VMware VirtualCenter administration account:/:/bin/sh


Once the changes are made, re-run the scan and it should be successful .