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 about 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 #1

Updated by François ARMAND about 8 years ago

  • Assignee set to François ARMAND
  • Priority changed from N/A to 3
  • Target version set to 3.1.17
Actions #2

Updated by François ARMAND about 8 years ago

  • Status changed from New to In progress
Actions #3

Updated by François ARMAND about 8 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Vincent MEMBRÉ
  • Pull Request set to https://github.com/Normation/rudder/pull/1263
Actions #4

Updated by François ARMAND about 8 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100
Actions #5

Updated by Vincent MEMBRÉ about 8 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.0.1, 3.1.16 and 3.2.10 which were released today.

Actions

Also available in: Atom PDF