[OPENAM-11050] Amster: 'import-config --clean true' fails when server is a member of a site Created: 20/Apr/17  Updated: 25/Jun/20

Status: Open
Project: OpenAM
Component/s: Amster
Affects Version/s: 14.0.0, 6.0.0.5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Andrew Potter Assignee: Unassigned
Resolution: Unresolved Votes: 2
Labels: Backlog, EDISON, dev-ops, docker, kubernetes
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to OPENAM-11906 Amster import using --clean true and ... Closed
Target Version/s:
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" }}'

 


Generated at Mon Oct 19 16:13:50 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.