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

Amster: 'import-config --clean true' fails when server is a member of a site

    Details

    • Sprint:
      AM Sustaining Sprint 66
    • Story Points:
      3
    • Support Ticket IDs:

      Description

      With an AM instance that includes a site definition with one server being a member of that site.
      When I run:
      import-config --clean true

      I get the following error when amster tries to remove the site:

      Cleaning global settings

      Deleting JSON: Global JSON Handler

      Deleting Scripting: 157298c0-7d31-4059-a95b-eeb08473b7e5

      Deleting Scripting: 36863ffb-40ec-48b9-94b1-9a99f71cc3b5

      Deleting Scripting: 703dab1a-1921-4981-98dd-b8e5349d8548

      Deleting Scripting: 7e3d7067-d50f-4674-8c76-a3e13a810c33

      Deleting Scripting: 9de3eb62-f131-4fac-a294-7bd170fd4acb

      Deleting Scripting: c827d2b4-3608-4693-868e-bbcf86bd87c7

      Deleting Sites: site1

      [main] ERROR org.forgerock.openam.sdk.http.DefaultErrorHandler - Unhandled client error: [Status: 412 ]

      ERROR org.forgerock.openam.sdk.http.ClientErrorException:

      412 : Site still has servers attached to it

      at org.forgerock.openam.sdk.http.DefaultErrorHandler.onClientError (DefaultErrorHandler.java:54)

      at org.forgerock.openam.sdk.http.HttpSessionImpl.handleUnsuccessfulResponse (HttpSessionImpl.java:271)

      at org.forgerock.openam.sdk.http.HttpSessionImpl.send (HttpSessionImpl.java:169)

      at org.forgerock.openam.sdk.http.RequestBuilder.delete (RequestBuilder.java:246)

      at org.forgerock.openam.sdk.crest.CrestResourceProviderAsync.deleteInstance (CrestResourceProviderAsync.java:220)

      at org.forgerock.openam.sdk.crest.HttpCrestResourceProvider.deleteInstance (HttpCrestResourceProvider.java:214)

      at org.forgerock.openam.sdk.operations.globalconfig.sites.SitesOperationsImpl.delete (SitesOperationsImpl.java:103)

      at org.forgerock.openam.sdk.operations.globalconfig.sites.SitesOperations$delete$0.call (Unknown Source)

      at org.forgerock.openam.amster.loadster.cleaner.Cleaner$_cleanCollection_closure1.doCall (Cleaner.groovy:70)

      at org.forgerock.openam.amster.loadster.cleaner.Cleaner.cleanCollection (Cleaner.groovy:64)

      at org.forgerock.openam.amster.loadster.cleaner.Cleaner.clean (Cleaner.groovy:35)

      at org.forgerock.openam.amster.loadster.cleaner.GlobalCleaner.clean (GlobalCleaner.groovy:25)

      at org.forgerock.openam.amster.loadster.cleaner.GlobalCleaner.clean (GlobalCleaner.groovy)

      at org.forgerock.openam.amster.loadster.importer.Importer.importEntities (Importer.groovy:95)

      at org.forgerock.openam.amster.commands.ImportCommand.execute (ImportCommand.groovy:53)

      at org.forgerock.openam.amster.Main$_addCommandLineWrapping_closure1.doCall (Main.groovy:77)

      at org.forgerock.openam.amster.Main$_addCommandLineWrapping_closure1.doCall (Main.groovy:77)

      at java_lang_Runnable$run.call (Unknown Source)

      at org.forgerock.openam.amster.Main.main (Main.groovy:58)

       I checked OPENAM-10837 but this issues seems to be new.

      Work around

      1. Go to Deployment > Servers
      2. Click on Server Name
      3. Under Site tab, remove the server from site 
        Select [empty] for Parent site
      4.  Save the changes by clicking Save Changes button
      5. Re-run the command

       

      It may be possible to script this remove/add site  via amster

       

      https://backstage.forgerock.com/docs/amster/6.5/entity-reference/#sec-amster-entity-generalproperties

      To remove site

      update GeneralProperties --global --serverName 01 --body '{ "amconfig.header.site": { "singleChoiceSite": "" }}'

      01 - your AM instance server name 's id

      To restore site

      update GeneralProperties --global --serverName 01 --body '{ "amconfig.header.site": { "singleChoiceSite": "myLB" }}'

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                andrew.potter Andrew Potter
              • Votes:
                2 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated: