“Cannot complete this action” error while saving site as template

Today while trying to save a site as template (through “Site Settings” > “Save Site as template” option under “Site Actions” section) it gave sharepoint error page saying “Cannot complete this action” and a correlation id.

Looking up in sharepoint’s log file for the given correlation id, it said:

SPSolutionExporter: Microsoft.SharePoint.SPException: Cannot complete this action. Please try again. ---> System.Runtime.InteropServices.COMException (0x80004005): Cannot complete this action. Please try again. at Microsoft.SharePoint.Library.SPRequestInternalClass.GetViewsSchemaXml(String bstrUrl, String bstrListName, Boolean bFullBlown, Boolean bNeedInitAllViews, ISP2DSafeArrayWriter p2DWriter, Int32& plDefaultViewIndex, Int32& plMobileDefaultViewIndex) at Microsoft.SharePoint.Library.SPRequest.GetViewsSchemaXml(String bstrUrl, String bstrListName, Boolean bFullBlown, Boolean bNeedInitAllViews, ISP2DSafeArrayWriter p2DWriter, Int32& plDefaultViewIndex, Int32& plMobileDefaultViewIndex)

Googled this and found the solution in one of msdn forum question. The problem was a corrupted list (“Team discussions” in my case).

The solution, such corrupted list cannot be deleted using sharepoint web interface, so deleted it using stsadm command as below:

stsadm.exe -o forcedeletelist -url http://myserver:8080/Lists/Team%20Discussion

Once the corrupted list was deleted, the template creation worked perfectly fine.

So the bottom line, if the site template creation gives error, then make sure that all your lists and libraries are in proper state and no one is in corrupted state.

Related Posts

1 COMMENTS

  1. Annoymous
    January 23, 2013 21:26 Reply

    nice article. That’s exactly what I was looking for.

Leave a reply