There is a bug in SharePoint 2010 that can cause an entire site collection to become corrupt which can only be fixed by restoring a backup. This issue is only likely to occur with code in custom solutions as the equivalent manual actions through the web interface do not cause the same issue, therefore general SharePoint use is not affected.
When does the issue occur?
When using the SharePoint Object Model or PowerShell to programmatically set permissions on a sub site (SPWeb) by first breaking role inheritance.
At this point the site collection will be fine, however if you then create a List or Document Library you will notice that the permissions won’t be inherited as they usually are. If you select to then inherit the permissions from the parent sub site (SPWeb) the site and any other content in the site collection including system pages will not be accessible. The server will throw a HTTP 500 error and will not give any specific reason in the Event Log or the ULS logs.
- PowerShell commands cannot be run on the Site Collection
- No administrative functions can be carried out on the Site Collection through Central Admin
- Details for the site collection cannot be viewed through central admin
- Access to the settings or data through the SharePoint API will not be possible
- Any sites or sub-sites in the collections will not be accessible
As of 20th July 2012, we are un aware of a fix having been released for this issue.