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

Config upgraded from AM 5.5.1 containing trees fails to be imported

    Details

    • Target Version/s:
    • Needs backport:
      No
    • Needs QA verification:
      No
    • Functional tests:
      No
    • Are the reproduction steps defined?:
      No (add reasons in the comment)

      Description

      Bug description

      If we have a config in AM 5.5.1 that contains trees in subrealms with inner trees, we export it with amster, and then we try to reimport this same config in a fresh am 5.5.1 install, it blows up with an import error
      This same amster config will blow up too if we use the upgrader tool on it, and then try to import the config in AM 6. I am not sure if we can fix the wrong config adding rules to the upgrader tool, or if it is the same bug from 5.5.1 that is still broken in AM6

      How to reproduce the issue

      I left the offending test in a branch

      1. Add this remote: https://stash.forgerock.org/users/pilar.gomez/repos/openam
      2. Checkout the branch bugfix/OPENAM-12996_add_upgrader_tool_tree_tests
      3. Go to the test folder and run the upgrader tool tests:
      temper upgrader-tests --deploy 6.0.0-SNAPSHOT --hostname <your localhost hostname>
      

      NOTE: make sure that you have compiled AM recently if you want the tests to be run against your locally compiled snapshot, otherwise, maven will fetch the most recent snapshot from artifactory

      Expected behaviour

      The upgraded config is imported successfully

      Current behaviour
      ---------------------------------------------------------------------
      Failed to import /var/folders/23/qdzxkytj7t12_xsvl0pz1cnm0000gp/T/1524649586872/realms/root-sub1-subsub1/AuthTree/anotherTreeWithInnerTree.json  : 500 Internal Server Error: Unable to save SMS config: Could not evaluate tree: Could not evaluate tree
      Failed to import /var/folders/23/qdzxkytj7t12_xsvl0pz1cnm0000gp/T/1524649586872/realms/root-sub1/AuthTree/testTree.json  : 500 Internal Server Error: Unable to save SMS config: Could not evaluate tree: Could not evaluate tree
      ">
      	at com.forgerock.openam.amster.upgradester.UpgradeTest.<cuppa test>(UpgradeTest.java:70)
      Failed tests: 
        UpgradeTest.<cuppa test>:70 [Errors occurred during import] 
      Expecting empty but was:<"---------------------------------------------------------------------
         IMPORT ERRORS
      ---------------------------------------------------------------------
      Failed to import /var/folders/23/qdzxkytj7t12_xsvl0pz1cnm0000gp/T/1524649586872/realms/root-sub1-subsub1/AuthTree/anotherTreeWithInnerTree.json  : 500 Internal Server Error: Unable to save SMS config: Could not evaluate tree: Could not evaluate tree
      Failed to import /var/folders/23/qdzxkytj7t12_xsvl0pz1cnm0000gp/T/1524649586872/realms/root-sub1/AuthTree/testTree.json  : 500 Internal Server Error: Unable to save SMS config: Could not evaluate tree: Could not evaluate tree
      ">
      
      

      Work around

      None?

      Code analysis

      We may need new rules in openam/openam-amster-config-upgrader/src/main/rules/5.5.x-to-6.x.x.groovy
      There are also a few related bugs around inner trees and realm creation:
      OPENAM-12948
      OPENAM-12249

        Attachments

          Activity

            People

            • Assignee:
              kajetan.hemzaczek Kajetan Hemzaczek
              Reporter:
              pilar.gomez Pilar Gomez [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: