November Happy Hour will be moved to Thursday December 5th.

Odd error on site homepage, on web server start

Vote:
 

I've been having some perculiar issues with a site I've been building. Specifically when I hit the home page of our site on our UAT server after the application has first cycled up I get a 500 error and see the error below in the logs.

I can visit other pages if I navigate to them directly, and if I change the home page and publish I can then hit it up until the application pool is recycle or I recycle it when I get the error page again.

I'm at a loss as to what's going on here.

2014-07-02 12:17:20,129 [12] ERROR EPiServer.Global: 1.2.5 Unhandled exception in ASP.NET
System.Globalization.CultureNotFoundException: Culture is not supported.
Parameter name: name
en-GB" is an invalid culture identifier.
at System.Globalization.CultureInfo.GetCultureInfo(String name)
at EPiServer.Core.LanguageSelectorContext.get_SelectedLanguageBranch()
at EPiServer.DefaultContentProvider.LoadContent(ContentReference contentLink, ILanguageSelector languageSelector)
at EPiServer.Core.ContentProvider.<>c__DisplayClass26.b__24()
at EPiServer.Core.OptimisticCache`1.Read(String cacheKey, ReadAndCacheObject`1 readAndCacheObject)
at EPiServer.Core.ContentProvider.LoadContentFromCacheOrRepository(ContentReference contentreference, ILanguageSelector selector)
at EPiServer.Core.ContentProvider.Load(ContentReference contentLink, ILanguageSelector selector)
at EPiServer.DataFactory.TryGet[T](ContentReference contentLink, ILanguageSelector languageSelector, T& content)
at EPiServer.Web.Routing.UrlResolver.GetVirtualPathInternal(ContentReference contentLink, String language, VirtualPathArguments arguments)
at EPiServer.Web.Routing.UrlResolver.GetUrl(ContentReference contentLink, String language)
at EPiServer.Web.HierarchicalUrlRewriteProvider.ConvertToExternalInternal(UrlBuilder url, Object internalObject, Encoding toEncoding)
at EPiServer.Web.HierarchicalUrlRewriteProvider.ConvertToExternal(UrlBuilder url, Object internalObject, Encoding toEncoding)
at EPiServer.Web.FriendlyHtmlRewriteToExternal.HtmlRewriteUrl(UrlBuilder internalUrl, UrlBuilder externalUrl, UrlBuilder url, Encoding encoding, RebaseAction rebase, Object& internalObject)
at EPiServer.Web.FriendlyHtmlRewriteToExternal.rewritePipe_HtmlRewriteUrl(Object sender, HtmlRewriteEventArgs e)
at EPiServer.Web.HtmlRewritePipe.WriteElement(MyHtmlRewriteEventArgs e, SgmlReader reader, TextWriter writer)
at EPiServer.Web.HtmlRewritePipe.RewriteToEnd(TextReader reader, TextWriter writer)
at EPiServer.Web.HtmlRewriteStream.Close()
at System.Web.HttpWriter.FilterIntegrated(Boolean finalFiltering, IIS7WorkerRequest wr)
at System.Web.HttpResponse.FilterOutput()
at System.Web.HttpApplication.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

#88127
Jul 02, 2014 13:24
Vote:
 

What language branches does your startpage exist on? 

Also what is the MasterLanguageBranch for the startpage?

#88139
Jul 02, 2014 17:06
Vote:
 

It's set to en-GB for both. It's not actually a multi-lingual site, globalisation and browser language detection are both disabled.

#88186
Jul 04, 2014 10:52
Vote:
 

This is still proving quite odd, but I've been able to replicate it reliably and really narrowed down on it. However it does seem extremely weird - I'll try describe it a little.

So I have my start page model and I use some content areas and blocks on it, but the one that seems to cause my issue is GuidesBlock.

    [ContentType(
    GUID = "e1fcb1b8-c6e0-4f19-a287-ae06b4252867",
    GroupName = Globals.GroupNames.System)]
[Icon]
[AvailableContentTypes(
    Availability.Specific,
    Include = new[] { typeof(StandardPage) },
    Exclude = new[] { typeof(IListPageItem) },
    ExcludeOn = new[] { typeof(IBase) })]
public class StartPage : BasePageData
{
... 
    [Editable(true)]
    [Display(
        GroupName = SystemTabNames.Content,
        Order = 450)]
    public virtual GuidesBlock GuidesBlock { getset; }
 
...
}

This is on my view as below:

...
            <>EPiServer:Property runat="server" PropertyName="RightContentArea" CssClass="col-sm-12 col-md-3">         <>RenderSettings Tag="Right" ChildrenCssClass="col-sm-6 col-md-12" />     EPiServer:Property>     <>EPiServer:ContentRenderer runat="server" ID="BlogListing" CssClass="col-md-6" />     <>div class="col-md-3">         <>EPiServer:Property runat="server" PropertyName="GuidesBlock" />     div>     <>EPiServer:ContentRenderer runat="server" ID="NewsListing" CssClass="col-md-3" /> div> <>EPiServer:Property runat="server" PropertyName="FootContentArea" CssClass="row">     <>RenderSettings Tag="Grid,Columns4" /> EPiServer:Property>
...

If I remove the property for GuidesBlock I don't get the error on hitting the home page on app start.

Now guides block only looks as below:

public class GuidesBlock : BaseBlockData
 {
     [Display(
         GroupName = SystemTabNames.Content,
         Order = 100)]
     [CultureSpecific]
     public virtual string Title { getset; }
     
     [Display(
         GroupName = SystemTabNames.Content,
         Order = 200)]
     [UIHint(UIHint.MediaFile)]
     [AllowedTypes(typeof(DocumentFile))]
     public virtual ContentReference Document1 { getset; }
 
     [Display(
         GroupName = SystemTabNames.Content,
         Order = 225)]
     [UIHint(UIHint.Image)]
     public virtual ContentReference Document1Image { getset; }
 
     [Display(
         GroupName = SystemTabNames.Content,
         Order = 300)]
     [UIHint(UIHint.MediaFile)]
     [AllowedTypes(typeof(DocumentFile))]
     public virtual ContentReference Document2 { getset; }
 
     [Display(
         GroupName = SystemTabNames.Content,
         Order = 325)]
     [UIHint(UIHint.Image)]
     public virtual ContentReference Document2Image { getset; }
 
     [Editable(true)]
     [Display(
         GroupName = SystemTabNames.Content,
         Order = 400)]
     public virtual Url Link { getset; }
 
     [CultureSpecific]
     [Editable(true)]
     [Display(
         GroupName = SystemTabNames.Content,
         Order = 500)]
     public virtual string LinkText { getset; }
 }

But what is really odd is a looked at the data and if I visit the link property for the GuideBlock the home page will then work afterwards, it's the only page I've found that actually does this. So I'm wondering is this a bug of some sort? 

The data is below, the link attributed to that block on the homepage is ~/link/b88f415792564380815a14c60b2b4abe.aspx:

pkID fkPropertyDefinitionID fkContentID fkLanguageBranchID ScopeName guid Boolean Number FloatNumber ContentType ContentLink Date String LongString LongStringLength LinkGuid
11304 382 7 2 .401.382. BE8B497E-A5DB-4045-9A3D-9E476F36DDE7 0 NULL NULL NULL NULL NULL NULL Guides 6 NULL
11305 383 7 2 .401.383. 12E5E958-EB6D-4C35-B14E-4BA588F0E744 0 NULL NULL NULL 1663 NULL NULL NULL 0 BDDB9416-839D-4DC9-BBA3-3588A12DAEA3
11306 384 7 2 .401.384. A3AC644F-4B9A-4F9D-B4A6-EA431F885109 0 NULL NULL NULL 1672 NULL NULL NULL 0 01ED4F6A-07D8-4E68-ADBE-C1935124012F
11307 385 7 2 .401.385. 90F04DA7-2D05-465E-B94F-95ADE25EADFE 0 NULL NULL NULL 1664 NULL NULL NULL 0 9654468B-62B7-49A6-9B98-9CB6B4437182
11308 386 7 2 .401.386. C94D010F-4C0E-4520-942F-87C8EF6EF3F1 0 NULL NULL NULL 1673 NULL NULL NULL 0 DB04FE53-5260-4549-9481-8549D328D809
11309 387 7 2 .401.387. 5EA97C41-8F1C-4017-97D7-40CC37C17398 0 NULL NULL NULL NULL NULL ~/link/b88f415792564380815a14c60b2b4abe.aspx NULL 0 NULL
11310 388 7 2 .401.388. 9D4951F3-E206-47AA-B30D-DEB334C02C6A 0 NULL NULL NULL NULL NULL NULL View all brochures 18 NULL

#88207
Jul 04, 2014 15:50
Vote:
 

Okay, I have even more detail - the error only occurs dependent on where the link is linking to in the hierarchy.

So if I look to /media-centre/ in my tree or any other immediate child of the home page then no error - if however I link to any second level page i.e. /media-centre/press-releases/ I get the error on hitting the home page. Have been able to replicate it every time now.

If I get chance I'm going to try spin up a new empty EPiServer project to test in a clean install but I can't help think this must be a bug now.

#88210
Jul 04, 2014 16:11
Vote:
 

Okay so turns out it has something to do with the fact that I'm trying to get the string resolution of the URL to build up mark-up i.e.

this.CurrentData.Link.ToString()

I'm not sure why that seems to make such a difference, just need to figure out how I should get the proper URL string from the URL type.

#88213
Jul 04, 2014 17:42
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.