Content not found error on CatalogRouteHelper.MapDefaultHierarchialRouter

Vote:
 

Hi,

We have an initialization module which makes the following call to configure the commerce routing:

         CatalogRouteHelper.MapDefaultHierarchialRouter(RouteTable.Routes, false);

But it's blowing up with the following error:

[ContentNotFoundException: Content with id -1073741823__CatalogContent was not found]
   EPiServer.Core.DefaultContentLoader.Get(ContentReference contentLink, LoaderOptions loaderOptions) +622
   EPiServer.Commerce.Routing.CatalogRouteHelper.MapDefaultHierarchialRouter(RouteCollection routes, Func`1 startingPoint, Boolean enableOutgoingSeoUri) +289
   Braun.Web.Business.Initialization.FindCommerceInitializationModule.Initialize(InitializationEngine context) in C:\Dev\Git\braun\src\Braun.Web\Business\Initialization\FindCommerceInitializationModule.cs:55
   EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key) +56
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +348

This suggests that the content loader isn't yet available, however the init module already has a module dependency:

    [InitializableModule]
    [ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
    public class FindCommerceInitializationModule : IConfigurableModule
    {
	}

Any idea what could be going wrong?

Thanks

#152095
Aug 16, 2016 12:58
Vote:
 

Hi,

This was registered as a bug  and was fixed in Commerce. It's likely to be released in Commerce 9.22 - so I would suggest you to upgrade to that version when it comes out. 

Regards,

/Q

#152097
Aug 16, 2016 13:38
Vote:
 

OK will do. 

#152117
Edited, Aug 17, 2016 11:21
Vote:
 
<p>Hi,</p> <p>My bad, it was mistaken this with another bug - the stacktrace was very similiar.&nbsp;</p> <p>I suspect that your initialization module is executed too soon - instead of&nbsp;InitializationModule, you should set the ModuleDependency to</p> <pre><span>[</span><span>ModuleDependency</span><span>(</span><span>typeof</span><span>(</span>EPiServer<span>.</span>Commerce<span>.</span>Initialization<span>.</span><span>InitializationModule</span><span>)</span><span>)</span><span>]</span> </pre>
#152119
Aug 17, 2016 11:35
Vote:
 

Yes, that fixed it - thanks

#152121
Aug 17, 2016 12:18
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.