Cannot remove folder “SharePoint site name”

I recently ran into this issue while trying to move a series of sub-sites to site collections on a SharePoint farm. In order to achieve part of the process, I’d scripted the deletion of the sub-site tree using the stsadm –o deleteweb command once I’d exported it as there were quite a number of sub-sites and I wanted to try and save a little time.

I’d see the error message ‘cannot remove folder “sub-site name”’ for a couple of the sub-sites at a particular level, then the next couple might well be removed correctly, then more ‘cannot remove…’ errors.

To diagnose the issue a little more, I tried using the alternate options for the deleteweb stsadm command, namely

stsadm –o deleteweb –webid <sub-site ID> –databasename <content web application DB name> –databaseserver <DB server> -force

Note: To find a list of the sub-site IDs, run the following command:
stsadm –o enumallwebs –databasename <content web application DB name>
This will produce a list of all of the sub-sites including their URL and ID

Using the alternate options for the deleteweb stsadm command provided me with a lot more information on what the issue was that was stopping me from deleting some of the sub-sites.  In may case, the error shown was ‘The transaction log for database <DB name> is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases’.

Checking the autogrowth options for the log file for the content database in question did indeed show that the file size was limited to quite a small value. Increasing the autogrowth limit on the transaction log to a more reasonable size immediately got me up and running again.

3 Replies to “Cannot remove folder “SharePoint site name””

  1. Ran into similar issue – tried running -webid version of command and it let me know my transaction log was full. Enabled autogrowth and retried -webid version, worked fine. Went back to UI to delete other sites with similar issue – worked fine. I suppose the nearly immediate errors I was receiving should have been my first clue that i should look at my transaction logs… anyway, thanks for the posting. it was helpful.

Leave a Reply

Your email address will not be published. Required fields are marked *