Solutions
ForgeRock Identity Platform
Does not apply to Identity Cloud

Only url, secondaryURLs and _id are valid in write error when importing configuration data via Amster in AM 6.0.x, 6.5.0.x, 6.5.1 and 6.5.2.x

Last updated Jan 17, 2023

The purpose of this article is to provide assistance if you encounter a "400 Bad Request: Only url, secondaryURLs and _id are valid in write" error when importing the service configuration using Amster in AM. This error only happens when you have a site configured.


Symptoms

One of the following errors is shown when importing a service configuration using Amster depending on whether your deployment has a load balancer or not:

Failed to import /path/to/amster/export_dir/global/Sites/Main.json : 400 Bad Request: Only url, secondaryURLs and _id are valid in write Failed to import /path/to/amster/export_dir/global/Sites/lb.json : 400 Bad Request: Only url, secondaryURLs and _id are valid in write

Recent Changes

Configured a site.

Causes

The exported Main.json or lb.json file has an extra id property.

Solution

This issue can be resolved by upgrading to AM 6.5.3 or later; you can download this from Backstage.

Workaround

You can workaround this issue by removing the extra id property from the exported Main.json or lb.json file:

  1. Locate the Main.json or lb.json file that it is indicated in the error. For example, an exported lb.json file looks similar to this: {  "metadata" : {     "realm" : null,     "amsterVersion" : "14.0.0",     "entityType" : "Sites",     "entityId" : "lb",     "pathParams" : { }   },   "data" : {     "_id" : "lb",     "id" : "02",     "url" : "https://am.example.com:8443/am",     "secondaryURLs" : [ ]   }
  2. Remove the id property ("id" : "02") from this file to leave the following valid file: {  "metadata" : {     "realm" : null,     "amsterVersion" : "14.0.0",     "entityType" : "Sites",     "entityId" : "lb",     "pathParams" : { }   },   "data" : {     "_id" : "lb",     "url" : "https://am.example.com:8443/am",     "secondaryURLs" : [ ]   }
  3. Save this file and re-attempt the import.

See Also

FAQ: Installing and using Amster in AM

Using Amster in AM

Related Training

N/A

Related Issue Tracker IDs

OPENAM-11159 (OpenAM Amster export/import for Site have import errors)


Copyright and Trademarks Copyright © 2023 ForgeRock, all rights reserved.