This project is read-only.

Orchard can't find the home page.

Topics: Troubleshooting
Mar 10, 2011 at 3:29 PM
Edited Mar 11, 2011 at 2:25 AM

My orchard site has recently started to not be able to resolve the homepage. I end up getting the infamous serviceKey = null issue. I can browse to any other page on my site.

First, I tried just adding a new page item and setting it as the home page, but I ended up with the same error. I've tried setting break points in the HomeController in orchard.core.dll, but it's never called.

For the time being, I just hacked a default route, this now resolves the "~/" url, but now that page is no longer editable in the CMS


new RouteDescriptor
                    Priority = 5,
                    Route = new Route(

                        new RouteValueDictionary
                            {"area", "MyModule"},
                            {"controller", "Default"},
                            {"action", "Index"}

                        new RouteValueDictionary(),

                        new RouteValueDictionary {
                                                    {"area", "MyModule"}

                        new MvcRouteHandler())

Mar 10, 2011 at 8:59 PM

Do you remember what you did immediately before this happened?

Mar 10, 2011 at 9:24 PM

Nope. There are 6 people working on the project and anyone could have done something. I can start the site over from scratch, by deleting app_data, bin, and the database, and after it runs setup, I get the same thing.

Mar 10, 2011 at 10:48 PM

You mean you get this error right after setup when you try to access the home page?

Mar 11, 2011 at 2:29 AM

Yes, setup seems to work fine but as soon as it redirects to the home page, the serviceKey is null. I can go to /admin and enable features, themes, etc. and browse to URLs in my module, but the home page won't work. 

Mar 11, 2011 at 3:29 AM

And you're also getting that on a fresh install in a new directory?

Mar 11, 2011 at 3:49 AM

Yes. We've added some basic additions to the project (a few of our own registrations in Orchard's Autofac container, a module and a theme) but the issue has been replicated on multiple machines and clean installs.

Mar 11, 2011 at 12:48 PM

when it is replicated on other machine, is the database the same or not? I mean, is it possible because of dirty data in database?

Mar 11, 2011 at 2:33 PM

No, the database is not the same. It's a clean install, no database exists. Orchard setup creates a new database, the default Page item is inserted and the Settings_SiteSettingsPartRecord.HomePage field gets the RoutableHomePageProvider;11 entry. 11 seems to be the Id of the default page item.

Mar 11, 2011 at 7:28 PM

Apparently this was fixed post 1.0. The error message was made more explicit when an incorrect controller gets requested. One thing I want to make sure of: there *is* code that you wrote in there, right? We are not talking about out of the box, vanilla Orchard, right?

You could check this by grabbing a later drop from CodePlex.

Mar 11, 2011 at 11:15 PM

Yes we definitely added code, but not to the framework or core itself, only in global.asax.

Mar 11, 2011 at 11:18 PM

Yeah, so what's probably happening is that you have a bug in your code (very likely route-related), and we have a very bad error message.

Apr 14, 2011 at 3:48 PM


I've upgraded to 1.1 but the error message is just what I assumed the problem is:

The IControllerFactory 'Orchard.Mvc.OrchardControllerFactory' did not return a controller for the name 'home'.


Shouldn't the home controller be part of the Orchard.Core? Did I somehow delete it?

Apr 14, 2011 at 7:28 PM

Something probably went wront during the upgrade process. Can you try again? One thing you might want to do is start with only the core modules and add others back one by one.