The controller for path '/' was not found or does not implement IController.

Topics: Troubleshooting
Oct 4, 2012 at 3:29 PM
Edited Oct 4, 2012 at 3:30 PM

I've just imported some content into Orchard (after having deleted all previous content). I can browse and search this content fine in admin and I can view the individual pages without issue. However, when I try to view the site homepage now I'm getting the above error.

Here's the error log:

 

2012-10-04 15:17:14,478 [11] Orchard.ContentManagement.DefaultContentManager - NullReferenceException thrown from IContentHandler by Orchard.Core.Navigation.Handlers.ContentMenuItemPartHandler
System.NullReferenceException: Object reference not set to an instance of an object.
   at Orchard.ContentManagement.DefaultContentManager.GetItemMetadata(IContent content) in c:\dev\Orchard\ContentManagement\DefaultContentManager.cs:line 500
   at Orchard.Core.Navigation.Handlers.ContentMenuItemPartHandler.GetItemMetadata(GetContentItemMetadataContext context) in c:\dev\Orchard.Web\Core\Navigation\Handlers\ContentMenuItemPartHandler.cs:line 30
   at Orchard.ContentManagement.Handlers.ContentHandler.Orchard.ContentManagement.Handlers.IContentHandler.GetContentItemMetadata(GetContentItemMetadataContext context) in c:\dev\Orchard\ContentManagement\Handlers\ContentHandler.cs:line 333
   at Orchard.ContentManagement.DefaultContentManager.<>c__DisplayClass60.b__5f(IContentHandler handler) in c:\dev\Orchard\ContentManagement\DefaultContentManager.cs:line 505
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in c:\dev\Orchard\InvokeExtensions.cs:line 17
2012-10-04 15:17:14,819 [11] Orchard.ContentManagement.DefaultContentManager - NullReferenceException thrown from IContentHandler by Orchard.Core.Navigation.Handlers.ContentMenuItemPartHandler
System.NullReferenceException: Object reference not set to an instance of an object.
   at Orchard.ContentManagement.DefaultContentManager.GetItemMetadata(IContent content) in c:\dev\Orchard\ContentManagement\DefaultContentManager.cs:line 500
   at Orchard.Core.Navigation.Handlers.ContentMenuItemPartHandler.GetItemMetadata(GetContentItemMetadataContext context) in c:\dev\Orchard.Web\Core\Navigation\Handlers\ContentMenuItemPartHandler.cs:line 30
   at Orchard.ContentManagement.Handlers.ContentHandler.Orchard.ContentManagement.Handlers.IContentHandler.GetContentItemMetadata(GetContentItemMetadataContext context) in c:\dev\Orchard\ContentManagement\Handlers\ContentHandler.cs:line 333
   at Orchard.ContentManagement.DefaultContentManager.<>c__DisplayClass60.b__5f(IContentHandler handler) in c:\dev\Orchard\ContentManagement\DefaultContentManager.cs:line 505
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in c:\dev\Orchard\InvokeExtensions.cs:line 17

 

Any suggestions as to how to fix are much appreciated.

Developer
Oct 6, 2012 at 5:30 AM

Looks like one of the menu items has lost it's association with a content item for some reason. You could attach a debugger and verify this. I couldn't say how that happened, but maybe try and remove all of the menu items an create them again.

Oct 8, 2012 at 7:24 PM

Yep correct, I'm an idiot and hadn't realised the migration didn't include a "home" and before doing the migration I deleted all existing content.