none
Corrupt library - file invisible in designer and cant be deleted from web RRS feed

  • Question

  • I have a file in a library which I cannot delete or open from the web.  Whenever I try to do anything with it (view its history/check it out/delete it) I get one of a number or errors raised, (mainly access denied errors).  If I try to open it I get the browser's blank "the website cannot display this page" error (not sharepoint generated)

    I cannot overwrtite it or rename it either so I am stuck with it.

    When I look at the folder containing the file in sharepoint designer the file in question is not shown so I cant delete it from there.  I am therefore stuck with it! 

    I dont need to recover the file - I have another copy locally.  I just want to get rid of it so I can replace it with a version that works.

    Do I need to go behind the scenes and delete it from the content database perhaps?

    Any thoughts?

    Dave.


    • Edited by Dave Dixson Thursday, March 28, 2013 12:33 PM
    Thursday, March 28, 2013 12:33 PM

All replies

  • If you want to try deleting it outside of the GUI, try it with a PowerShell Script rather than attempting to remove it from the database directly.  Using the Add-SPShellAdmin to grant access rights to the respective content database prior to a deletion script should help.

    Outside of that, is it safe to assume that you're using SharePoint 2010?  If so, I'd check/ask the following: -

    1. Is record declaration turned on?  If so, you may be trying to delete a record?
    2. Can you also pull some of the error text from the hive/14 logs and paste them here.
    3. What is the file?  Is it a standard office document?

    Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/

    • Proposed as answer by rbsp2k2 Friday, September 8, 2017 6:03 PM
    Thursday, March 28, 2013 1:15 PM
    Answerer
  • Hi Steven - thanks for your help.

    I have been unable to find the record declaration setting  - I have not switched it on intentially - what is it?  I have looked through the library settings and site features but can find no mention of it

    It is a simple word document.  I get very little info in the error log...

    Unknown SPRequest error occurred. More information: 0x80070005
    <nativehr>0x80070005</nativehr><nativestack></nativestack>
    <nativehr>0x80070005</nativehr><nativestack></nativestack>

    Although I am able to delete other items in same folder he library using the following code

    $site = new-object Microsoft.SharePoint.SPSite("http://test.tomdaly.com") # is a legit url
    $relweburl = '/Docs"
    $web = $site.openweb($relweburl)
    $list=$web.Lists["testList"] $listItems = $list.Items
    $listItemsTotal = $listItems.Count

    for ($x=$listItemsTotal-1;$x -ge 0; $x--)
    {
    if($listItems[$x].name.Contains("3"))
    {
    Write-Host("DELETED: " + $listItems[$x].name)
    $listItems[$x].Delete()
    }
    }

    This works for other files in the same folder but when I try to run this against the file in quesiton it fails with the follwoing error...

    You cannot call a method on a null-valued expression.
    At line:3 char:32
    + if($listItems[$x].name.Contains <<<< ("Execution Only Procedures 0609"))
        + CategoryInfo          : InvalidOperation: (Contains:String) [], RuntimeExcepti
       on
        + FullyQualifiedErrorId : InvokeMethodOnNull
     
    Exception calling "Delete" with "0" argument(s): "<nativehr>0x80070005</nativehr><nat
    ivestack></nativestack>"
    At line:6 char:22
    + $listItems[$x].Delete <<<< ()
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException

     

    Thursday, March 28, 2013 2:03 PM
  • I had the same issue, but in my case was about an orphaned document.

    After I fix the database from Central Admin, the ghost/orphaned document was deleted.

    Regards,

    Thursday, September 7, 2017 12:29 PM