Tried to disable FeedManager feature - error!

Topics: Administration
Jun 26, 2012 at 6:04 PM

I clicked on Disable and have an error below. Even if I restart the system - nothing is displayed except the same error page. Any thoughts please!

How to get rid of it without my data lost?

Server Error in '/OrchardLocal' Application.

None of the constructors found with 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'Orchard.Core.Containers.Drivers.ContainerPartDriver' can be invoked with the available services and parameters:
Cannot resolve parameter 'Orchard.Core.Feeds.IFeedManager feedManager' of constructor 'Void .ctor(Orchard.ContentManagement.MetaData.IContentDefinitionManager, Orchard.IOrchardServices, Orchard.Settings.ISiteService, Orchard.Core.Feeds.IFeedManager)'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Autofac.Core.DependencyResolutionException: None of the constructors found with 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'Orchard.Core.Containers.Drivers.ContainerPartDriver' can be invoked with the available services and parameters:
Cannot resolve parameter 'Orchard.Core.Feeds.IFeedManager feedManager' of constructor 'Void .ctor(Orchard.ContentManagement.MetaData.IContentDefinitionManager, Orchard.IOrchardServices, Orchard.Settings.ISiteService, Orchard.Core.Feeds.IFeedManager)'.

Source Error:

Line 60: 
Line 61:         public IEnumerable<IContentHandler> Handlers {
Line 62:               get { return _handlers.Value; }
Line 63:         }
Line 64: 


Source File: C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\ContentManagement\DefaultContentManager.cs    Line: 62

Stack Trace:

[DependencyResolutionException: None of the constructors found with 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'Orchard.Core.Containers.Drivers.ContainerPartDriver' can be invoked with the available services and parameters:
Cannot resolve parameter 'Orchard.Core.Feeds.IFeedManager feedManager' of constructor 'Void .ctor(Orchard.ContentManagement.MetaData.IContentDefinitionManager, Orchard.IOrchardServices, Orchard.Settings.ISiteService, Orchard.Core.Feeds.IFeedManager)'.]
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +464
   Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.InstanceLookup.<Execute>b__6() +50
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +151
   Autofac.Core.Resolving.InstanceLookup.Execute() +239
   Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +434
   Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Features.Collections.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr) +52
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +325
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Autofac.Features.Collections.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p) +233
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +160
   Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.InstanceLookup.Execute() +135
   Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +434
   Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Registration.<>c__DisplayClass8.<RegistrationsFor>b__3(IComponentContext c, IEnumerable`1 p) +49
   Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +51
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +160
   Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.InstanceLookup.Execute() +135
   Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +434
   Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Activators.Reflection.<>c__DisplayClass2.<CanSupplyValue>b__0() +68
   Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +201
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +499
   Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.InstanceLookup.<Execute>b__6() +50
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +151
   Autofac.Core.Resolving.InstanceLookup.Execute() +239
   Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +434
   Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Features.Collections.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr) +52
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +325
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Autofac.Features.Collections.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p) +233
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +160
   Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.InstanceLookup.Execute() +135
   Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +434
   Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Registration.<>c__DisplayClass8.<RegistrationsFor>b__3(IComponentContext c, IEnumerable`1 p) +49
   Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +51
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +160
   Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.InstanceLookup.Execute() +135
   Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +434
   Autofac.Core.Resolving.ResolveOperation.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +52
   Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters) +115
   Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +301
   Autofac.Features.LazyDependencies.<>c__DisplayClass7.<CreateLazyRegistration>b__4() +61
   System.Lazy`1.CreateValue() +361
   System.Lazy`1.LazyInitValue() +104
   System.Lazy`1.get_Value() +89
   Orchard.ContentManagement.DefaultContentManager.get_Handlers() in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\ContentManagement\DefaultContentManager.cs:62
   Orchard.ContentManagement.DefaultContentManager.New(String contentType) in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\ContentManagement\DefaultContentManager.cs:83
   Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options, QueryHints hints) in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\ContentManagement\DefaultContentManager.cs:190
   Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options) in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\ContentManagement\DefaultContentManager.cs:111
   Orchard.ContentManagement.DefaultContentManager.Get(Int32 id) in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\ContentManagement\DefaultContentManager.cs:107
   Orchard.Security.Providers.FormsAuthenticationService.GetAuthenticatedUser() in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\Security\Providers\FormsAuthenticationService.cs:84
   Orchard.Security.CurrentUserWorkContext.<Get>b__0(WorkContext ctx) in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\Security\CurrentUserWorkContext.cs:13
   Orchard.Environment.<>c__DisplayClass5`1.<FindResolverForState>b__3() in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\Environment\WorkContextImplementation.cs:37
   Orchard.Environment.WorkContextImplementation.GetState(String name) in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\Environment\WorkContextImplementation.cs:28
   Orchard.WorkContext.get_CurrentUser() in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\WorkContext.cs:60
   Orchard.Security.Authorizer.Authorize(Permission permission, IContent content, LocalizedString message) in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\Security\Authorizer.cs:72
   Orchard.Security.Authorizer.Authorize(Permission permission) in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\Security\Authorizer.cs:60
   Orchard.Security.SecurityFilter.OnAuthorization(AuthorizationContext filterContext) in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\Security\SecurityFilter.cs:24
   System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) +102
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) in C:\ProjectsY\Orchard.Source.1.4.2\src\Orchard\Mvc\Routes\ShellRoute.cs:147
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8970061
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

Developer
Jun 26, 2012 at 6:40 PM

Pushed the wrong button, eh?

Try going to the database, open the table called "Settings_ShellFeatureStateRecord", go to the record where Name='Feeds' and flip[ the switch EnableState back to Up.

You probably need to recycle the appdomain as well (easily done by touching the root web.config).

Jun 26, 2012 at 6:47 PM

Why is it wrong? If GUI let me do it then it should be OK, no?

Done with DB and web.config, nothing changed :(

Actually I am not sure about if it was Feeds or PublishLater but I restored both in DB, but... no success

Jun 26, 2012 at 6:49 PM

BTW, when you say root web.config do you mean one in Orchard.Web project?

Developer
Jun 26, 2012 at 6:57 PM
Gorizon47 wrote:

BTW, when you say root web.config do you mean one in Orchard.Web project?


Yeah that's the one.

Jun 26, 2012 at 7:15 PM

So I did those actions. It doesn't work for me. It looks like a bug but how to restore normal functioning then?

Developer
Jun 26, 2012 at 7:20 PM

That's odd. I had this issue once before, and I fixed it by making sure all of the features were flipped back to On, recycle the application pool and deleted the cache.dat file (not sure if that has anything to do with this feature stuff though)

Jun 26, 2012 at 8:13 PM

You have to add a new entry in the Settings_ShellFeatureRecord table with Name: "Feeds" and set ShellDescriptorFeature_id to the tenant id as well. The tentant id is 1 if you don't use multi tenancy. If you do, find the id that doesn't have a record for Feeds.

Jun 26, 2012 at 8:24 PM

Actually I am working under development server not IIS. Could it be a problem?

Jun 26, 2012 at 8:26 PM

Shouldn't make any difference. Did you add the entry in Settings_ShellFeatureRecord? You might have to delete cache.dat and restart the app pool.

Jun 26, 2012 at 9:10 PM

I changed EnableState field to Up, deleted cache.dat, changed one line and saved web.config. Nothing helped.

Jun 26, 2012 at 9:20 PM

Yes but did you add a new entry in the Settings_ShellFeatureRecord table with Name: "Feeds" and set ShellDescriptorFeature_id to the tenant id as well? Which line did you change?

Jun 26, 2012 at 9:24 PM

JLedel. Sorry didn't notice your first message. Why should I add a new entry if I already have one? Is there any reason for it? ShellStateRecord_id is 1.

Jun 26, 2012 at 9:31 PM

Hold on! It seems we are talking about different tables...

Victory!!!! It works now! Thank you guys for your help!

But it seems there is a bug - removing the entry from Settings_ShellFeatureRecord, no?

Jun 26, 2012 at 9:33 PM

Settings_ShellFeatureRecord contains the list of features, and Settings_ShellFeatureStateRecord contains the state of each feature. So even if you enable it in Settings_ShellFeatureStateRecord by setting it to "Up" it won't help because it's not in the list of active features.

Jun 26, 2012 at 9:35 PM

OK, got it. But should disabling the feature remove it from the list of active ones?

Jun 26, 2012 at 9:50 PM

It seems to me it is a bug. I tried to do ebabling/disabling with other features. All is fine. The feature is being removed from Settings_ShellFeatureRecord on disabling and restored on enabling.

But if you do the same with Feeds then the next screen after pressing Disable is the error screen (see above). And the system doesn't work anymore until you add the new entry in Settings_ShellFeatureRecord.

I am on 1.4.2.

Developer
Jun 26, 2012 at 10:10 PM
Edited Jun 26, 2012 at 10:12 PM

So if I understand correctly, disabling a feature will actually remove the record from the Settings_ShellFeatureRecord? It won't just switch the "EnableState" column value to "Down"? If this is consistent behavior accross all features, then tat's probably by design.

However, after analyzing your stack trace in your initial post, it looks like that the ContainerPartDriver has a dependency on the IFeedManager. Disabling the Feeds feature will effectively cause Autofac to not being able anymore to provide an instance of IFeedManager. So in short, the bug seems to lie in the fact that the Containers module has a dependency on the Feeds module, but that this dependency isn't listed to the "Dependencies" key in the Module.txt file. If it were there, then disabling the Feeds feature would have disabled the "Containers feature as well.

I think you may want to file a bug for this with a proposed fix: namely adding the "Feeds" module as a dependency to the "Containers" module (perhaps you could test this first?).

Jun 26, 2012 at 10:54 PM

OK you are fully right. The Containers module has an unlisted dependency on Feeds module

namespace Orchard.Core.Containers.Drivers {
    public class ContainerPartDriver : ContentPartDriver<ContainerPart> {
        private readonly IContentDefinitionManager _contentDefinitionManager;
        private readonly IOrchardServices _orchardServices;
        private readonly IContentManager _contentManager;
        private readonly ISiteService _siteService;
        private readonly IFeedManager _feedManager;
               ......

I tested it and it works fine for me. Thanks for your cooperation :)  I am going to submit a bug.

Jun 26, 2012 at 10:59 PM

Should I simply create Issue in Issue Tracker?

Developer
Jun 26, 2012 at 11:21 PM

You're welcome, thanks :)

Developer
Jun 26, 2012 at 11:22 PM
Gorizon47 wrote:

Should I simply create Issue in Issue Tracker?


Yes. Perhaps first do a quick search to see whether this bug hasn;t already been reported. If you can't find it, then yes simply create a new issue in the Issue Tracker.