[OPENAM-14765] Amster import broken since amster build 7.0.0-4b569b9612 Created: 11/Apr/19  Updated: 11/Sep/19  Resolved: 30/Apr/19

Status: Resolved
Project: OpenAM
Component/s: Amster
Affects Version/s: 7.0.0
Fix Version/s: 6.5.2, 7.0.0

Type: Bug Priority: Blocker
Reporter: Lee Baines Assignee: Peter Major [X] (Inactive)
Resolution: Fixed Votes: 0
Labels: AME, Must-Fix, NEWTON
Remaining Estimate: 0h
Time Spent: 16h
Original Estimate: Not Specified

Issue Links:
Depends
Regression
is caused by OPENAM-10958 Amster cannot import configuration wi... Resolved
Relates
relates to OPENAM-13896 Comparison method violates its genera... Resolved
Target Version/s:
Sprint: AM 2019.6 - Lathe

 Description   

Since Amster build 7.0.0-4b569b9612, any Amster import results in the following error:

ERROR java.lang.IllegalArgumentException:
Comparison method violates its general contract!

importPath: /git/config/6.5/default/am/empty-import (forgeops-init)

Any config import results in the same error.

To simply demonstrate:

 

bash-4.4$ ./amster
Amster OpenAM Shell (7.0.0-SNAPSHOT build 7e66023f4e, JVM: 1.8.0_201)
Type ':help' or ':h' for help.
-------------------------------------------------------------------------------
am> 
am> connect -k  /var/run/secrets/amster/id_rsa http://openam/am
amster openam> 
amster openam> export-config --path /opt/amster/am
Export completed successfully
amster openam> 
amster openam> 
amster openam> import-config --path /opt/amster/am
Importing directory /opt/amster/am
ERROR java.lang.IllegalArgumentException:
Comparison method violates its general contract!
        at org.forgerock.openam.amster.loadster.importer.Importer.importGlobalEntities (Importer.groovy:132)
        at org.forgerock.openam.amster.loadster.importer.Importer.importDirectory (Importer.groovy:115)
        at org.forgerock.openam.amster.loadster.importer.Importer.importEntities (Importer.groovy:106)
        at org.forgerock.openam.amster.commands.ImportCommand.execute (ImportCommand.groovy:55)
        at org.forgerock.openam.amster.Main$_addCommandLineWrapping_closure2.doCall (Main.groovy:92)
        at java_lang_Runnable$run.call (Unknown Source)
        at org.forgerock.openam.amster.Main.main (Main.groovy:62)
amster openam>

 

 

This worked as expected up to build 7.0.0-e8f19fd1a1.

 

This is blocking, testing, cloud development and FRaaS team.

 



 Comments   
Comment by Peter Major [X] (Inactive) [ 11/Apr/19 ]

I may have a fix for this locally.

Comment by Lee Baines [ 11/Apr/19 ]

ok great, can this get pushed through quite quickly?

Comment by David Luna [ 11/Apr/19 ]

Happy to be on review if that would help keep things moving.

Comment by Andrew Vinall [ 17/Apr/19 ]

We are still seeing this problem.

Amster OpenAM Shell (7.0.0-SNAPSHOT build 8210c87452, JVM: 1.8.0_201)
Type ':help' or ':h' for help.
-------------------------------------------------------------------------------
am> :load /opt/amster/scripts/01_import.amster
Importing directory /git/config/7.0/smoke-tests/am
ERROR java.lang.IllegalArgumentException:
Comparison method violates its general contract!
        at org.forgerock.openam.amster.loadster.importer.Importer.importGlobalEntities (Importer.groovy:132)
        at org.forgerock.openam.amster.loadster.importer.Importer.importDirectory (Importer.groovy:115)
        at org.forgerock.openam.amster.loadster.importer.Importer.importEntities (Importer.groovy:106)
        at org.forgerock.openam.amster.commands.ImportCommand.execute (ImportCommand.groovy:55)
        at org.forgerock.openam.amster.Main$_addCommandLineWrapping_closure2.doCall (Main.groovy:92)
        at org.forgerock.openam.amster.Main$_addCommandLineWrapping_closure2.doCall (Main.groovy:92)
        at java_lang_Runnable$run.call (Unknown Source)
        at org.forgerock.openam.amster.Main.main (Main.groovy:62)
amster openam> Configuration script finished
Comment by Peter Major [X] (Inactive) [ 18/Apr/19 ]

Second attempt to fix this is now merged. Locally import worked for me.

Comment by Peter Major [X] (Inactive) [ 23/Apr/19 ]

I've found new incarnations of this bug

Comment by Peter Major [X] (Inactive) [ 30/Apr/19 ]

Solving this for the third time now.
The current solution is more stable, but it is still theoretically possible to hit this issue with some exotic configs.

Generated at Wed Nov 25 05:50:00 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.