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...
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.
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?
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.
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.
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...
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.
I republished all with descendants with no luck. Any other things I can try?
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?
@title is an HtmlString that in both cases has a value (The home that works and any other subpage).
All was working fine before restoring the update....
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.
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
Nice to hear that it worked. :)
If you don't mind, mark this thread as solved.
is working on a reply...