Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • n00b 33 posts 134 karma points
    Mar 01, 2018 @ 16:30
    n00b
    0

    500 Error in console, but page renders fine?

    Hi all.

    Running Umbraco version 7.5.3 assembly: 1.0.6092.24019

    The links to a handful of newly created product pages work and the pages render, however the console (and other crawlers) detect a 500 error.

    I'm not an .asp developer, so not sure where to start looking, however the most similar post i've found online would be this:

    https://forums.asp.net/t/1712160.aspx?My+page+is+rendered+correctly+but+it+returns+500+Internal+Server+Error+error+when+validated+by+W3C

    The URL in question is https://www.able-systems.com/industry-solutions/printer-mechanisms/aps-kiosk-printers/

    When you paste the link or follow it, you'll see the 500 error in console, however when you refresh the page, it disappears.

    Any help/advice (or even better, an easy solution) would be well received.

  • Joshua Lemli 52 posts 234 karma points
    Mar 02, 2018 @ 17:28
    Joshua Lemli
    0

    It looks like it's trying to load "aps-kiosk-printers", locally referenced... which is the tail bit of your URL.

    So could this just be a routing issue? Do you have any custom routing?

  • n00b 33 posts 134 karma points
    Mar 05, 2018 @ 10:59
    n00b
    0

    Not sure - where would I look? It uses a redirect plugin called UrlTracker. Is there some option I may have missed? It's strange that it loads the page anyway, regardless of the 500 error.

  • Steve Morgan 1278 posts 4216 karma points c-trib
    Mar 05, 2018 @ 11:28
    Steve Morgan
    0

    There's an error being output in the source which might be the cause.

    What's at line 22 in your RichText.cshtml template?

    <!-- Error rendering template with id 8000: 'System.NullReferenceException: Object reference not set to an instance of an object.
       at ASP._Page_Views_RichText_cshtml.Execute() in c:\HostingSpaces\able-systems\able-systems.com\wwwroot\Views\RichText.cshtml:line 22
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
       at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
       at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
       at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
       at System.Web.Mvc.Controller.ExecuteCore()
       at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
       at System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext)
       at Umbraco.Web.Templates.TemplateRenderer.RenderUmbracoRequestToString(RequestContext requestContext)
       at Umbraco.Web.Templates.TemplateRenderer.ExecuteTemplateRendering(TextWriter sw, PublishedContentRequest contentRequest)
       at Umbraco.Web.Templates.TemplateRenderer.Render(StringWriter writer)
       at umbraco.library.RenderTemplate(Int32 PageId, Int32 TemplateId)' -->
    
  • n00b 33 posts 134 karma points
    Mar 05, 2018 @ 11:30
    n00b
    0

    This is line 20 - 32:

       if (string.IsNullOrEmpty(linkTitle))
                        {
                            linkTitle = link.Name;
                        }
    
                        if (link != null)
                        {
                            <a href="@link.Url" class="custom-btn outlined red large pill">
                                <i class="fa fa-share-alt"></i>
                                @linkTitle
                            </a>
                        }
                    }
    
  • n00b 33 posts 134 karma points
    Mar 05, 2018 @ 11:39
    n00b
    0

    Having a look through some of these pages, it appears there is a compulsory link to a product (weirdly -even for products) which needs adding or it throws a wobbly.

    Thanks for all your help fellas. Much appreciated.

    I've just added it in, and the page no longer has a 500 error. I might need to add another if statement to have it check this and avoid future problems.

  • Steve Morgan 1278 posts 4216 karma points c-trib
    Mar 05, 2018 @ 12:01
    Steve Morgan
    0

    Hi,

    Hard to guess but shouldn't you just negate the logic .. e.g. if it's null then DON'T try to access the link name!

    if (!string.IsNullOrEmpty(linkTitle))

  • n00b 33 posts 134 karma points
    Mar 05, 2018 @ 12:17
    n00b
    0

    Thanks, will try that Steve and see how it affects pages. I didn't build the site, so I'm still working my way around how all the elements are connected.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies