/usr/libexec/os-refresh-config/configure.d/40-hiera-datafiles converts large numbers wrongly

Bug #1755236 reported by Michele Baldessari on 2018-03-12
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
High
Unassigned

Bug Description

Given a mapped_data extraconfig like this one:
   "extraconfig": {
    "mapped_data": {
     "rabbitmq_config_variables": {
      "queue_master_locator": "<<\"min-masters\">>",
      "loopback_users": [],
      "vm_memory_high_watermark": 0.5,
      "rates_mode": "detailed",
      "stats_event_max_backlog": 250,
      "tcp_listen_options": "[binary, {packet, raw}, {reuseaddr, true}, {backlog, 128}, {nodelay, true}, {exit_on_close, false}, {keepalive, true}]",
      "disk_free_limit": 2000000000,
      "cluster_partition_handling": "pause_minority",
      "collect_statistics_interval": 30000
     },

The 40-hiera-datafiles script will convert the large integer 'disk_free_limit' like this:
rabbitmq_config_variables: {
  "collect_statistics_interval": 30000,
  "queue_master_locator": "<<\"min-masters\">>",
  "loopback_users": [],
  "vm_memory_high_watermark": 0.5,
  "rates_mode": "detailed",
  "stats_event_max_backlog": 250,
  "tcp_listen_options": "[binary, {packet, raw}, {reuseaddr, true}, {backlog, 128}, {nodelay, true}, {exit_on_close, false}, {keepalive, true}]",
  "disk_free_limit": 2e+09,
  "cluster_partition_handling": "pause_minority"
}

Which will break the rabbitmq service as it cannot parse '2e+09'. This was first observed on newton

Michele Baldessari (michele) wrote :

Quoting the large number fixes it

Michele Baldessari (michele) wrote :

Ok so this is a jq bug:
# echo '{"id" : 1241000000}' | jq '.'
{
  "id": 1.241e+09
}

See also the following issues:
https://github.com/stedolan/jq/issues/218
https://github.com/stedolan/jq/issues/627
https://github.com/stedolan/jq/issues/178
https://github.com/stedolan/jq/issues/143

It does not seem that this will be fixed anytime soon

Changed in tripleo:
milestone: rocky-1 → rocky-2
Changed in tripleo:
milestone: rocky-2 → rocky-3
Changed in tripleo:
milestone: rocky-3 → rocky-rc1
Changed in tripleo:
milestone: rocky-rc1 → stein-1
Changed in tripleo:
milestone: stein-1 → stein-2
Changed in tripleo:
milestone: stein-2 → stein-3
Changed in tripleo:
milestone: stein-3 → stein-rc1
Changed in tripleo:
milestone: stein-rc1 → train-1
Changed in tripleo:
milestone: train-1 → train-2
Luke Short (ekultails) wrote :

The JSON Query (jq) bug is still present and outside of TripleO's control.

https://github.com/stedolan/jq/issues/218

Changed in tripleo:
milestone: train-2 → train-3
Changed in tripleo:
milestone: train-3 → ussuri-1
Changed in tripleo:
milestone: ussuri-1 → ussuri-2
wes hayutin (weshayutin) on 2020-02-10
Changed in tripleo:
milestone: ussuri-2 → ussuri-3
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.