Project

General

Profile

Bug #9326

Setting nodeProperty over API does fail on bad key order

Added by Janos Mattyasovszky about 1 year ago. Updated about 1 year ago.

Status:
Released
Priority:
3
Category:
API
Target version:
Target version (plugin):
Severity:
User visibility:
Effort required:
Priority:

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

Associated revisions

Revision a49bca39
Added by François ARMAND about 1 year ago

Fixes #9326: Setting nodeProperty over API does fail on bad key order

Revision b33f2267
Added by François ARMAND about 1 year ago

Merge pull request #1263 from fanf/bug_9326/setting_nodeproperty_over_api_does_fail_on_bad_key_order

Fixes #9326: Setting nodeProperty over API does fail on bad key order

History

#1 Updated by François ARMAND about 1 year ago

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

#2 Updated by François ARMAND about 1 year ago

  • Status changed from New to In progress

#3 Updated by François ARMAND about 1 year 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

#4 Updated by François ARMAND about 1 year ago

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

#5 Updated by Vincent MEMBRÉ about 1 year 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.

Also available in: Atom PDF