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

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

book

Article ID: 335095

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:
  • Scanning host fails with error using VUM
  • Cannot run upgrade script on host | UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 273: ordinal not in range(128)
vmware-vum-server-log4cpp.log :
[2020-04-24 09:36:56:835 '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 = "" }
[2020-04-24 09:36:56:835 'VciScanTask.ScanTask{406}' 140312896878336 INFO]  [vciTaskBase, 1621] Description updated
[2020-04-24 09:36:56:852 'VirtApplianceManager' 140313547577088 INFO]  [virtApplianceMgr, 1805] VADiscoveryTimerHandler: scheduled timer triggered
[2020-04-24 09:36:56:852 '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

2020-04-24T07:59:06.494Z info vua[A9DDB70] [Originator@6876 sub=VUA] Command '/tmp/vuaScript-QGBDig/precheck.py --ip=172.18.224.238' 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

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 is an invalid character.

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

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 .