internal 500 error on 1 page, rest works including...
# help-with-umbraco
m
internal 500 error on 1 page, rest works including umbraco cms, where can I look at logs? event viewer does not seem to show anything, and the "log" directory under umbraco only has old logs in it
h
I assume there's nothing in the LogViewer within the Developer section of Umbraco?
If it's not there (which I assume it might not be as I think that just reads from the log directory under umbraco) then I'm not sure, especially if it's not in the Event viewer. There might be a logs or stdout folder in the root of your project directory also
m
you're a winner!
logviewer shows an error
System.NullReferenceException: Object reference not set to an instance of an object. at Umbraco.Extensions.PublishedContentExtensions.Url(IPublishedContent content, IPublishedUrlProvider publishedUrlProvider, String culture, UrlMode mode) at AspNetCore.Views_Partials_Modules_market_section.ExecuteAsync() in C:\Users\Umbraco\Documents\LIVE-230720\draglobal.com\Views\Partials\Modules\market-section.cshtml:line 23
let me check the line out
h
Looks like you're getting the .Url() of something that is null. An image maybe? Or perhaps a content item? I would guess maybe that's not set in your content, or perhaps it's set to something that's been recycled. You should be able to null check the item first then try and retrieve the Url() (all guesswork of course from that error 🙂 )
m
Yup it seems to be related to unpublished content, the page does a loop through all of the child nodes, but 1 of them is unpublished but still part of node.children()
@foreach (var item in node.Children)
I take it I should be able to look whether the content is published first
h
You should though AFAIK the Children() should only be published items by default 🤔