Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-14565

AM Upgrade NPE when unable to read operational attrs from directory

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.5.0.1, 7.0.0
    • Fix Version/s: 6.5.2, 7.0.0
    • Component/s: upgrade
    • Labels:
    • Target Version/s:
    • Sprint:
      AM Sustaining Sprint 60, AM Sustaining Sprint 61, AM Sustaining Sprint 62
    • Story Points:
      3
    • Needs QA verification:
      No
    • Functional tests:
      No
    • Are the reproduction steps defined?:
      Yes and I used the same an in the description

      Description

      Bug description

      When performing an AM upgrade (e.g. 6.5.0 to 6.5.0.1 and using DJ 6.5.0 with am-config production profile), the upgrade wizard fails to enable the Upgrade link on the first page.  Reviewing the amUpgrade logs reveals a NullPointerException...

      ERROR: Unable to read directory schema, the schema won't be upgraded
      No Results Returned: The entry ou=am-config does not include a subschemaSubentry attribute
      at org.forgerock.opendj.ldap.LdapException.newLdapException(LdapException.java:246)

      ...

      ERROR: An error occurred while initializing upgrade steps

      java.lang.NullPointerException

              at org.forgerock.openam.upgrade.DirectoryContentUpgrader$UpgradeCTSToMultiValue.isUpgradeNecessary(DirectoryContentUpgrader.java:369)

              at org.forgerock.openam.upgrade.DirectoryContentUpgrader.<init>(DirectoryContentUpgrader.java:162)

      This is related to OPENAM-14333, but focussed at making the AM upgrade provide a more graceful failure/warning when it does not have read permission for operational attributes in the directory.

      How to reproduce the issue

      As per OPENAM-14333.

      Expected behaviour
      Upgrade should proceed successfully or a warning/error should be provided that better indicates the nature of the failure.
      
      Current behaviour
      The Upgrade link is greyed out and the amUpgrade logs provide the error information detailed above.

      Work around

      None

      Code analysis

      The DirectoryContentUpgrader, line 369 does not have a null guard check in place, causing the NPE.  There are other places also within the same class that could benefit.  However, need to consider/test what will happen if this initialization does not fail and directory schema upgrade is required.

        Attachments

          Activity

            People

            • Assignee:
              lawrence.yarham Lawrence Yarham
              Reporter:
              lawrence.yarham Lawrence Yarham
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: