Unable to delete a document in a SharePoint Online document library - etag mismatch

John Ravas 26 Reputation points
2022-09-19T18:02:34.23+00:00

We have a metadata driven document library and we are unable to delete a file. When you attempt to delete the file, you receive this error message: The resource has changed since the caller last read it; usually an eTag mismatch. This document library also has a flow that we use to approve publishing a document.

I re-ran, successfully, the publishing flow - did not help
I deleted all drafts and versions of the file that I could thru Version history - did not help
Opening the file shows no one else editing the file
Was able to successfully rename the file
Confirmed no issue deleting other files in the library
Waited a day or two to see if any locks needed to be cleared - no help

Searching for an error like this did not return any results that are related to these circumstances.

Reviewing the history of the approval flow - as far back as the 28 days that is saved, I don't see an instance of the flow that is still running on that file.
What could be holding the file so it can't be delete.

Thanks in advance.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,728 questions
0 comments No comments
{count} votes

Accepted answer
  1. Emily Du-MSFT 41,946 Reputation points Microsoft Vendor
    2022-10-10T02:54:08.617+00:00

    @John Ravas

    I'm glad to hear you solve the problem ,if you have any issue about SharePoint, you are welcome to raise a ticket in this forum.

    By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others.". and according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:

    [Unable to delete a document in a SharePoint Online document library - etag mismatch]

    Issue Symptom:
    We have a metadata driven document library and we are unable to delete a file. When you attempt to delete the file, you receive this error message: The resource has changed since the caller last read it; usually an eTag mismatch. This document library also has a flow that we use to approve publishing a document.

    I re-ran, successfully, the publishing flow - did not help
    I deleted all drafts and versions of the file that I could thru Version history - did not help
    Opening the file shows no one else editing the file
    Was able to successfully rename the file
    Confirmed no issue deleting other files in the library
    Waited a day or two to see if any locks needed to be cleared - no help

    Searching for an error like this did not return any results that are related to these circumstances.

    Reviewing the history of the approval flow - as far back as the 28 days that is saved, I don't see an instance of the flow that is still running on that file.
    What could be holding the file so it can't be delete.

    Current status:
    I did find a way to delete the file. I disabled my custom publishing flow and manually published the file. This allowed me to delete it.
    You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community member's to see the useful information when reading this thread. Thanks for your understanding!


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Emily Du-MSFT 41,946 Reputation points Microsoft Vendor
    2022-09-20T02:33:48.69+00:00

    @John Ravas

    1.Whether this document library has lookup column? Or there is any lookup column refers to columns in this document library?

    2.Could you provide screenshots of the flow?

    3.You could try to delete a file through PowerShell.

    Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue  
    
    #Variables for processing  
    $WebURL = "https://intranet.crescent.com"  
    $ListName = "Documents"  
    $FileName="sharepoint databases v1.pptx"  
    
    #Get Web, List and List Item of the File  
    $Web = Get-SPWeb $WebURL  
    $List = $Web.Lists[$ListName]  
    $ListItem = $List.Items | Where {$_["Name"] -eq $FileName}  
    
    If($ListItem -ne $NULL)  
    {  
        #Delete the file  
        $ListItem.File.Delete()  
        Write-Host "File has been Deleted!" -f Green  
    }  
    else  
    {  
        Write-Host "File Not Found!" -f Yellow  
    }  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. John Ravas 26 Reputation points
    2022-10-05T12:38:46.97+00:00

    @Emily Du-MSFT thank you for reaching out. I did find a way to delete the file. I disabled my custom publishing flow and manually published the file. This allowed me to delete it.

    Thank you so much for your assistance with this issue.

    0 comments No comments