Unanswered Save Site As Template : Error copying temporary solution file to solutions gallery

  • Monday, June 20, 2011 2:52 PM
     
     

    Hi,

    Days ago I managed to save the top-level site as a template. But, now when I'm trying to do it again I receive this error:

    Server Error in '/' Application.


    Error copying temporary solution file to solutions gallery: _catalogs/solutions/t.wsp

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: Error copying temporary solution file to solutions gallery: _catalogs/solutions/t.wsp

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

     

    [InvalidOperationException: Error copying temporary solution file to solutions gallery: _catalogs/solutions/t.wsp]

       Microsoft.SharePoint.SPSolutionExporter.ExportWebToGallery(SPWeb web, String solutionFileName, String title, String description, ExportMode exportMode, Boolean includeContent, String workflowTemplateName, String destinationListUrl) +4365

       Microsoft.SharePoint.SPSolutionExporter.ExportWebToGallery(SPWeb web, String solutionFileName, String title, String description, ExportMode exportMode, Boolean includeContent) +44

       Microsoft.SharePoint.ApplicationPages.SaveAsTemplatePage.BtnSaveAsTemplate_Click(Object sender, EventArgs e) +331

       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115

       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140

       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29

       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

     

     

    Can anyone tell me where is the problem/ how to fix it ?

All Replies

  • Monday, June 20, 2011 3:04 PM
     
     
    Do you have a solution with the same name in the same gallery? It may not overwrite it if it is activated.
    AK
  • Tuesday, June 21, 2011 11:25 AM
     
     
    Hey AK,
    Thanks for the reply.

    No there  is no solution with the same name, there is no solution for the same site either.

     What else could it be ?
  • Thursday, June 23, 2011 7:16 AM
    Moderator
     
     

    Hi Hasan,

    Please go to Site Actions > Site Settings > Solutions to check whether the site had been saved or not. Sometimes, site had already saved though it came across the temporary solution file couldn’t copy issue.

    But to find the reason why this issue happened, we need to check the ULS log. Here is also a troubleshooting blog may help.
    http://blogs.msdn.com/b/manuj/archive/2010/06/09/error-copying-temporary-solution-file-to-solutions-gallery.aspx

    Best regards,
    Emir

  • Thursday, June 23, 2011 11:49 AM
     
      Has Code

    Hi Emir Liu,

    Thank you for your reply.

     

    Yes, it is saved as a solution, BUT, when I download it, upload it in a different site collection's solution gallery and try to activate it, I get this error (Name of the solution is "Ball.wsp"):

    Server Error in '/' Application.

    Name cannot begin with the '%' character, hexadecimal value 0x25. Line 2, position 2.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Xml.XmlException: Name cannot begin with the '%' character, hexadecimal value 0x25. Line 2, position 2.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [XmlException: Name cannot begin with the '%' character, hexadecimal value 0x25. Line 2, position 2.]
      System.Xml.XmlTextReaderImpl.Throw(Exception e) +95
      System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos) +5032439
      System.Xml.XmlTextReaderImpl.ParseElement() +667
      System.Xml.XmlTextReaderImpl.ParseDocumentContent() +429
      System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) +229
      System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +61
      System.Xml.XmlDocument.Load(XmlReader reader) +134
      System.Xml.XmlDocument.Load(String filename) +95
      Microsoft.SharePoint.Administration.SPUserCodeSolutionPackage.EnableSiteCollectionSolution(SPSite site, Int32 solutionGalleryItemId, Boolean force) +2157
      Microsoft.SharePoint.<>c__DisplayClass1.<AddOrUpgrade>b__0() +4075
      Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) +27488118
      Microsoft.SharePoint.SPUserSolutionCollection.AddOrUpgrade(SPListItem item, SPUserSolution existingSolution) +449
      Microsoft.SharePoint.SPUserSolutionCollection.Add(Int32 solutionGalleryItemId) +574
      Microsoft.SharePoint.WebControls.SolutionItemButton.ActivateItem() +398
      Microsoft.SharePoint.WebControls.SPLinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +72
      System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
      System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981
    

     

    Where can I find the ULS log? Is it in this directory :
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS 


    Thank you for your help.

     

  • Wednesday, April 25, 2012 6:37 PM
     
     

    Hi,

    This error maybe due to the fact that there is an event receiver that prevents changes in your site (for example: prevents items adding). Double check the features installed and deactivate the one that is enabling this event handler. Hope that helps.

  • Friday, August 03, 2012 1:39 PM
     
     
    I've found that sometimes the error shown in the original question appears when the size of the site you are trying to save as a template is too large. As a solution, see this post: http://www.cjvandyk.com/blog/Lists/Posts/Post.aspx?ID=284

    Stephen P. Kappel - Sharepoint Developer