Solutions

Only url, secondaryURLs and _id are valid in write error when importing configuration data via Amster in AM (All versions)

Last updated Jul 9, 2018

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

You can workaround this issue by removing the extra id property form 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" : "http://host1.example.com:8080/openam",
        "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" : "http://host1.example.com:8080/openam",
        "secondaryURLs" : [ ]
      }
    
  3. Save this file and re-attempt the import.

See Also

ssoadm command fails to run with null pointer exception in AM 5 and 5.1.x

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 TrademarksCopyright © 2018 ForgeRock, all rights reserved.
Loading...