Wednesday, October 21, 2009

Error Deleting Site Collection

When trying to delete a site collection, the following error pops up:

Command: stsadm -o deletesite -url http://servername/sites/sitename
Error: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)

An error like this prevents you from upgrading SharePoint aswell, because you won't be able to access the site collection either. I found out the hard way.

To resolve the error, detach and attach the content database of the afflicted site collection.

stsadm -o deletecontentdb -databasename wss_content_name -url http://servername

stsadm -o addcontentdb -databasename wss_content_name -url http://servername

Friday, October 16, 2009

The resource cannot be found.

A user was complaining that he can't create a library or a list on his sub site. The library was indeed created, but when the user navigated to the library, i.e. /sites/sitename/listname/forms/allitems.aspx, then the error displayed was:

Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /xxxx/sitename/listname/forms/AllItems.aspx

This was strange, since the library was successfully created, and you could navigate to the library with SP Designer or with Site Settings -> Content and Structure. Looking into the ULS Logs showed that the site was configured to use a master page that did not exist anymore, e.g.

10/16/2009 11:25:00.34 w3wp.exe (0x10B0) 0x1920 Windows SharePoint Services General 8nca Verbose Application error when access /sites/sitename/listname/Forms/AllItems.aspx, Error=The file /sites/sitename/sitename/sitename/sitename/_catalogs/masterpage/default.master does not exist. at Microsoft.SharePoint.ApplicationRuntime.SPRequestModuleData.GetWebPartPageData(HttpContext context, String path, Boolean throwIfFileNotFound) at Microsoft.SharePoint.ApplicationRuntime.SPVirtualFile.CalculateFileDependencies(HttpContext context, SPRequestModuleData basicRequestData, ICollection& directDependencies, ICollection& childDependencies) at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.EnsureDependencies(HttpContext context, SPRequestModuleData requestData) at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.EnsureCacheKeyAndViewStateHash(HttpContext context, SPRequestModuleData re...

Navigate to Site Settings -> Master Page, will reveal the error as well, e.g.

The system master page setting currently applied to this site is invalid. Please select a new master page and apply it.

Fixed easily enough by choosing a valid master page.