The Marathon plugin uses the net.sf.json.JSONObject class to deserialize the Marathon config. If a user accidentally includes a duplicate key (e.g. in env or labels), this class will combine the values of the duplicate keys into an array in the resulting generated Marathon config (in contrast to most JSON deserialization libraries, which pick the last key), leading to a schema violation when the plugin attempts to PUT the generated config to Marathon (this shows up as an HTTP 422 and no useful error message in Jenkins, due to JENKINS-37287).
For example, if you have an env like this:
The Marathon plugin will generate:
"foo": ["bar", "baz"]
Values in the 'env' hash are only allowed to be strings, not arrays, so this fails Marathon's JSON schema validation, leading to the HTTP 422.
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.