0
Fixed

GroupedNameValueCollectionMissingFieldException when using removeMembership

Matthew Woolnough 12 years ago in UNIFYBroker/Learnology Life updated by anonymous 9 years ago 1

Config below causes error further below.

          <RemoveMemberships>
		  <RemoveMembership groupType="Id" groupValue="{d941e299-0cc0-41cf-83e7-a12100780115}" />
            <!--<RemoveMembership groupType="Name" groupValue="Leavers" siteType="School" laId="100" siteValue="" />-->
          </RemoveMemberships>
20130410,04:39:03,Connector processing success.,Connector Processor,Information,"Processing page 29 for connector Learnology Life Group Membership Connector processed 7775 entities, finding 0 differences. Duration: 00:00:06.6734010",Normal
20130410,04:39:03,Connector Processing started.,Connector Processor,Information,Connector Processing started for connector Learnology Life Group Membership Connector (page 30),Normal
20130410,04:39:04,Get all entities from connector failed.,Connector,Warning,"Get all entities from connector Learnology Life Group Membership Connector failed with reason Exception of type 'Unify.Framework.GroupedNameValueCollectionMissingFieldException' was thrown.. Duration: 00:03:39.2410005
Error details:
Unify.Framework.GroupedNameValueCollectionMissingFieldException: Exception of type 'Unify.Framework.GroupedNameValueCollectionMissingFieldException' was thrown.
   at Unify.Framework.EntityBase`3.GetValue[TValue](TKey key)
   at Unify.Connectors.LifeGroupMembershipConnector.DeleteMembership(ILifeGroupMembershipWCFCommunicator groupMembershipWCFCommunicator, Int32 groupMemberId, Guid groupSiteId, String groupName, IConnectorEntity matchingGroupMembershipEntity)
   at Unify.Connectors.LifeGroupMembershipConnector.DeleteEntities(IEnumerable`1 entityIds)
   at Unify.Connectors.LifeGroupMembershipConnector.<GetAllEntities>d__9.MoveNext()
   at Unify.Framework.EnumerableExtensions.<ActionOnFirst>d__1c`1.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at Unify.Framework.ActionOnExceptionEnumerator`1.MoveNext()
   at Unify.Framework.EnumerableExtensions.<ActionOnLast>d__16`1.MoveNext()
   at Unify.Framework.EnumerableExtensions.<ProduceAutoPages>d__9`1.MoveNext()
   at Unify.Framework.Visitor.ThreadsafeVisitorEvaluator`1.Visit()
   at Unify.Framework.Visitor.VisitEvaluateOnThreadPool[T](IEnumerable`1 visitCollection, Action`2 visitor, Int32 maxThreads)
   at Unify.Framework.RepositoryChangeDetectionWorkerBase.PerformChangeDetection(IEnumerable`1 connectorEntities)
   at Unify.Framework.ChangeDetectionImportAllJob.ImportAllChangeProcess()
   at Unify.Framework.ChangeDetectionImportAllJob.RunBase()
   at Unify.Framework.MutexJobDecorator.Run()
   at Unify.Framework.DefinedScopeJobAuditTrailJobDecorator.Run()
   at Unify.Framework.AsynchronousJobExecutor.PerformJobCallback(Object state)",Normal
20130410,04:39:04,Change detection engine import all items failed.,Change detection engine,Warning,"Change detection engine import all items for connector Learnology Life Group Membership Connector failed with reason Exception of type 'Unify.Framework.GroupedNameValueCollectionMissingFieldException' was thrown.. Duration: 00:03:39.3865130
Error details:
Unify.Framework.GroupedNameValueCollectionMissingFieldException: Exception of type 'Unify.Framework.GroupedNameValueCollectionMissingFieldException' was thrown.
   at Unify.Framework.EntityBase`3.GetValue[TValue](TKey key)
   at Unify.Connectors.LifeGroupMembershipConnector.DeleteMembership(ILifeGroupMembershipWCFCommunicator groupMembershipWCFCommunicator, Int32 groupMemberId, Guid groupSiteId, String groupName, IConnectorEntity matchingGroupMembershipEntity)
   at Unify.Connectors.LifeGroupMembershipConnector.DeleteEntities(IEnumerable`1 entityIds)
   at Unify.Connectors.LifeGroupMembershipConnector.<GetAllEntities>d__9.MoveNext()
   at Unify.Framework.EnumerableExtensions.<ActionOnFirst>d__1c`1.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at Unify.Framework.ActionOnExceptionEnumerator`1.MoveNext()
   at Unify.Framework.EnumerableExtensions.<ActionOnLast>d__16`1.MoveNext()
   at Unify.Framework.EnumerableExtensions.<ProduceAutoPages>d__9`1.MoveNext()
   at Unify.Framework.Visitor.ThreadsafeVisitorEvaluator`1.Visit()
   at Unify.Framework.Visitor.VisitEvaluateOnThreadPool[T](IEnumerable`1 visitCollection, Action`2 visitor, Int32 maxThreads)
   at Unify.Framework.RepositoryChangeDetectionWorkerBase.PerformChangeDetection(IEnumerable`1 connectorEntities)
   at Unify.Framework.ChangeDetectionImportAllJob.ImportAllChangeProcess()
   at Unify.Framework.ChangeDetectionImportAllJob.RunBase()
   at Unify.Framework.MutexJobDecorator.Run()
   at Unify.Framework.DefinedScopeJobAuditTrailJobDecorator.Run()
   at Unify.Framework.AsynchronousJobExecutor.PerformJobCallback(Object state)",Normal
20130410,04:39:09,Connector processing success.,Connector Processor,Information,"Processing page 30 for connector Learnology Life Group Membership Connector processed 7875 entities, finding 0 differences. Duration: 00:00:06.4517355",Normal

Matthew, I have fixed up the bug that was causing this error, it was using the entity from its own context to get the external user id (required for the WCF call), instead of the user entity. I've also added an option to use group name only, without site id settings:

<RemoveMembership groupType="NameOnly" groupValue="Leavers" />

See v3.0.0.7 on SUBIDBLIFE:Downloads.