System.InvalidOperationException: Having more than one storage filter for a given part (Orchard.ContentManagement.ContentPart`1[[CyberStride.Contacts.Models.ContactPartRecord, App_Web_cjnmiiuv, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]) is i

Topics: Installing Orchard, Troubleshooting
Sep 27, 2011 at 10:54 AM

Hi,

I have installed the Content request module and it is working fine locally but when I deploy to our staging environment I get this exception, please help urgently.

Thank you

 

System.InvalidOperationException: Having more than one storage filter for a given part (Orchard.ContentManagement.ContentPart`1[[CyberStride.Contacts.Models.ContactPartRecord, App_Web_cjnmiiuv, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]) is invalid.
   at Orchard.ContentManagement.Handlers.StorageFilter`1.Activated(ActivatedContentContext context, ContentPart`1 instance) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\ContentManagement\Handlers\StorageFilter.cs:line 41
   at Orchard.ContentManagement.Handlers.StorageFilterBase`1.Orchard.ContentManagement.Handlers.IContentStorageFilter.Activated(ActivatedContentContext context) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\ContentManagement\Handlers\StorageFilterBase.cs:line 23
   at Orchard.ContentManagement.Handlers.ContentHandler.Orchard.ContentManagement.Handlers.IContentHandler.Activated(ActivatedContentContext context) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\ContentManagement\Handlers\ContentHandler.cs:line 192
   at Orchard.ContentManagement.DefaultContentManager.<>c__DisplayClass6.<New>b__4(IContentHandler handler) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\ContentManagement\DefaultContentManager.cs:line 87
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\InvokeExtensions.cs:line 19
2011-09-27 13:48:30,706 [13] Orchard.ContentManagement.DefaultContentManager - InvalidOperationException thrown from IContentHandler by CyberStride.Contacts.Handlers.ContactHandler
System.InvalidOperationException: Having more than one storage filter for a given part (Orchard.ContentManagement.ContentPart`1[[CyberStride.Contacts.Models.ContactPartRecord, App_Web_cjnmiiuv, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]) is invalid.
   at Orchard.ContentManagement.Handlers.StorageFilter`1.Activated(ActivatedContentContext context, ContentPart`1 instance) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\ContentManagement\Handlers\StorageFilter.cs:line 41
   at Orchard.ContentManagement.Handlers.StorageFilterBase`1.Orchard.ContentManagement.Handlers.IContentStorageFilter.Activated(ActivatedContentContext context) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\ContentManagement\Handlers\StorageFilterBase.cs:line 23
   at Orchard.ContentManagement.Handlers.ContentHandler.Orchard.ContentManagement.Handlers.IContentHandler.Activated(ActivatedContentContext context) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\ContentManagement\Handlers\ContentHandler.cs:line 192
   at Orchard.ContentManagement.DefaultContentManager.<>c__DisplayClass6.<New>b__4(IContentHandler handler) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\ContentManagement\DefaultContentManager.cs:line 87
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\InvokeExtensions.cs:line 19
2011-09-27 13:48:30,815 [13] Orchard.ContentManagement.DefaultContentManager - InvalidOperationException thrown from IContentHandler by CyberStride.Contacts.Handlers.ContactHandler

Sep 27, 2011 at 6:23 PM

For some strange reason the module works fine on our production environment too, my doubt is that our staging is running IIS6/Win2003 and that is the only difference with our two dev and production boxes that are fine.

Nov 18, 2011 at 2:28 PM

I have the same problem!

Any Idea what could be wrong?

 

Nov 18, 2011 at 2:32 PM

It's vaguely possible that the module includes a wrong version of the dll (instead of using project links) - try deleting the Orchard reference dlls from its bin directory and/or editing the project file and re-add the references.

Nov 18, 2011 at 3:11 PM

Hi, thanks you where right, Contact Form Module has the wrong references to the DLL's.
I replaced them with refs to the projects, unfortunately the error is still the same.

Greets - Helmut

Nov 18, 2011 at 3:45 PM

Try cleaning/rebuilding the project (run ClickToBuild.cmd if you can)

Nov 18, 2011 at 5:40 PM

Hi, thank you for your suggestions,

on my webserver I only have the runtime of Orchard, no build environment.

I removed all dll's and modified the web.config, so normally it would get recompiled.

That doesn't help either.

Then I compiled it locally and deployed the complete module back to the server.

The Error still exists.

On my Webserver I have no ClickToBuild.cmd

Feb 18, 2012 at 12:19 PM

I have exactly the same problem. any solution found yet?

Mar 6, 2012 at 10:53 PM
Edited Mar 6, 2012 at 10:59 PM

I have traced this error to line 27 of ContactPart.cs in the Cyberstride.Contacts solution (in the models folder).  The error explicitly "complains" when a ContactPartRecord has a non-null Record member at the time of its activation. Line 27 explicitly instantiates a Record and causes the error. I don't know why the module's authors thought they had to do this, but it should not be necessary. To "fix" this issue, I commented out the line and recompiled. Therefore my ContactPart class' constructor looks like:

public ContactPart()
{
     // Record = new ContactPartRecord();
}

Error logs have stopped logging the error. I'm still testing to try and figure out why this was included in the first place, but the module seems to function normally without it. May this relieve your error logs :)

Developer
Mar 6, 2012 at 11:38 PM

Just a heads up chaps on this module, I dont think it is being maintained anymore... So please keep this in mind.

Coordinator
Mar 6, 2012 at 11:58 PM

Come see tomorrow's meeting ...