vCenter patching fails with the error "Invalid Type, Expected String, Instead got None Type"
search cancel

vCenter patching fails with the error "Invalid Type, Expected String, Instead got None Type"

book

Article ID: 378081

calendar_today

Updated On:

Products

VMware vCenter Server 7.0

Issue/Introduction

Symptoms:

  • You will see the below error in the VAMI page during the patch process: 


  • Checking Patchrunner.log under /var/log/vmware/applmgmt/
    2025-04-07 14:38:16,803.803Z vmidentity:Contract ERROR vmware_b2b.patching.executor.hook_executor Patch hook 'vmidentity:Contract' failed.
    Traceback (most recent call last):
      File "/storage/updatemgr/software-updateeb91vwh2/stage/scripts/patches/py/vmware_b2b/patching/executor/hook_executor.py", line 74, in executeHook
        executionResult = systemExtension(args)
      File "/storage/updatemgr/software-updateeb91vwh2/stage/scripts/patches/libs/sdk/extensions.py", line 106, in __call__
        result = self.extension(*args)
      File "/storage/updatemgr/software-updateeb91vwh2/stage/scripts/patches/libs/sdk/extensions.py", line 123, in _func
        return func(*args)
      File "/storage/updatemgr/software-updateeb91vwh2/stage/scripts/patches/payload/components-script/vmidentity/__init__.py", line 287, in contract
        raise e
      File "/storage/updatemgr/software-updateeb91vwh2/stage/scripts/patches/payload/components-script/vmidentity/__init__.py", line 283, in contract
        registerActiveDirectoryServiceWithLookupService()
      File "/storage/updatemgr/software-updateeb91vwh2/stage/scripts/patches/payload/components-script/vmidentity/__init__.py", line 234, in registerActiveDirectoryServiceWithLookupService
        raise e
      File "/storage/updatemgr/software-updateeb91vwh2/stage/scripts/patches/payload/components-script/vmidentity/__init__.py", line 231, in registerActiveDirectoryServiceWithLookupService
        dynVars=dynVars)
      File "/usr/lib/vmware-cm/bin/cloudvmcisreg.py", line 714, in cloudvm_sso_cm_register
        serviceId = do_lsauthz_operation(cisreg_opts_dict)
      File "/usr/lib/vmware/site-packages/cis/cisreglib.py", line 1185, in do_lsauthz_operation
        ls_obj.reregister_service(svc_id, svc_set_spec)
      File "/usr/lib/vmware/site-packages/cis/cisreglib.py", line 348, in add_securityctx_to_requests
        return req_method(self, *args, **kargs)
      File "/usr/lib/vmware/site-packages/cis/cisreglib.py", line 364, in reregister_service
        self.service_content.serviceRegistration.Set(svc_id, svc_set_spec)
      File "/usr/lib/vmware/site-packages/pyVmomi/VmomiSupport.py", line 595, in <lambda>
        self.f(*(self.args + (obj,) + args), **kwargs)
      File "/usr/lib/vmware/site-packages/pyVmomi/VmomiSupport.py", line 385, in _InvokeMethod
        return self._stub.InvokeMethod(self, info, args)
      File "/usr/lib/vmware/site-packages/pyVmomi/SoapAdapter.py", line 1570, in InvokeMethod
        raise obj  # pylint: disable-msg=E0702
    pyVmomi.VmomiSupport.lookup.fault.EntryNotFoundFault: (lookup.fault.EntryNotFoundFault) {
       dynamicType = <unset>,
       dynamicProperty = (vmodl.DynamicProperty) [],
       msg = '',
       faultCause = <unset>,
       faultMessage = (vmodl.LocalizableMessage) [],
       errorMessage = 'Entry with name serviceId: a8418672-2724-####-####-92ef94ab1f47 not found.',
       name = 'serviceId: a8418672-2724-####-####-92ef94ab1f47'
    }

Environment

VMware vCenter Server 7.0.x

Cause

This is caused due to a missing service on the vCenter Server 

Resolution

To fix this issue, we need to use the lsdoctor tool available at the KB below:

Using the 'lsdoctor' Tool

Once we have the tool installed on the vCenter we will run it with the "rebuild" option to rebuild the missing service registration. 

Important: Before doing changes  please make sure to take snapshots of the vCenter Server (Powered off snapshots if vCenter Servers are in Linked mode)

1. Run python lsdoctor.py -r

2. Select option 3 to to replace the individual service

        ========================

        0.  Exit
        1.  Generate a template.
        2.  Replace all services with new services.
        3.  Replace individual service.
        4.  Restore services from backup file.

        ========================

Please select an action: 3

 

3. Select the specific service registration which is missing.  The number for the activedirectory service here is 6. 

2025-04-10T09:33:57 INFO serviceSelect: Listing services...
2025-04-10T09:33:57 INFO serviceSelect: Got list of services.

[0] topologysvc
[1] certificatemanagement
[2] cis.cls
[3] com.vmware.vsphere.client
[4] cs.license
[5] phservice
[6] activedirectory
[7] cs.inventory
[8] trustmanagement
[9] sca
[10] infraprofile
[11] rbd
[12] cs.registry
[13] vsphereui
[14] vcha
[15] cs.vstats
[16] cs.vsm
[17] imagebuilder
[18] sms
[19] cs.ds
[20] client
[21] cs.vapi
[22] hvc
[23] vcenter.computepolicy
[24] cis.vlcm
[25] applmgmt
[26] tokenservice
[27] svcaccountmgmt
[28] vsan-health
[29] observability
[30] vcenterserver
[31] certificateauthority
[32] wcp
[33] cs.perfcharts
[34] cs.authorization
[35] vcenter.apigw
[36] cs.eam
[37] cs.keyvalue
[38] vsphereui-plugins
[39] cis.vmonapi

Select number: 6

 

4. Once completed, you should see a message with the ID of the newly registered service. 

2025-04-10T09:36:13 INFO unregisterServiceType: Unregistered 3e8af360-abc8-####-####-302d1f24923a
2025-04-10T09:36:13 INFO rebuild_single_service: Registered service: activedirectory with service ID: 3e8af360-abc8-####-####-302d1f24923a

 

5. Exit the application using option 0 and retry the update. 

        ========================

        0.  Exit
        1.  Generate a template.
        2.  Replace all services with new services.
        3.  Replace individual service.
        4.  Restore services from backup file.

        ========================

Please select an action: 0
2025-04-10T09:38:08 INFO menu: Exiting...

Additional Information

1. The missing service in this particular case was activedirectory 

2. If the lsdoctor tool mentions that the required templates are not present and provides a list of templates to select from , select the version that is closest to the build of your vCenter Server