When trying to delete a folder from the Datastore Browser, the error “Failed - Error caused by file [filepath]” occurs.
search cancel

When trying to delete a folder from the Datastore Browser, the error “Failed - Error caused by file [filepath]” occurs.

book

Article ID: 418707

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • When attempting to delete a file from the datastore browser in the Host Client, the following error occurs.
    Description
    Delete the source file or folder from the datastore

    State
    Failed - Error caused by file [filepath]
     
  • The delete task was executed from the Datastore Browser while a file lock was still in place, such as during an ongoing deletion process.

  • In the ESXi vmkernel logs for the host where the Delete Datastore File task was run, a “Lock failed” error like the following can be seen.
    YYYY-MM-DDTHH:MM:SS.ZZZZ cpu90:2101165 opID=[opid])Fil3: 5008: Lock failed on file: [File name] on vol '[Datastore Name]' with FD: <FD c37 r89>
     
  • It can be confirmed in hostd that processing is in the VM_STATE_DELETING state.

    YYYY-MM-DDTHH:MM:SS.ZZZZ info hostd[2101540] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/[File Path] opID=[opid] user=vpxuser:[SSO account]] State Transition (VM_STATE_OFF -> VM_STATE_DELETING)
    YYYY-MM-DDTHH:MM:SS.ZZZZ info hostd[2101540] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/[File Path] opID=[opid] user=vpxuser:[SSO account]] State Transition (VM_STATE_DELETING -> VM_STATE_GONE)

Environment

ESXi 8.0

Cause

The Delete Datastore File task fails because a file lock is still being held.

Resolution

  • Wait until the task holding the file lock completes.
  • identify the ESXi host that holds the file lock using the steps below, investigate the cause, and take corrective action.

Reference『Investigating Virtual Machine file locks on ESXi Host(s)』
https://knowledge.broadcom.com/external/article/314365