Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] save certain member to a group -> MembershipNotFoundException

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] save certain member to a group -> MembershipNotFoundException


Chronological Thread 
  • From: Shilen Patel <>
  • To: Colin Hudler <>, "" <>
  • Subject: Re: [grouper-users] save certain member to a group -> MembershipNotFoundException
  • Date: Tue, 7 Feb 2012 17:01:24 +0000
  • Accept-language: en-US

Colin,

Do you mind sending me those 4 rows (off list -- though there shouldn't be
any private data there)?

If you look at the owner_ids of the 4 rows, at least one should be for a
composite group that is dependent on
uc:Reference:affiliations:effective:student (could be multiple levels
deep).

To fix the issue, I think you'll have to delete the 4 group sets that are
associated with the 4 rows. And then possibly delete/recreate those
composites as well.

Thanks!

-- Shilen


On 2/7/12 11:06 AM, "Colin Hudler"
<>
wrote:

>That second query has 4 rows, nothing in the first.
>
>On 02/07/2012 07:54 AM, Shilen Patel wrote:
>> Colin,
>>
>> Do either of these two queries give you anything back?
>>
>> select * from grouper_memberships m, grouper_fields f,
>>grouper_composites c
>> where m.owner_id=c.owner and m.field_id=f.id and f.name='members'
>> and (m.via_composite_id is null or m.mship_type<> 'composite');
>>
>> select * from grouper_group_set g, grouper_fields f, grouper_composites
>>c
>> where g.owner_id=c.owner and g.field_id=f.id and f.name='members' and
>> (g.depth> 0 or g.mship_type<> 'composite');
>>
>>
>>
>>
>> Thanks!
>>
>> -- Shilen
>>
>>
>>
>> On 2/6/12 8:03 PM, "Colin
>> Hudler"<>
>> wrote:
>>
>>
>>> Here's a better stacktrace showing who did it
>>>
>>> Caused by:
>>> edu.internet2.middleware.grouper.exception.MembershipNotFoundException:
>>> Exception in save: edu.internet2.middleware.grouper.Membership,
>>> edu.internet2.middleware.grouper.hibernate.ByObject@111cf3c,
>>> Problem in HibernateSession: HibernateSession: isNew: false,
>>>isReadonly:
>>> false, grouperTransactionType: READ_WRITE_NEW,
>>> Exception in save: edu.internet2.middleware.grouper.Membership,
>>> ByObjectStatic, query: ', cacheable: null, cacheRegion: null,
>>> entityName: ImmediateMembershipEntry, tx type: null
>>> at
>>>
>>>edu.internet2.middleware.grouper.internal.dao.hib3.Hib3MembershipDAO.fin
>>>dB
>>> yGroupOwnerAndMemberAndFieldAndType(Hib3MembershipDAO.java:937)
>>> at
>>>
>>>edu.internet2.middleware.grouper.Membership.fixComposites(Membership.jav
>>>a:
>>> 2141)
>>> at
>>>
>>>edu.internet2.middleware.grouper.Membership.processPostMembershipSaveOrU
>>>pd
>>> ate(Membership.java:2049)
>>> at
>>>
>>>edu.internet2.middleware.grouper.Membership.onPostSave(Membership.java:1
>>>88
>>> 4)
>>> at
>>>
>>>edu.internet2.middleware.grouper.hibernate.ByObject.save(ByObject.java:2
>>>02
>>> )
>>> at
>>>
>>>edu.internet2.middleware.grouper.hibernate.ByObjectStatic$7.callback(ByO
>>>bj
>>> ectStatic.java:466)
>>> at
>>>
>>>edu.internet2.middleware.grouper.hibernate.HibernateSession.callbackHibe
>>>rn
>>> ateSession(HibernateSession.java:500)
>>> at
>>>
>>>edu.internet2.middleware.grouper.hibernate.ByObjectStatic.save(ByObjectS
>>>ta
>>> tic.java:453)
>>> at
>>>
>>>edu.internet2.middleware.grouper.internal.dao.hib3.Hib3MembershipDAO.sav
>>>e(
>>> Hib3MembershipDAO.java:1471)
>>> at
>>>
>>>edu.internet2.middleware.grouper.Membership.internal_addImmediateMembers
>>>hi
>>> p(Membership.java:1164)
>>> at
>>> edu.internet2.middleware.grouper.Group$2.callback(Group.java:860)
>>>
>>> fixComposites is loading with some bad arguments or some
>>> impartial/corrupt db rows, memberlist or something like that. From this
>>> it should be possible to follow it backwards.
>>>
>>> On 2/6/12 4:12 PM, Colin Hudler wrote:
>>>
>>>> I can't even see exactly where the exception is thrown. Why
>>>> MembershipNotFoundException for addMember()? I can see it is ByObject
>>>> save(), but what's really throwing it? Not being able to find it is
>>>> driving me mad. I thought perhaps doPreSave() in Membership class, but
>>>> that doesn't seem possible.
>>>>
>>>> On 2/6/12 4:01 PM, Colin Hudler wrote:
>>>>
>>>>> Shilen,
>>>>>
>>>>> Thanks for looking. The two SQL queries returned zero rows. Here's
>>>>> the output from the GSH command.
>>>>>
>>>>> gsh 0% new
>>>>>
>>>>>
>>>>>edu.internet2.middleware.grouper.misc.AddMissingGroupSets().saveUpdate
>>>>>s(
>>>>> false).addAllMissingGroupSets();
>>>>>
>>>>>
>>>>> Searching for missing self groupSets for attribute defs
>>>>> Found 0 missing groupSets
>>>>>
>>>>>
>>>>> Searching for all composite groups to cache for later use
>>>>> Searching for missing self groupSets for groups
>>>>> Found 0 missing groupSets
>>>>>
>>>>>
>>>>> Searching for missing self groupSets for stems
>>>>> Found 0 missing groupSets
>>>>>
>>>>>
>>>>> Searching for missing immediate groupSets where the owner is an
>>>>> attribute def
>>>>> Found 0 missing groupSets
>>>>>
>>>>>
>>>>> Searching for missing immediate groupSets where the owner is a group
>>>>> Found 0 missing groupSets
>>>>>
>>>>>
>>>>> Searching for missing immediate groupSets where the owner is a stem
>>>>> Found 0 missing groupSets
>>>>>
>>>>> On 2/6/12 3:29 PM, Shilen Patel wrote:
>>>>>
>>>>>> What happens if you run the following using GSH?
>>>>>>
>>>>>> new
>>>>>>
>>>>>>
>>>>>>edu.internet2.middleware.grouper.misc.AddMissingGroupSets().saveUpdat
>>>>>>es
>>>>>> (fal
>>>>>>
>>>>>> se).addAllMissingGroupSets()
>>>>>>
>>>>>> And do either of these SQL queries give you anything back?
>>>>>>
>>>>>> select * from grouper_composites where owner not in (select owner_id
>>>>>> from
>>>>>> grouper_group_set where mship_type='composite' and depth='0');
>>>>>> select * from grouper_group_set where mship_type='composite' and
>>>>>> depth='0'
>>>>>> and owner_id not in (select owner from grouper_composites);
>>>>>>
>>>>>>
>>>>>> I'm wondering if your database may be missing some groupSets
>>>>>>somehow,
>>>>>> which can lead to odd issues like the ones you've described.
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>> -- Shilen
>>>>>>
>>>>>>
>>>>>> On 2/6/12 3:10 PM, "Colin
>>>>>> Hudler"<>
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>> Thanks for asking. It is a nice piece of the puzzle. It finds a lot
>>>>>>> of
>>>>>>> "bad" memberships in some composite groups, but nothing is output
>>>>>>>for
>>>>>>> this group.
>>>>>>>
>>>>>>> The findbad utility is something else I've been puzzling over for a
>>>>>>> while; it often reports the same bad groups even when they have
>>>>>>>been
>>>>>>> freshly recreated and *nothing else* in the registry has changed.
>>>>>>>It
>>>>>>> does not consistently identify the same groups as bad between runs,
>>>>>>> although they are always large composite. A couple of times it
>>>>>>>output
>>>>>>> entirely different "bad" groups. However, mostly it identifies the
>>>>>>> same
>>>>>>> list, but they seem unfixable.
>>>>>>>
>>>>>>> On one occasion, I suspect that the delComposite/addComposite GSH
>>>>>>> script
>>>>>>> utterly destroyed the membership for the group referenced below,
>>>>>>> which I
>>>>>>> am now attempting to repair. I know that there's more to the story,
>>>>>>> since that wouldn't be possible in theory. However, I verified that
>>>>>>> none
>>>>>>> of our automations modified the group, and the audit log claims the
>>>>>>> membership was not changed (although it is empty, down from about
>>>>>>> 18k).
>>>>>>>
>>>>>>> On 2/6/12 1:48 PM, Chris Hyzer wrote:
>>>>>>>
>>>>>>>> What happens when you run the bad membership finder?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>https://spaces.internet2.edu/display/Grouper/Bad+Membership+Finder+
>>>>>>>>Ut
>>>>>>>> ilit
>>>>>>>>
>>>>>>>> y
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Chris
>>>>>>>>
>>>>>>>>
>>>>>>>> -----Original Message-----
>>>>>>>> From:
>>>>>>>>
>>>>>>>> [mailto:]
>>>>>>>> On Behalf Of Colin
>>>>>>>> Hudler
>>>>>>>> Sent: Monday, February 06, 2012 2:36 PM
>>>>>>>> To:
>>>>>>>>
>>>>>>>> Subject: [grouper-users] save certain member to a group ->
>>>>>>>> MembershipNotFoundException
>>>>>>>>
>>>>>>>> Grouper 1.6.3. A group that worked fine until today stopped
>>>>>>>>allowing
>>>>>>>> addition of some members. I can add many members except a few,
>>>>>>>>but I
>>>>>>>> don't know why only some cannot be added. Using API, UI, or GSH,
>>>>>>>>the
>>>>>>>> following error happens:
>>>>>>>>
>>>>>>>>
>>>>>>>> edu/internet2/middleware/grouper/Group.java:877:in `callback':
>>>>>>>> java.lang.RuntimeException:
>>>>>>>>
>>>>>>>>
>>>>>>>>edu.internet2.middleware.grouper.exception.MembershipNotFoundExcept
>>>>>>>>io
>>>>>>>> n:
>>>>>>>>
>>>>>>>> Exception in save: edu.internet2.middleware.grouper.Membership,
>>>>>>>> edu.internet2.middleware.grouper.hibernate.ByObject@3097aa41,
>>>>>>>> (NativeException)
>>>>>>>> Problem in HibernateSession: HibernateSession: isNew: false,
>>>>>>>> isReadonly:
>>>>>>>> false, grouperTransactionType: READ_WRITE_NEW,
>>>>>>>> Exception in save: edu.internet2.middleware.grouper.Membership,
>>>>>>>> ByObjectStatic, query: ', cacheable: null, cacheRegion: null,
>>>>>>>> entityName: ImmediateMembershipEntry, tx type: null,
>>>>>>>> , group name: uc:Reference:affiliations:effective:student,
>>>>>>>>subject:
>>>>>>>> Subject id: 30876453U, sourceId: ucmcdb, field: members,
>>>>>>>> Problem in HibernateSession: HibernateSession: isNew: true,
>>>>>>>> isReadonly:
>>>>>>>> false, grouperTransactionType: READ_WRITE_NEW
>>>>>>>> from
>>>>>>>>
>>>>>>>>
>>>>>>>>edu/internet2/middleware/grouper/hibernate/HibernateSession.java:50
>>>>>>>>0:
>>>>>>>> in
>>>>>>>>
>>>>>>>> `callbackHibernateSession'
>>>>>>>> from
>>>>>>>>edu/internet2/middleware/grouper/Group.java:832:in
>>>>>>>> `internal_addMember'
>>>>>>>> from
>>>>>>>>edu/internet2/middleware/grouper/Group.java:785:in
>>>>>>>> `addMember'
>>>>>>>> from
>>>>>>>>edu/internet2/middleware/grouper/Group.java:704:in
>>>>>>>> `addMember'
>>>>>>>> from
>>>>>>>>edu/internet2/middleware/grouper/Group.java:667:in
>>>>>>>> `addMember'
>>>>>>>> ....
>>>>>>>>
>>>>>>>> It always happens and always for the same subjects. Thousands of
>>>>>>>> other
>>>>>>>> subjects can be added or removed from the group. Any help?
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>




Archive powered by MHonArc 2.6.16.

Top of Page