Site Collection Removal Error: System.IO.DirectoryNotFoundException

While creating a new site collection using the Central Administration page, we encountered an error whilst waiting for the “Processing…” window to complete. Fair enough, we looked at the logs, fixed the issue and tried the whole process again.

Seems that in the previous action, a site collection reference already has been created somewhere in the web application configuration. Although there’s a reference, the necessary files to render the page aren’t there. There’s also no possibility to remove the existence of the site collection. When you try to do something with the site collection, for example try to delete it, you always get the following exception:

System.IO.DirectoryNotFoundException, <nativehr>0x80070003</nativehr><nativestack></nativestack>

One solution is to remove the content database, and recreate the content database and site collection with PowerShell. Using the GUI will break things again.

If that doesn’t work, I found 2 other workarounds for the problem:

  1. Delete the web application and recreate it. This is not a good solution, because you create downtime, lose managed paths, configuration, etc.
  2. When you encounter the error on the “Processing…” page, leave the window open to preserve your session. Fix the issue that shows up in the log, and simply hit F5 and use the same session. This will complete the creation process of the site collection and not throw any exception.
Advertisements

One thought on “Site Collection Removal Error: System.IO.DirectoryNotFoundException

  1. One more workaraound: detach the content database and then re-attach it. The empty site collections will no longer exist.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s