Project

General

Profile

Actions

Bug #9326

closed

Setting nodeProperty over API does fail on bad key order

Added by Janos Mattyasovszky about 8 years ago. Updated almost 8 years ago.

Status:
Released
Priority:
3
Category:
API
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

The outcome of updateNodeProperty depends on in which order the JSON hash's string has it's keys ordered.

See:

Good:

$ curl -H "X-API-Token: $token" -X POST  -H "Content-Type: application/json" https://$fqdn/rudder/api/latest/nodes/7485da1a-4cea-4c2e-99f6-f9fa465ec26c -d '{ "properties" : [ { "name": "env_type", "value": "production" } ] }'; echo ;
{"action": "updateNodeProperties","id": "7485da1a-4cea-4c2e-99f6-f9fa465ec26c","result": "success","data": {"properties": [{"name": "env_type","value": "production"}]}}

Bad (data is the same):

$ curl -H "X-API-Token: $token" -X POST  -H "Content-Type: application/json" https://$fqdn/rudder/api/latest/nodes/7485da1a-4cea-4c2e-99f6-f9fa465ec26c -d '{ "properties" : [ { "value": "production", "name": "env_type" } ] }'; echo ;
{"action": "updateNodeProperties","id": "7485da1a-4cea-4c2e-99f6-f9fa465ec26c","result": "error","errorDetails": "Error when trying to parse new property: '{\"value\":\"production\",\"name\":\"env_type\"}'. The awaited format is: {\"name\": string, \"value\": json}"}

Found in:

rudder-reports-3.1.15.release-1.SLES.11
rudder-jetty-3.1.15.release-1.SLES.11
rudder-techniques-3.1.15.release-1.SLES.11
rudder-server-root-3.1.15.release-1.SLES.11
rudder-plugin-external-node-information-2.11.4-1
rudder-webapp-3.1.15.release-1.SLES.11
rudder-inventory-ldap-3.1.15.release-1.SLES.11
rudder-agent-3.1.15.release-1.SLES.11
rudder-inventory-endpoint-3.1.15.release-1.SLES.11

Actions

Also available in: Atom PDF