Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-2632

java.lang.RuntimeException in a LDAP_GROUP_LIST loader that worked correctly in grouper 2.3

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 2.4.0
    • grouperLoader
    • None

    Description

      We are currently migrating/upgrading our grouper 2.3 to the containerized 2.4 and we have run into a major difference of behavior between the LDAP implementations of Grouper 2.3 and the two from 2.4^1^ that cause a loader that used to run correctly on 2.3 to produce the following stack trace:

      java.lang.RuntimeException: java.util.NoSuchElementException: Error querying ldap server id: ldapr, searchDn: ou=groupes,dc=something,dc=ca, filter: '(cn=filter*)', returning subject attribute: member
      	at edu.internet2.middleware.grouper.app.loader.db.GrouperLoaderResultset.initForLdapListOfGroups(GrouperLoaderResultset.java:752)
      	at edu.internet2.middleware.grouper.app.loader.GrouperLoaderType$10.runJob(GrouperLoaderType.java:1011)
      	at edu.internet2.middleware.grouper.app.loader.GrouperLoaderJob.runJobLdap(GrouperLoaderJob.java:642)
      	at edu.internet2.middleware.grouper.app.loader.GrouperLoaderJob.execute(GrouperLoaderJob.java:337)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
      Caused by: java.util.NoSuchElementException: Error querying ldap server id: ldapr, searchDn: ou=groupes,dc=something,dc=ca, filter: '(cn=filter*)', returning subject attribute: member
      	at java.util.ArrayList$Itr.next(ArrayList.java:862)
      	at edu.internet2.middleware.grouper.app.loader.db.GrouperLoaderResultset.initForLdapListOfGroups(GrouperLoaderResultset.java:689)
      	... 5 more
      

      This exception occurs when an attribute declared in "Extra LDAP attributes"2 ** is absent in some results rows (it is normal for optional attributes to be absent). I initially traced the bug to that faulty construct in GrouperLoaderResultset :

      String attributeValue = groupAttribute.getStringValues().iterator().next();
      

      And I feel that the correct patch would be to add the following condition :

      if(!attribute.getValues().isEmpty())
      

      before https://github.com/Internet2/grouper/blob/5e07ec70005ef066acf9505bcb7329a5a6c9a991/grouper/src/grouper/edu/internet2/middleware/grouper/ldap/ldaptive/LdaptiveSessionImpl.java#L759 and https://github.com/Internet2/grouper/blob/5e07ec70005ef066acf9505bcb7329a5a6c9a991/grouper/src/grouper/edu/internet2/middleware/grouper/ldap/vtldap/VTLdapSessionImpl.java#L541

       

       

      1. using VTLdapSessionImpl or LdaptiveSessionImpl does not changes the outcome
      2. etc:attribute:loaderLdap:grouperLoaderLdapExtraAttributes

      Attachments

        Activity

          People

            chris.hyzer@at.internet2.edu Chris Hyzer (upenn.edu)
            nicolas.marcotte@at.internet2.edu Nicolas Marcotte (usherbrooke.ca) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: