I’m facing a very strange issue on website which is hosted on umbraco cloud. I have a Site Settings node in the backoffice which is used to serve the footer content. At random intervals(in days), the website starts throwing a 500 error.
Once I republish the Site Settings node, rebuild the cache, or restart the site, it starts working fine again. However, after some time, the issue repeats.
I traced my conversation with our Senior Developer….We actually faced a similar issue with our site Banner setting
In our case, it turned out to be an issue with the node itself. On Live, we created a different/new node and used that instead. After doing that, even when refreshing the memory cache, the banner did not disappear. it was a bit strange..
System.NullReferenceException: Object reference not set to an instance of an object.
at AspNetCore.Views_Partials_Components_Footer_Default.ExecuteAsync() in C:\home\site\wwwroot\Views\Partials\Components\Footer\Default.cshtml:line 3
The code at line 3 is:
Model.Title
The issue was resolved after restarting the site and rebuilding the cache. However, I would like to understand why this is occurring and what the permanent solution would be to prevent it from happening again.
You could add a null check around Model.Titlein your partial and see if that makes a difference. I would also ensure you are passing in a Model too where you are adding the partial, something like