"An error occurred while starting service 'eam'" | AttributeError: 'NoneType' object has no attribute 'replace'
search cancel

"An error occurred while starting service 'eam'" | AttributeError: 'NoneType' object has no attribute 'replace'

book

Article ID: 315458

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

Symptoms:

Starting EAM service fails immediately :

Service-control failed. Error: {
    "detail": [
        {
            "id": "install.ciscommon.service.failstart",
            "translatable": "An error occurred while starting service '%(0)s'",
            "args": [
                "eam"
            ],
            "localized": "An error occurred while starting service 'eam'"
        }
    ],
    "componentKey": null,
    "problemId": null,
    "resolution": null
}

 

vmon.log :
2023-05-17T02:45:48.109Z In(05) host-10283 Received start request for eam
2023-05-17T02:45:48.109Z In(05) host-10283 <eam-prestart> Constructed command: /usr/bin/python -B /usr/lib/vmware-eam/watchdog/vmon/sequenceExecutor.py NO_OP /usr/bin/python 2 -B /usr/lib/vmware-eam/watchdog/update_pnid.py /usr/bin/python 2 -B /usr/lib/vmware-eam/watchdog/update_feature_states.py /usr/bin/python 2 -B /usr/lib/vmware-eam/watchdog/adjust_tomcat_logging.py
2023-05-17T02:45:48.265Z Wa(03) host-10283 <eam> Service pre-start command's stderr: Traceback (most recent call last):
2023-05-17T02:45:48.265Z Wa(03)+ host-10283   File "/usr/lib/vmware-eam/watchdog/update_pnid.py", line 56, in <module>
2023-05-17T02:45:48.265Z Wa(03)+ host-10283     main()
2023-05-17T02:45:48.265Z Wa(03)+ host-10283   File "/usr/lib/vmware-eam/watchdog/update_pnid.py", line 41, in main
2023-05-17T02:45:48.265Z Wa(03)+ host-10283     vcUri = vcUriTemplate.replace(VC_HOSTNAME_PATTERN, pnid)
2023-05-17T02:45:48.265Z Wa(03)+ host-10283 AttributeError: 'NoneType' object has no attribute 'replace'
2023-05-17T02:45:48.265Z Wa(03)+ host-10283
2023-05-17T02:45:48.285Z Er(02) host-10283 <eam> Service pre-start command failed with exit code 1.

Environment

VMware vCenter Server 7.0.x

Cause

This issue can happen if the eam-vim.properties file is corrupted or not properly formatted. 

Files Path: /etc/vmware-eam

  • eam-vim.properties
  • Also validate if features.properties has similar issue.

Resolution

NOTE: Before performing any of these tasks, please take a powered-off snapshot of your vCenter Server Appliance VM. 

To resolve this issue, update the eam-vim.properties file by following the steps below within the /etc/vmware-eam directory:

  1. Recreate the required files from a lab environment or an alternate vCenter instance in the customer’s environment.
  2. Retrieve the necessary details:
    • Identify the vCenter Fully Qualified Domain Name (FQDN): This needs to be updated in the eam-vim.properties file.
      • hostname -f
    • Identify the Machine ID: This also needs to be updated in the eam-vim.properties file.
      • /usr/lib/vmware-vmafd/bin/vmafd-cli get-machine-id --server-name localhost

If the files are corrupted, delete the existing "eam-vim.properties" file and recreate it using the vi editor: (How to use vi edit command)

  1. vi eam-vim.properties
  2. Ensure the file follows the format below, updating the vCenter FQDN and Node ID with the machine-id identified in the previous steps. 
    1. #########################################################################
      # Copyright 2013-2019 VMware, Inc.  All rights reserved. VMware Confidential
      #########################################################################
      # VC location
      vc.proxy.host=localhost
      vc.proxy.port=80
      vc.tunnelSdkUri.template=https://##{VC_HOST_NAME}##:8089/sdk/vimService
      vc.tunnelSdkUri=https://<vCenter Fully Qualified Domain Name>/sdk/vimService
      # VC SSL trust
      vc.truststore.type=VKS
      vc.truststore.storename=TRUSTED_ROOTS
      # EAM location
      # Hostname or IP of the EAM server
      # Fill only if EAM is not running on the same host as VC
      eam.host=<vCenter Fully Qualified Domain Name>
      # EAM AuthN
      #
      eam.keystore.type=VKS
      eam.keystore.storename=vpxd-extension
      eam.key.alias=vpxd-extension
      # LookupService
      ls.url=https://<vCenter Fully Qualified Domain Name>/lookupservice/sdk
      ls.node.id=xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxx
      ############################################################################
      #
      # The data below is used by not-eam-vim beans hence is going to be moved out
      #
      ############################################################################
      # Port and scheme configuration which is used by the ESX 6.x hosts to reach EAM Vib
      # file server.
      eam.ext.port=443
      eam.ext.scheme=https
      # Port and scheme configuration which is used by the ESX 5.x hosts to reach EAM Vib
      # file server.
      eam.ext.port.deprecated=80
      eam.ext.scheme.deprecated=http
      drs.demandCapacityRatio=100
  • If the files are recreated, ensure they have the correct permissions using the following commands:
    • chmod 664 eam-vim.properties  
      chmod 664 features.properties  
  • After setting the appropriate permissions, start the EAM service:
    • service-control --start vmware-eam