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

Comparison method violates its general contract! seen during amster import

    Details

    • Sprint:
      AM Sustaining Sprint 57, AM Sustaining Sprint 58, AM Sustaining Sprint 59
    • Story Points:
      5
    • Needs backport:
      Yes
    • Support Ticket IDs:
    • Verified Version/s:
    • Functional tests:
      Yes
    • Are the reproduction steps defined?:
      Yes and I used the same an in the description

      Description

      Bug description

      During an amster import the following exception can be sometimes seen:

      ...<SNIP>
      amster_stack_1 | Imported /config/amster/config/global/Platform.json
      amster_stack_1 | Imported /config/amster/config/global/Realms/root-DE.json
      amster_stack_1 | Imported /config/amster/config/global/Realms/root.json
      amster_stack_1 | Imported /config/amster/config/global/Realms/root-NL.json
      amster_stack_1 | ERROR java.lang.IllegalArgumentException:
      amster_stack_1 | Comparison method violates its general contract!
      amster_stack_1 |     at org.forgerock.openam.amster.loadster.importer.Importer.sortRealmEntitiesByImportOrder (Importer.groovy:187)
      amster_stack_1 |     at org.forgerock.openam.amster.loadster.importer.Importer.access$3 (Importer.groovy)
      amster_stack_1 |     at org.forgerock.openam.amster.loadster.importer.Importer$_importRealmsEntities_closure8.doCall (Importer.groovy:162)
      amster_stack_1 |     at org.forgerock.openam.amster.loadster.importer.Importer$_importRealmsEntities_closure8.call (Importer.groovy)
      amster_stack_1 |     at org.forgerock.openam.amster.loadster.importer.Importer.importRealmsEntities (Importer.groovy:159)
      amster_stack_1 |     at org.forgerock.openam.amster.loadster.importer.Importer.importDirectory (Importer.groovy:116)
      amster_stack_1 |     at org.forgerock.openam.amster.loadster.importer.Importer.importEntities (Importer.groovy:105)
      amster_stack_1 |     at org.forgerock.openam.amster.commands.ImportCommand.execute (ImportCommand.groovy:55)
      amster_stack_1 |     at org.forgerock.openam.amster.Main$_addCommandLineWrapping_closure2.doCall (Main.groovy:90)
      amster_stack_1 |     at org.forgerock.openam.amster.Main$_addCommandLineWrapping_closure2.doCall (Main.groovy:90)
      amster_stack_1 |     at java_lang_Runnable$run.call (Unknown Source)
      amster_stack_1 |     at org.forgerock.openam.amster.Main.main (Main.groovy:60)
      amster_stack_1 | amster openam.localtest.me:8443> Configuration script finished
      

       

      Running amster with -d:

      Imported /config/amster/config/global/Realms/root-NL.json
      
      [main] DEBUG org.forgerock.openam.amster.loadster.importer.Importer - Importing /NL realm files
      
      DEBUG [org.codehaus.groovy.tools.shell.InteractiveShellRunner] Work failed: java.lang.IllegalArgumentException: Comparison method violates its general contract!
      
      at java.util.TimSort.mergeLo(TimSort.java:777)
      at java.util.TimSort.mergeAt(TimSort.java:514)
      at java.util.TimSort.mergeCollapse(TimSort.java:441)
      at java.util.TimSort.sort(TimSort.java:245)
      at java.util.Arrays.sort(Arrays.java:1512)
      at java.util.ArrayList.sort(ArrayList.java:1454)
      at java.util.Collections.sort(Collections.java:175)
      ...

       

      How to reproduce the issue

      1). Export configuration using amster

      2). Import configuration using amster

      Note: the possible environmental issue here is that the amster import files are in a different filesystem to amster itself.  In this case the issue has been intermittently observed when the amster import files were on a host system accessed via a Docker Volume mount:

      osxfs           932G  533G  391G  58% /usr/local/amstermounttest

       

      Expected behaviour
      amster import should complete
      Current behaviour
      amster import fails with the errors noted above

      Work around

      Ensure that the amster import files are on the same container as amster itself.

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jonthomas Jonathan Thomas
                Reporter:
                andy.itter Andy Itter
              • Votes:
                3 Vote for this issue
                Watchers:
                17 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: