grouper-users - Re: [grouper-users] unable to add group to group field (2.3)
Subject: Grouper Users - Open Discussion List
List archive
- From: Jim Fox <>
- To: Shilen Patel <>
- Cc: "" <>
- Subject: Re: [grouper-users] unable to add group to group field (2.3)
- Date: Mon, 7 Aug 2017 11:13:27 -0700 (PDT)
- Ironport-phdr: 9a23:FULwSRSfx+m7vCnsxGWjK+uwNtpsv+yvbD5Q0YIujvd0So/mwa6ybRSN2/xhgRfzUJnB7Loc0qyN4vCmATRIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSijewZbB/IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbDVwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4rx1QxH0ligIKz858HnWisNuiqJbvAmhrAF7z4LNfY2ZKOZycqbbcNgHR2ROQ9xRWjRPDI28cYUBEugOM+VWr4bzqFQBsQCzBRWwCO711jNEmmX70bM83u88EQ/GxgsgH9cWvXrQrdX1MboZX+CyzKjH0D7OaP1W2TDy6YXTfBEuu+qMXbJxccrXxkkvCwTFjlOKpYP7IjyVy/0Avm6G5ORuUuKvjnQoqwB3ojW33cgtio7JiZkXyl/a6Sp53J01JcGiR05nYN6rDIFctzqAOItoXMwuW2FouCchxbAIvJ60Yi0Kx485yB7FcPyHc4mI4gr+W+mLJjd0nmlld6ihhxms6USv0e39Vs6v31ZIsCVKjsXMumoW1xPJ9MiIVP1w9Vqi1zaXzw3f9/9ILEMumaffK5Mt2KA8m5UNvUjZACP6hlv6gLeLekk6+eWk8frrbqnlq5OGK4N4kADzP6IzkcKlG+s4KBIBX22D9OS8yrLj+Ur5Ta1Pjvw5lanZrYzaKdoFqqKjGA9ZyJsj6hilAzi4zdsYgGELLFNDeB2Zk4jkI0zCLO77APulh1mhkC1ny+7JM7H/GJnBMGbPnKn5cbZ48UFcyQ4zzd5F55JTD7EMOPzzWkj+tdHDAB42KRe0w+bmCNV72YMeRWWPAqmDPKzMrFCI+/ojI/OQa48NpDb9N/8l6ubhjX8jnl8dYLGp0oUNaHyhA/RmOFuWYWD3gtoaFWcKvxE+TPDxiFGcSzJTZnCyX74i6TEhDoKpE5vDSp63jLOfwSi7A84eWmcTMVCNFXruP72NR/oIIHaJIs5lnzosWaWiRsks2Qz45yHgzL8yDOvRsgMfpdq32t9lz/LajhEz8zNoCMLb3m2QGTIn1lgUTiM7ifgs6Xd2zU2OhO0h26RV
Each entry has a parent that points to itself. It looks like the extra records were added by the postGrouper2_2Upgrade.gsh script.
Here's an example: (the field is an additional field "authorized-senders")
Before the database upgrade:
gws2=# select * from grouper_group_set where
owner_group_id='f3b40a4e32234911828a0b0cb5a15398' and
field_id='0094f3965ca2419286d3c4c3c9a1fb4e';
id | owner_attr_def_id | owner_attr_def_id_null | owner_group_id | owner_group_id_null | owner_stem_id | owner_stem_id_null | member_attr_def_id | member_group_id | member_stem_id | member_id | field_id | member_field_id | mship_type | depth | via_group_id | parent_id | creator_id | create_time | context_id | hibernate_version_number | owner_id ----------------------------------+-------------------+------------------------+----------------------------------+----------------------------------+---------------+--------------------+--------------------+----------------------------------+----------------+------------ ----------------------+----------------------------------+----------------------------------+------------+-------+--------------+----------------------------------+----------------------------------+---------------+----------------------------------+---------------------- ----+----------------------------------
49f469bcac924d88800ae84bd4b8c4f2 | | <NULL> |
f3b40a4e32234911828a0b0cb5a15398 | f3b40a4e32234911828a0b0cb5a15398 | |
<NULL> | | f3b40a4e32234911828a0b0cb5a15398 |
| f3b40a4e32234911828a0b0cb5a15398 | 0094f3965ca2419286d3c4c3c9a1fb4e |
0094f3965ca2419286d3c4c3c9a1fb4e | immediate | 0 | |
49f469bcac924d88800ae84bd4b8c4f2 | ae9d557880224fc8a69fc0c437a0dc73 | 1285028184139 |
456ef209df56471a9c3f081e90617c01 | 0 |
f3b40a4e32234911828a0b0cb5a15398
(1 row)
After the upgrade:
gwstest230=# select * from grouper_group_set where
owner_group_id='f3b40a4e32234911828a0b0cb5a15398' and
field_id='0094f3965ca2419286d3c4c3c9a1fb4e';
id | owner_attr_def_id | owner_attr_def_id_null | owner_group_id | owner_group_id_null | owner_stem_id | owner_stem_id_null | member_attr_def_id | member_group_id | member_stem_id | member_id | field_id | member_field_id | mship_type | depth | via_group_id | parent_id | creator_id | create_time | context_id | hibernate_version_number | owner_id ----------------------------------+-------------------+------------------------+----------------------------------+----------------------------------+---------------+--------------------+- -------------------+----------------------------------+----------------+----------------------------------+----------------------------------+----------------------------------+----------- -+-------+--------------+----------------------------------+----------------------------------+---------------+----------------------------------+--------------------------+--------------- -------------------
49f469bcac924d88800ae84bd4b8c4f2 | | <NULL> |
f3b40a4e32234911828a0b0cb5a15398 | f3b40a4e32234911828a0b0cb5a15398 | |
<NULL> | | f3b40a4e32234911828a0b0cb5a15398 | |
f3b40a4e32234911828a0b0cb5a15398 | 0094f3965ca2419286d3c4c3c9a1fb4e |
0094f3965ca2419286d3c4c3c9a1fb4e | immediate | 0 | |
49f469bcac924d88800ae84bd4b8c4f2 | ae9d557880224fc8a69fc0c437a0dc73 | 1285028184139 |
456ef209df56471a9c3f081e90617c01 | 0 |
f3b40a4e32234911828a0b0cb5a15398
858fc2ad18724714b3e933226865b5f1 | | <NULL> |
f3b40a4e32234911828a0b0cb5a15398 | f3b40a4e32234911828a0b0cb5a15398 | |
<NULL> | | f3b40a4e32234911828a0b0cb5a15398 | |
f3b40a4e32234911828a0b0cb5a15398 | 0094f3965ca2419286d3c4c3c9a1fb4e |
0094f3965ca2419286d3c4c3c9a1fb4e | immediate | 0 | |
858fc2ad18724714b3e933226865b5f1 | c9f6837335d64af8a82f37f929e80e56 | 1479152137786 |
ad534326b9e34a30a89a7154ee5e9e0c | 0 |
f3b40a4e32234911828a0b0cb5a15398
(2 rows)
All of the extra records seem to have a timestamp around 1479152......
Can I just delete all the second records?
Jim
On Fri, 4 Aug 2017, Shilen Patel wrote:
Date: Fri, 4 Aug 2017 04:35:00
From: Shilen Patel
<>
To: Jim Fox
<>
Cc:
""
<>
Subject: Re: [grouper-users] unable to add group to group field (2.3)
What is grouper_group_sets for?
It's used to efficiently calculate effective memberships.
How did I get duplicates? Something from the 2.1->2.3 upgrade?
Possibly. The upgrade does add some group sets, but I can't see how it
would have added duplicates unless you were running multiple instances of
the upgrade at the same time. There is a create_time column on the group
set table so that may tell you when the duplicates were added. Also, what
fields do the field_id columns correspond to in the duplicates?
How do I get rid of them?
Hopefully, for each set of duplicates, no more than 1 has a foreign key to
another group set. If that's the case, it should be safe to just delete
one row without a foreign key. Would a patch help?
- Shilen
On 8/3/17, 6:46 PM, "Jim Fox"
<>
wrote:
I do seem to have duplicates. In this case there are two entries that
differ only in parent_id.
What is grouper_group_sets for?
How did I get duplicates? Something from the 2.1->2.3 upgrade?
How do I get rid of them?
Thanks,
Jim
On Thu, 3 Aug 2017, Shilen Patel wrote:
Date: Thu, 3 Aug 2017 15:32:01
From: Shilen Patel
<>
To: Jim Fox
<>
Cc:
""
<>
Subject: Re: [grouper-users] unable to add group to group field (2.3)
Looks like you may have duplicates in your group set table. I don't
think bad membership finder catches that right now. I can add it there,
but
you can verify by running this I think:
select owner_group_id, member_group_id, field_id from grouper_group_set
where depth='0' and owner_group_id is not null and member_group_id is not
null and field_id is not null group by owner_group_id, member_group_id,
field_id having count(*) > 1
Thanks!
- Shilen
On 8/3/17, 6:13 PM, "Jim Fox"
<>
wrote:
This is experimenting with grouper api 2.3
I am trying to add a group as a field member (not membership). I get an
exception: (sorry for the messay post)
I am able to add non-group subjects.
Something to do with group sets?
Jim
------------------------------------------------------
Aug 03, 2017 2:59:11 PM org.apache.catalina.core.StandardWrapperValve
invoke
SEVERE: Servlet.service() for servlet [gws] in context with path
[/gws_grouper] threw exception [Request processing failed; nested
exception
is java.lang.RuntimeException:
edu.internet2.middleware.grouper.internal.dao.GrouperDAOException:
Problem in HibernateSession:
HibernateSession (6c4c2a54): notNew, notReadonly, READ_WRITE_NEW,
activeTransaction, session (5bd96f94),
Exception in uniqueResult: (class
edu.internet2.middleware.grouper.group.GroupSet), ByHqlStatic, query:
'select gs from GroupSet as gs where
gs.ownerGroupId = :id and memberGroupId = :id and fieldId = :field and
depth='0'', cacheable: true, cacheRegion:
edu.internet2.middleware.grouper.internal.dao.hib3.Hib3GroupSetDAO.FindSe
lfGroup, tx type: null, tx type: nullBind var[0]: 'Param (class
java.lang.String): 'id'->'881fef48f9e32bedf88b8fe5d96ed250'Bind var[1]:
'Param (class java.lang.String):
'field'->'0094f3965ca2419286d3c4c3c9a1fb4e', ,
Exception in save: edu.internet2.middleware.grouper.Membership,
edu.internet2.middleware.grouper.hibernate.ByObject@44744e2e,
Problem in HibernateSession: HibernateSession (6e7b95d1): notNew,
notReadonly, READ_WRITE_NEW, activeTransaction, session (5bd96f94),
Exception in save: edu.internet2.middleware.grouper.Membership,
ByObjectStatic, query: ', cacheable: null, cacheRegion: null, entityName:
ImmediateMembershipEntry, tx type: null,
, group name: u:fox:spud97, subject: Subject groupName: u:fox:spud97,
sourceId: g:gsa, field: authorized-senders,
Problem in HibernateSession: HibernateSession (29610a0e): new,
notReadonly, READ_WRITE_NEW, notActiveTransaction, session (5bd96f94)]
with
root cause
org.hibernate.NonUniqueResultException: query did not return a unique
result: 2
at
org.hibernate.internal.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.
java:971)
at
org.hibernate.internal.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.j
ava:960)
at
edu.internet2.middleware.grouper.hibernate.ByHql.uniqueResult(ByHql.java:
282)
at
edu.internet2.middleware.grouper.hibernate.ByHqlStatic$1.callback(ByHqlSt
atic.java:348)
at
edu.internet2.middleware.grouper.hibernate.HibernateSession.callbackHiber
nateSession(HibernateSession.java:700)
at
edu.internet2.middleware.grouper.hibernate.ByHqlStatic.uniqueResult(ByHql
Static.java:339)
at
edu.internet2.middleware.grouper.internal.dao.hib3.Hib3GroupSetDAO.findSe
lfGroup(Hib3GroupSetDAO.java:356)
at
edu.internet2.middleware.grouper.Membership.processPostMembershipSaveOrUp
date(Membership.java:2135)
at
edu.internet2.middleware.grouper.Membership.onPostSave(Membership.java:19
97)
at
edu.internet2.middleware.grouper.hibernate.ByObject.save(ByObject.java:22
4)
at
edu.internet2.middleware.grouper.hibernate.ByObjectStatic$7.callback(ByOb
jectStatic.java:494)
at
edu.internet2.middleware.grouper.hibernate.HibernateSession.callbackHiber
nateSession(HibernateSession.java:700)
at
edu.internet2.middleware.grouper.hibernate.ByObjectStatic.save(ByObjectSt
atic.java:481)
at
edu.internet2.middleware.grouper.internal.dao.hib3.Hib3MembershipDAO.save
(Hib3MembershipDAO.java:2053)
at
edu.internet2.middleware.grouper.Membership.internal_addImmediateMembersh
ip(Membership.java:1246)
at
edu.internet2.middleware.grouper.Group$4.callback(Group.java:1392)
at
edu.internet2.middleware.grouper.hibernate.HibernateSession.callbackHiber
nateSession(HibernateSession.java:700)
at
edu.internet2.middleware.grouper.Group.internal_addMember(Group.java:1364
)
at
edu.internet2.middleware.grouper.Group.addMember(Group.java:938)
at
edu.internet2.middleware.grouper.Group.addMember(Group.java:899)
at
edu.washington.gws.group.grouper.GrouperGroupFactory.updateFieldMembers(G
rouperGroupFactory.java:848)
...
- [grouper-users] unable to add group to group field (2.3), Jim Fox, 08/03/2017
- Re: [grouper-users] unable to add group to group field (2.3), Shilen Patel, 08/03/2017
- Re: [grouper-users] unable to add group to group field (2.3), Jim Fox, 08/03/2017
- Re: [grouper-users] unable to add group to group field (2.3), Shilen Patel, 08/04/2017
- Re: [grouper-users] unable to add group to group field (2.3), Shilen Patel, 08/04/2017
- Re: [grouper-users] unable to add group to group field (2.3), Jim Fox, 08/04/2017
- Re: [grouper-users] unable to add group to group field (2.3), Jim Fox, 08/08/2017
- Re: [grouper-users] unable to add group to group field (2.3), Shilen Patel, 08/09/2017
- Re: [grouper-users] unable to add group to group field (2.3), Jim Fox, 08/07/2017
- Re: [grouper-users] unable to add group to group field (2.3), Shilen Patel, 08/04/2017
- Re: [grouper-users] unable to add group to group field (2.3), Shilen Patel, 08/04/2017
- Re: [grouper-users] unable to add group to group field (2.3), Jim Fox, 08/03/2017
- Re: [grouper-users] unable to add group to group field (2.3), Shilen Patel, 08/03/2017
Archive powered by MHonArc 2.6.19.