none
Error when accessing site settings

    Question

  • Hi,

    I have created a site template from one of my existing sites in my SharePoint 2010 environment and used that site template to create another sub site from the root. When I click on Site Actions > Site Settings I get an unexpected error.

    This is the only funny thing I could find in the log file and I'm not sure if it is related:

    07/19/2010 12:45:32.09  w3wp.exe (0x0A48)                        0x1754 SharePoint Foundation          Runtime                        tkau Unexpected System.Web.HttpException: Error executing child request for /Style Library/RMB.css.    at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)     at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm)     at ASP._controltemplates_topnavbar_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer)     at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)     at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)     at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter write... 129de6b1-c290-4f16-bb5c-984978acc44b
    07/19/2010 12:45:32.09* w3wp.exe (0x0A48)                        0x1754 SharePoint Foundation          Runtime                        tkau Unexpected ...r, ICollection children)     at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)     at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)     at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)     at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)     at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)     at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)     at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)     at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.RenderChildren(HtmlTextWriter writer)     at System.Web.UI.Page.Render(HtmlTextWriter writer)     at... 129de6b1-c290-4f16-bb5c-984978acc44b
    07/19/2010 12:45:32.09* w3wp.exe (0x0A48)                        0x1754 SharePoint Foundation          Runtime                        tkau Unexpected ... Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.Render(HtmlTextWriter writer)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 129de6b1-c290-4f16-bb5c-984978acc44b

    Does anyone have any idea as to what could be causing this kind of problem?

    Any help would be appreciated

    Thanks!

    Monday, July 19, 2010 10:51 AM

Answers

  • Ok so I found the cause and a temporary workaround for this problem after many hours of struggling and using site definitions instead of site templates. This also seems to only apply to sites that have Publishing features enabled. There are 3 main problems here...

    Firstly, in your site definition you have a property called AlternateCSSUrl which specifies your stylesheet e.g. /Style Library/Main.css. However, your site settings page doesn't access the CSS at http://servername/Style Library/Main.css as you think it would, instead it looks for the css at http://servername/_layouts/1033/Style Library/Main.css. So basically you can go create a folder called Style Library in the 1033 folder, copy the css in there and then change your onet.xml to have AlternateCSSUrl="Style Library/Main.css" and it should take the error away.

    Secondly, if you do this you would notice that now the physical contents of you CSS file is being written to the actualy page above all your site settings. I have no idea why this happens, but when you open that CSS file and remove all the contents the site settings page now works correctly.

    Thirdly, because the actual contents of the css are written to the page they are obviously not being applied and you have to go into your site settings and set the CSS of your site to point to your actual style sheet.

    I am still trying to figure out how to set the actual style sheet of the site in the definition but for now this is all I could find.

    • Marked as answer by Ghecko85 Monday, August 16, 2010 1:37 PM
    Monday, August 16, 2010 1:37 PM

All replies

  • Hi Ghecko85,

    Please modify the web.config for the web application, so that you can see the detailed error on screen.  You can do this by:

    Replacing:<customErrors mode="On" />

    with: <customErrors mode="Off" />

    And Replacing: CallStack="false"

    with: CallStack="true"

    After the above changes are done, please post the error message you see on the screen while accessing site settings.

    Monday, July 19, 2010 4:25 PM
  • Ok I did that and for some reason it does not show an error anymore, it goes to the settings page but nothing is displayed except for the masterpage elements. None of the setting page element are visible.

    I turned custom errors on again and the callstack off and now the error is back. I will investigate this and see if I can find something else.

    Tuesday, July 20, 2010 10:52 AM
  • Hi Ghecko,

    In the past when I've had this problem alterante access mappings fixed it up...

    Best regards,

    S'

    Tuesday, July 20, 2010 1:03 PM
  • Hi swirch,

    I'm not sure what you mean exactly with using alternate access mappings to fix this? Did you just map the complete site collection to another URL?

    Wednesday, July 21, 2010 8:38 AM
  • What he means is that if you are on http://servername:80 and you possibly have dns mapping for this called http://intranet -> ip address of the server, then you need  aam setup in central administration for http://intranet (internal url) for http://servername
    Blog: Alpesh Nakar's Blog | Twitter: Follow Alpesh on Twitter |SharePoint Resources: Just SharePoint Resource Center | Follow Just SharePoint updates on Twitter | SharePoint Conference South East Asia Singapore Oct 26-27 2010 | Contributing Author SharePoint 2010 Unleashed | MCTS: SharePoint 2010 Configuration | MCITP: SharePoint 2010 Administrator
    Wednesday, July 21, 2010 11:43 PM
  • Thanks Alpesh,

    I don't have any dns mapping like that for the server. I access it through http://servername. We set up the server the same way we've set up our MOSS 2007 servers so I don't think there are any mapping problems that's causing this issue.

    Thanks for the help though!

    Wednesday, July 28, 2010 9:43 AM
  • Also if you you are accessing as http://localhost or http://ip.add.res.s or something other than the url you specified in the stsadm command when you brought the database in.
    Wednesday, July 28, 2010 5:52 PM
  • Ok so I found the cause and a temporary workaround for this problem after many hours of struggling and using site definitions instead of site templates. This also seems to only apply to sites that have Publishing features enabled. There are 3 main problems here...

    Firstly, in your site definition you have a property called AlternateCSSUrl which specifies your stylesheet e.g. /Style Library/Main.css. However, your site settings page doesn't access the CSS at http://servername/Style Library/Main.css as you think it would, instead it looks for the css at http://servername/_layouts/1033/Style Library/Main.css. So basically you can go create a folder called Style Library in the 1033 folder, copy the css in there and then change your onet.xml to have AlternateCSSUrl="Style Library/Main.css" and it should take the error away.

    Secondly, if you do this you would notice that now the physical contents of you CSS file is being written to the actualy page above all your site settings. I have no idea why this happens, but when you open that CSS file and remove all the contents the site settings page now works correctly.

    Thirdly, because the actual contents of the css are written to the page they are obviously not being applied and you have to go into your site settings and set the CSS of your site to point to your actual style sheet.

    I am still trying to figure out how to set the actual style sheet of the site in the definition but for now this is all I could find.

    • Marked as answer by Ghecko85 Monday, August 16, 2010 1:37 PM
    Monday, August 16, 2010 1:37 PM
  • Hi guys. 

    I've found a way to get rid of this exception on the new site, but it won't solve the main problem.  So, I will show two different approaches and let you try which one will fit better. 

    The first one is specific to solve the problem only on the new site: Open PowerShell (Run as administrator) and type this 

    "
    $web = Get-SPWeb http://YOUR_SERVER/YOUR_NEW_WEB;
    $web.AlternateHeader = $Null;
    $web.Update();
    "
    Thanks to Pete: http://www.petestilgoe.com/2011/02/sharepoint-2010-create-site-from-site-template-where-alternate-css-url-is-set-unexpected-error-occured-accessing-site-settings/

    T
    he second one is like Ghecko85 suggestion.

    Please, check this article: http://littletalk.wordpress.com/2011/02/23/save-site-as-a-template-option-in-sharepoint-publishing-sites/

    Good luck


     


    • Edited by Bequadro Thursday, October 06, 2011 5:02 PM
    Thursday, October 06, 2011 3:32 PM