Error while deleting Site Collection

Aug 23, 2010 at 2:13 PM

Deletion of a sub-site is captured correctly however, deleting the Site Collection from CA or deleting the root site from the Site Settings page results in an Event Viewer error 6875. I have verified that the App Pool acct is member of WSS_ADMIN_WPG, WSS_RESTRICTED_WPG, and WSS_WPG local groups.

Log Name:      Application
Source:        Microsoft-SharePoint Products-SharePoint Foundation
Date:          8/23/2010 9:59:11 AM
Event ID:      6875
Task Category: General
Level:         Error
Keywords:     
User:          root
Computer:      foo
Description:
Error loading and running event receiver Microsoft.SharePoint.Site.RecycleBin.DeleteEventReceiver in Microsoft.SharePoint.Site.RecycleBin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=98e95e81f8e48206. Additional information is below.

: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-SharePoint Products-SharePoint Foundation" Guid="{6fb7e0cd-52e7-47dd-997a-241563931fc2}" />
    <EventID>6875</EventID>
    <Version>14</Version>
    <Level>2</Level>
    <Task>7</Task>
    <Opcode>0</Opcode>
    <Keywords>0x4000000000000000</Keywords>
    <TimeCreated SystemTime="2010-08-23T13:59:11.450Z" />
    <EventRecordID>10015</EventRecordID>
    <Correlation ActivityID="{23317EDF-F0DD-4EFA-8ED1-42998795FAC7}" />
    <Execution ProcessID="3572" ThreadID="7388" />
    <Channel>Application</Channel>
    <Computer>foo</Computer>
    <Security UserID="S-1-5-21-1078229911-1189946983-1225219381-658621" />
  </System>
  <EventData>
    <Data Name="string0">Microsoft.SharePoint.Site.RecycleBin.DeleteEventReceiver</Data>
    <Data Name="string1">Microsoft.SharePoint.Site.RecycleBin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=98e95e81f8e48206</Data>
    <Data Name="string2">: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex</Data>
  </EventData>
</Event>

Sep 2, 2010 at 6:46 PM

I am noticing the same error in my environment as well. A subsite is deleted and captured as expected. A top-level site deletion is registered in the RecycleBin log file as being requested, but never follows through with a success message as a subsite would. See below:

(2010:09:02 02:22:25.787): Entering SPWeb delete method on http://testsp/mjtest.
 Requested by user: ME\moconnell
(2010:09:02 02:22:29.238): Backup and delete of SPWeb http://testsp/mjtest completed successfully.
(above are entries for a subsite)

(2010:09:02 02:30:18.894): Entering SPSite delete method on http://testspwfe:8081.
 Requested by user:  ME\estepek
(above is an entry for a top-level site. No success message or bak file is ever generated)

A bak file was created for mjtest, however, one is never created for testspwfe. I'm ruling out a permissions on the backupfolder as it is working for a subsite. Please correct me if that is incorrect.

Sep 22, 2011 at 8:11 PM

I am having the same issue... no top level sites are backed up when deleted but subsites are... any ideas since your last post?

Sep 22, 2011 at 8:19 PM

The initial fear was someone deleting a top-level site collection. However, if there are subsites under that collection root, SharePoint will not allow the delete to occur. In this case, we had a number of subsites so the risk was mitigated because SharePoint will not allow a site collection with subsites to be deleted. I now use the SharePoint 2010 SP1 recycle bin, which works great. Up until the SP1 recycle bin, I would create a subsite in each site collection and lock it down to just admins but name it "Site Delete Prevention" so that I and they knew what it was and why it was there. Cheesy fix, I know, but if I wanted to use the tool and prevent someone killing a toplevel site, its was the best solution I came up with. Like I said before, I now use SP2010 SP1's recycle bin.

Hope that helps a bit.

E.

Sep 22, 2011 at 8:44 PM

Thanks for the quick reply, unfortunately we have 100's of site collections and I can't lock them down in the same way as you describe above.

I *DID* have this working for sites on this server but needed to add a new content database and now any  "top" sites deleted in that new content database are not captured as a *.bak file, only sub-sites. Weird huh?

I (like you) don't think this is a permissions issue as it is working for subsites. I also assume the solution is installed correctly or I would see no backup files at all. (I see sub-site backup files on delete as mentioned above.)

All I can figure is it's something to do with how the top sites in the new content database are registered in the configuration database...?

Sep 22, 2011 at 8:48 PM

It was a work around that probably fit only my needs. Take a look at moving to SP2010 SP1 and the new site recycle bin. Test, test, test before deploying though. All of my SP1 installs have been brand new... It does not look like this issue is going to be reviewed or fixed unfortunately.

Sep 23, 2011 at 1:10 PM

Cause of issue (now resolved) --> It was a database schema error on a new content database I had added...

see here --> http://social.msdn.microsoft.com/forums/en-US/sharepointdevelopment/thread/1e684588-da68-4932-8905-0a97bc327487