Image compliance scan fails during the vSphere Lifecycle Manager (vLCM) compliance check - "Error: com.vmware.vapi.std.errors.not_allowed_in_current_state Messages: com.vmware.esx.task.contention"
search cancel

Image compliance scan fails during the vSphere Lifecycle Manager (vLCM) compliance check - "Error: com.vmware.vapi.std.errors.not_allowed_in_current_state Messages: com.vmware.esx.task.contention"

book

Article ID: 451408

calendar_today

Updated On:

Products

VMware vSphere ESXi VMware vCenter Server

Issue/Introduction

  • In the vCenter UI, the image compliance scan fails and reports the "Host status is unknown". The reported error is the following:

    A failure occurred when starting a host compliance check operation on host <HOST FQDN>: Error: com.vmware.vapi.std.errors.not_allowed_in_current_state Messages: com.vmware.esx.task.contention<Another task is in progress. Please retry later.>

  • The vCenter /var/log/vmware/vmware-updatemgr/vum-server/vmware-vum-server.log  reports an error similar to the following:

    info vmware-vum-server[3521687] [Originator@6876 sub=Telemetry opID=########-####-####-####-############] [TelemetryManager 261] Sending telemetry data: {"@type":"pmanerrorreport","taskId":"########-####-####-####-############|########-####-####-####-############","entityId":"########-####-####-####-############|host-[MASKED MOID]","parentTaskId":"","errorMessageId":"com.vmware.vcIntegrity.lifecycle.HostScan.TaskApiError","errorMessage":"A failure occurred when starting a host compliance check operation on host '[FQDN]' : Error:\n   com.vmware.vapi.std.errors.notallowedincurrentstate\nMessages:\n   com.vmware.esx.task.contention\n","errorTime":"2026-07-24T12:36:58.321448Z"}

  • The host /var/run/log/settingsd.log reports that there is a sync file which is causing an error:

    Er(11) settingsd[2100603]: error [ConfigStore:6763dd3700 opId=8def8###############################] [_CheckTaskContention]: Task sync file exists and contains 'PRECURSOR: ########-####-####-####-############', 2 retries left

  • The host /var/vmware/lifecycle/lifecycle.task reports a 'PRECURSOR' task. The following is an example:

cat lifecycle.task
PRECURSOR: <########-####-####-####-############>

  • Running the following commands against the host /var/vmware/lifecycle/task-status.json.db file returns the details of a software scan that has not completed:

/usr/lib/vmware/sqlite/bin/sqlite3 task-status.json.db
SQLite version 3.34.1 2021-01-20 14:10:07
Enter ".help" for usage hints.
sqlite> SELECT * from tasks where task_id='<########-####-####-####-############>';
<########-####-####-####-############>|com.vmware.esx.settingsdaemon.software.scan||RUNNING|2026-07-10T09:31:58.003Z|2026-07-10T09:31:58.748Z|2026-07-10T09:31:58.748Z||0|100||||[]

Environment

  • VMware vSphere ESXi
  • VMware vCenter Server

Cause

  • The vLCM/Image Compliance is failing on each ESXi host because vCenter thinks the hosts are already executing another task when vCenter attempts to initiate the scan. This is due to a stale scan process on the local hosts lifecycle DB which never completes.

Resolution

  1. Move the files lifecycle.task, task-status.json and task-status.json.db from their current location on each host to another directory.
    mv /var/vmware/lifecycle/lifecycle.task /<NEW DIRECOTRY NAME>
    mv /var/vmware/lifecycle/task-status.json /<NEW DIRECOTRY NAME>
    mv /var/vmware/lifecycle/task-status.json.db /<NEW DIRECOTRY NAME>

  2. Restart the settingsd service on each of the hosts:
    /etc/init.d/settingsd restart

  3. Run a compliance scan to see if it is successful for that host.

Additional Information

List of similar KBs with different causes and resolutions: