Orchard CMS Quick Tip–Orchard suddenly starts showing a 404 error for every page including the root

As your working on your Orchard CMS website or maybe right after you have deployed it, you might suddenly find that nothing is working. If you’re getting a simple 404 page no matter what you try then this is the first thing you need to try.

orchard---404-error-on-all-pages

Check the logs.

Orchard keeps logs in some text files inside the ~/Orchard.Web/App_Data/Logs/ folder.

The last time this happened for me it turned out I had created a circular dependency:

2015-09-01 17:50:21,718 [6] Orchard.Environment.DefaultOrchardHost - (null) - A tenant could not be started: Default
 (null)
Autofac.Core.DependencyResolutionException: Circular component dependency detected: Orchard.Environment.DefaultOrchardShell -> Orchard.Environment.DefaultOrchardShell -> Orchard.Mvc.Routes.IRouteProvider[] -> Orchard.Mvc.Routes.IRouteProvider[] -> rtpDesign.ExampleSite.Routing.Routes -> rtpDesign.ExampleSite.Routing.ExampleSiteSlugConstraint -> Orchard.Alias.Implementation.DefaultAliasService -> Orchard.Mvc.Routes.IRouteProvider[].
   at Autofac.Core.Resolving.CircularDependencyDetector.CheckForCircularDependency(IComponentRegistration registration, Stack`1 activationStack, Int32 callDepth)
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Activators.Reflection.AutowiringParameter.<>c__DisplayClass2.<CanSupplyValue>b__0()
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.<Execute>b__0()
   at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)
   at Autofac.Core.Res2015-09-01 17:50:21,718 [6] Orchard.Environment.DefaultOrchardHost - (null) - A tenant could not be started: Default
 (null)
Autofac.Core.DependencyResolutionException: Circular component dependency detected: Orchard.Environment.DefaultOrchardShell -> Orchard.Environment.DefaultOrchardShell -> Orchard.Mvc.Routes.IRouteProvider[] -> Orchard.Mvc.Routes.IRouteProvider[] -> rtpDesign.ExampleSite.Routing.Routes -> rtpDesign.ExampleSite.Routing.ExampleSiteSlugConstraint -> Orchard.Alias.Implementation.DefaultAliasService -> Orchard.Mvc.Routes.IRouteProvider[].
   at Autofac.Core.Resolving.CircularDependencyDetector.CheckForCircularDependency(IComponentRegistration registration, Stack`1 activationStack, Int32 callDepth)
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Activators.Reflection.AutowiringParameter.<>c__DisplayClass2.<CanSupplyValue>b__0()
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.<Execute>b__0()
   at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)
   at Autofac.Core.Resolving.InstanceLookup.Execute()olving.InstanceLookup.Execute()

Disabling the offending code fixed it straight away and I was back up and running in minutes.

No comments :