KNOWLEDGE BASE

Error "Unable to map JSON in configuration file" when importing trustedAuthenticationSettings


Published: 05 Mar 2019
Last Modified Date: 21 Mar 2019

Issue

When running "tsm settings import" for a trustedAuthenticationSettings entity containing trustedHosts, the following error may occur:

C:\test>tsm settings import -f trusted.json
Unable to map JSON in configuration file.
Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token
at [Source: trusted.json; line: 5, column: 19] (through reference chain: com.ta
bleausoftware.tabadmin.webapp.viewmodels.TsmRequest["configEntities"]->java.util
.LinkedHashMap["trustedAuthenticationSettings"]->com.tableausoftware.tabadmin.we
bapp.viewmodels.TrustedAuthenticationSettingsType["trustedHosts"])

Environment

  • Tableau Server 2018.3.0

Resolution

Surround the IP addresses/hostnames passed to trustedHosts with square brackets. For example:

The line:
"trustedHosts": "10.11.12.13"

becomes:
"trustedHosts": ["10.11.12.13"]

OR
 
"trustedHosts": "10.11.12.13", "16.17.18.19"

becomes:
"trustedHosts": ["10.11.12.13", "16.17.18.19"]

Cause

This is related to a known issue that is currently under investigation with Tableau Development.

Additional Information

The example in the product help given is:
 
{
"configEntities": {
	"trustedAuthenticationSettings": {
		"_type": "trustedAuthenticationSettingsType",
		"trustedHosts": "required"
		}
	}
}

Modifying to a syntax that will be accepted looks like:

{
"configEntities": {
	"trustedAuthenticationSettings": {
		"_type": "trustedAuthenticationSettingsType",
		"trustedHosts": ["required"]
		}
	}
}
Did this article resolve the issue?