Friday, January 15, 2010

Method 'post' of object 'IOWSPostData' failed

I came across this curious error today. This error pops up when a user (Office 2007) wants to import a spread sheet into a custom list (SharePoint 2007).

Further investigation (Google) revealed that it is a macro inside Office 2007 that is causing the problem. Exactly why, I don't know. But here is my work around, use at your own risk ;-).

Make a backup of the file and edit the file in "C:\Program Files\Microsoft Office\Office12\1033\EXPTOOWS.XLA" (with Excel):

1. Open the file with Excel
2. Press F11
3. Locate the following code:
....
aTarget(iPublishDesc) = Title
lVer = Application.SharePointVersion(URL)
End Sub
....
4. Insert right after: lVer = Application.SharePointVersion(URL)
the following line: lVer = 3
5. Save the file EXPTOOWS.XLA

Make sure you overwrite the file.

That's it! Anyone welcome to leave a comment as to why this happens, or what the consequences would be if you edit the EXPTOOWS.XLA file.

Tuesday, November 10, 2009

Moving Site Collections between Content Databases

I recently had to move a lot of site collections between content databases. The reason is that we don't want content databases to exceed 100GB. We have quota system in place where each site collection has a quota specified.

I did some planning to ensure that the total size of a content database do not exceed 100GB by summing all the quotas of the site collections. i.e. More content databases were created.

There are a lot of blogs out there to move site collections and I am not going to duplicate that. Just a little something I learned along the way.

Make sure there is enough disk space for the move. In other words ensure the drive the log file for the originating content database and the target content database has enough space. If the site collection is 20GB make sure you have 25GB disk space each for the LOG's and another 25GB for the target content database.

If you don't have enough disk space the process will fail. This is what happened to me. But, I then made sure there is adequate disk space for the move. And then the process failed because the Site collection already exists in the target content database. I never cleaned up the previous attempt's writing to the content database.

I then made matters worse by using stsadm -o deletesite -siteid -databasename . I wanted to delete the orphan site in the target content database. Not knowing that the command will remove the site collection out of the configuration.

So now the original content database had the orphan site collection. Luckily this can be fixed easily enough.

stsadm -o deletecontentdb -databasename -url
stsadm -o addcontentdb -databasename

The addcontentdb command forces SharePoint to remap all the site collections in the content database. So the data was never deleted, it was just "lost", or an orphan.

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.
i.e.

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.