Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Detecting membership changes

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Detecting membership changes


Chronological Thread 
  • From: Julio Polo <>
  • To: Shilen Patel <>
  • Cc: Chris Hyzer <>, "" <>
  • Subject: Re: [grouper-users] Detecting membership changes
  • Date: Mon, 10 Oct 2011 09:48:03 -1000

We upgraded from 1.6 to 2.0. We followed the instructions at

https://spaces.internet2.edu/display/Grouper/v2.0+Upgrade+Instructions+from+v1.6.*

and we think we ran step #4. I am pretty sure we didn't run #5. The
change_log_entry_temp only has 16 rows, and the created_on column
shows these values (sorted ascending):

1316145080923000
1316145081025000
1316145123271000
1316145123310000
1317784599100000
1317784599316000
1317784754705000
1317784754760000
1317784754780000
1317784794581000
1317784812914000
1317784820199000
1317784979601000
1317784995204000
1317785001418000
1318043275452000

We upgraded around 9/15/2011, so if the above timestamps (don't know
how to decode them) include anything prior, it would mean that we
didn't clear the temp changelog right?

Shall we attempt to run #4 or #5 again? If so, do we need to
stop/start anything first? This is a test instance of Grouper, so we
don't mind wiping data as long as it doesn't corrupt the installation.

If you still need the dump of grouper_change_log_entry_temp and
grouper_error.log, let me know. Thanks.

Julio Polo
Identity and Access Management
University of Hawaii


On Sat, Oct 8, 2011 at 3:27 AM, Shilen Patel
<>
wrote:
> Chris, this doesn't appear to be the same issue we found a few days ago.
> Regardless, I'll get that fixed soon and we can release 2.0.1.
>
> I don't think it's the same issue because of this from Julio's output:
>
>  // Duplicate entry '' for key 'PRIMARY'
>
> I think that would seem to suggest that the membership id field in the
> temp change log entry was empty.  Julio, did you upgrade from 1.6 to 2.0
> or did you install a fresh 2.0 database?  I could see this happening if
> you upgraded but didn't clear out your temp change log before upgrading.
>
>
> Otherwise, if you don't mind, can you send me the results of the following
> query along with the full stack trace from grouper_error.log?
>
> select * from grouper_change_log_entry_temp e, grouper_change_log_type t
> where e.change_log_type_id = t.id and (string01 is null or string01 like
> '');
>
> If this has data that you don't want to email (for instance if it's
> production data), let me know and I'll give you a modified query.
>
> Thanks!
>
>
> -- Shilen
>
>
> On 10/8/11 12:17 AM, "Chris Hyzer"
> <>
> wrote:
>
>>Looks good to me, though there is an issue with the change log in 2.0,
>>which maybe Shilen can reply and say if he thinks this is that issue.  If
>>there is not a workaround, I think we might need to release a 2.0.1...
>>Shilen, let us know
>>
>>Thanks,
>>Chris
>>
>>-----Original Message-----
>>From: Julio Polo
>>[mailto:]
>>Sent: Friday, October 07, 2011 11:42 PM
>>To: Chris Hyzer
>>Cc:
>>
>>Subject: Re: [grouper-users] Detecting membership changes
>>
>>Thanks Chris.  I am giving rules a try, but i get this error when I
>>try to mimic the GSH test case for emailOnFlattenedMembershipRemove.
>>Here's the gsh session:
>>
>>gsh 0% grouperSession = GrouperSession.startRootSession();
>>
>>gsh 1% new
>>GrouperEmail().setTo("").setBody("email
>>body").setSubject("email subject").send();
>>// received above test email
>>
>>gsh 3% group = GroupFinder.findByName                  (
>>grouperSession, "test:julio:personnel-officers" )
>>
>>gsh 4%
>>RuleApi.emailOnFlattenedMembershipRemove(SubjectFinder.findRootSubject(),
>>group,
>>"",
>> "Will remove ${safeSubject.emailAddress}
>>from group ${groupDisplayExtension}", "template:
>>testEmailGroupBodyFlattenedRemove");
>>edu.internet2.middleware.grouper.attr.assign.AttributeAssign:
>>AttributeAssign[id=c3c1b5b3ec7c4540a687f7956f99ec2d,action=assign,attribut
>>eDefName=etc:attribute:rules:rule,
>>
>>group=Group[name=test:julio:personnel-officers,uuid=60e26667f2ce44d5841d9b
>>e97e3d04a5]]
>>
>>  gsh 5%
>>edu.internet2.middleware.grouper.app.loader.GrouperLoader.runOnceByJobName
>>(grouperSession,
>>"CHANGE_LOG_changeLogTempToChangeLog");
>>  // Error: unable to evaluate command: Sourced file: inline
>>evaluation of:
>>``edu.internet2.middleware.grouper.app.loader.GrouperLoader.runOnceByJobNa
>>me(group
>>. . . '' : Method Invocation
>>edu.internet2.middleware.grouper.app.loader.GrouperLoader.runOnceByJobName
>>  // See error log for full stacktrace
>>  // caused by: java.lang.RuntimeException:
>>  // edu.internet2.middleware.grouper.internal.dao.GrouperDAOException:
>>Problem in HibernateSession: HibernateSession: isNew: false,
>>isReadonly: false, grouperTransactionType: READ_WRITE_NEW,
>>  Exception in saveOrUpdate:
>>edu.internet2.middleware.grouper.pit.PITMembership, ByObjectStatic,
>>query: ', cacheable: null, cacheRegion: null, entityName: null, tx
>>type: null,
>>  Problem in HibernateSession: HibernateSession: isNew: true,
>>isReadonly: false, grouperTransactionType: READ_WRITE_NEW
>>  // caused by:
>>edu.internet2.middleware.grouper.internal.dao.GrouperDAOException:
>>  // Problem in HibernateSession: HibernateSession: isNew: false,
>>isReadonly: false, grouperTransactionType: READ_WRITE_NEW,
>>  Exception in saveOrUpdate:
>>edu.internet2.middleware.grouper.pit.PITMembership, ByObjectStatic,
>>query: ', cacheable: null, cacheRegion: null, entityName: null, tx
>>type: null,
>>  Problem in HibernateSession: HibernateSession: isNew: true,
>>isReadonly: false, grouperTransactionType: READ_WRITE_NEW
>>  // caused by: org.hibernate.exception.ConstraintViolationException:
>>  // Could not execute JDBC batch update,
>>  Exception in save:
>>edu.internet2.middleware.grouper.pit.PITMembership,
>>edu.internet2.middleware.grouper.hibernate.ByObject@715d1298
>>  // caused by: java.sql.BatchUpdateException:
>>  // Duplicate entry '' for key 'PRIMARY'
>>
>>
>>We recently installed this instance of Grouper 2.0.   the
>>grouper-loader.properties shows this:
>>
>>#rules consumer, needed for some of the Grouper rule types to run
>>(e.g. flattenedMembershipRemove, flattenedMembershipAdd)
>>changeLog.consumer.grouperRules.class =
>>edu.internet2.middleware.grouper.changeLog.esb.consumer.RuleConsumer
>>changeLog.consumer.grouperRules.quartzCron =
>>
>>and changeLog is enabled in grouper.properties.
>>
>>What did we miss?
>>
>>Julio Polo
>>Identity and Access Management
>>University of Hawaii
>>
>>
>>
>>On Fri, Oct 7, 2011 at 10:32 AM, Chris Hyzer
>><>
>>wrote:
>>> We have the last membership changed in the DB, but we don't expose over
>>>WS, I supposed we could in a later version.
>>>
>>> If you have 2.0, there is a rule for email notifications:
>>>
>>>
>>>https://spaces.internet2.edu/display/Grouper/Grouper+rules+use+case+-+Ema
>>>il+notification+on+flattened+membership+remove
>>>
>>> You could need a rule for add, and a rule for remove.  Note you can
>>>have this work for all groups in a folder with one rule.
>>>
>>> Also, (applies to pre-2.0), you could use the change log to send an
>>>event somewhere (e.g. xmpp or ws), or send them email directly from the
>>>change log consumer.  This would be very easy to setup and I could send
>>>you a code example if you need it.   Just send me the exact requirements.
>>>
>>> Generally the architecture of the change log allows us to avoid polling
>>>via ws (has the membership changed?  Has the membership changed?  Has
>>>the memberships changed? Etc) which is why it might not be ideal to add
>>>to the WS api :)
>>>
>>> Thanks,
>>> Chris
>>>
>>> -----Original Message-----
>>> From:
>>>
>>>[mailto:]
>>> On Behalf Of Julio Polo
>>> Sent: Friday, October 07, 2011 4:05 PM
>>> To:
>>>
>>> Subject: [grouper-users] Detecting membership changes
>>>
>>> Is there a web service for detecting whether members have been added
>>> or removed from a group?  I'm contemplating an application that sends
>>> us email whenever someone is added or removed from a group.  Is the
>>> audit functionality the best way to achieve this?  I didn't see a web
>>> service for it, though.  Or shall we just do a periodic dump of the
>>> entire membership and diff for changes?
>>>
>>> Julio Polo
>>> Identity and Access Management
>>> University of Hawaii
>>>
>
>



Archive powered by MHonArc 2.6.16.

Top of Page