Copied to clipboard

Flag this post as spam?

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


  • Nicolas Erlijman 14 posts 104 karma points
    Sep 19, 2020 @ 03:22
    Nicolas Erlijman
    0

    I messed up my umbraco 8.6.1 installation, please help!

    I have restored my umbraco database and my code from git, only home page works, none of the child pages render. I really don't know what might happended.. but I am desperate.

    Exception
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Umbraco.Web.PublishedContentExtensions.Url(IPublishedContent content, String culture, UrlMode mode) in D:\a\1\s\src\Umbraco.Web\PublishedContentExtensions.cs:line 1205
       at ASP._Page_Views_master_cshtml.Execute() in c:\git\oz-umbraco\oz-umbraco\Views\master.cshtml:line 95
       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 System.Web.WebPages.WebPageBase.<>c__DisplayClass40_0.<RenderPageCore>b__0(TextWriter writer)
       at System.Web.WebPages.HelperResult.WriteTo(TextWriter writer)
       at System.Web.WebPages.WebPageBase.Write(HelperResult result)
       at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
       at System.Web.WebPages.WebPageBase.PopContext()
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
       at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
       at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
       at Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) in D:\a\1\s\src\Umbraco.Web\Mvc\ProfilingView.cs:line 25
       at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(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.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.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_6.<BeginInvokeAction>b__4()
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
       at System.Web.Mvc.Controller.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
       at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
       at System.Web.Mvc.Controller.<>c.<BeginExecute>b__151_2(IAsyncResult asyncResult, Controller controller)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
       at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
       at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)
       at System.Web.Mvc.MvcHandler.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
       at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
       at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    

    Master.cshtml at the line of the error 95 shown in image, but If commented that line, same errors appears on next item, and so on...

    enter image description here

  • Jakob Nawrocki 3 posts 72 karma points
    Sep 19, 2020 @ 08:44
    Jakob Nawrocki
    0

    Yo, Nicolas. Quick suggestion - what if you try republishing all the content pages? In the exception we can see Object reference not set to an instance of an object. coming from Umbraco.Web.PublishedContentExtensions.Url.

    As if it cannot get a link of a published content item.

    Null references are usually related to content. If you are using partial views in the master, the null ref might actually be coming from a partial that is nested deeper down - I've seen that happen before.

  • Nicolas Erlijman 14 posts 104 karma points
    Sep 19, 2020 @ 12:03
    Nicolas Erlijman
    0

    I republished all with descendants with no luck. Any other things I can try?

  • Jakob Nawrocki 3 posts 72 karma points
    Sep 19, 2020 @ 14:13
    Jakob Nawrocki
    0

    You mentioned only the home page works - is it using the master template?

    Also, in your template, you are using @title, which seems to be a variable you defined someplace else. What does that title variable actually look like?

  • Nicolas Erlijman 14 posts 104 karma points
    Sep 20, 2020 @ 21:05
    Nicolas Erlijman
    0

    @title is an HtmlString that in both cases has a value (The home that works and any other subpage).

    enter image description here

    All was working fine before restoring the update....

  • Alex 18 posts 90 karma points
    Sep 20, 2020 @ 22:31
    Alex
    100

    Hey Nicolas,

    After restoring my db, the first thing I do is to delete all the AppData, delete cache files and cookies from browser too and then republish as suggested above.

    Next thing I would try is (for the moment) to remove all the razor code from a template and see if it renders as a web page.

  • Nicolas Erlijman 14 posts 104 karma points
    Sep 21, 2020 @ 14:56
    Nicolas Erlijman
    0

    Thanks @Alex, I did what you suggested and it worked. Started from blank master and added the code one by one...

    The issue was in a null object but the stack trace did not point to that one... that why is was so confusing!

    Thank you very much @Alex & @Jakob

  • Alex 18 posts 90 karma points
    Sep 21, 2020 @ 15:04
    Alex
    0

    Nice to hear that it worked. :)

    If you don't mind, mark this thread as solved.

Please Sign in or register to post replies

Write your reply to:

Draft