Project

General

Profile

Actions

Bug #38011

closed

[Mimic version]extra null list in json output of command: ceph osd crush tree --format=json-pretty

Added by Changcheng Liu over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

When executing below command to get osd crush tree on Mimic version, it will output extra null list[] which makes json.loads(result) failed:
1. ceph osd crush tree --format=json-pretty
[ {
"id": -1,
"name": "default",
"type": "root",
"type_id": 10,
"children": []
}
]
[]

2. ceph osd crush tree --format=json
[{"id":-1,"name":"default","type":"root","type_id":10,"children":[]}][]

Example when doing json load example:

bug_str = '[{"id":-1,"name":"default","type":"root","type_id":10,"children":[]}][]'
json.loads(bug_str)

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 369, in decode
raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 1 column 70 - line 1 column 72 (char 69 - 71)

good_str = '[{"id":-1,"name":"default","type":"root","type_id":10,"children":[]}]'
json.loads(good_str)

[{u'children': [], u'type_id': 10, u'type': u'root', u'id': -1, u'name': u'default'}]

Actions #1

Updated by Changcheng Liu over 5 years ago

The extra null list should be removed
[{"id":-1,"name":"default","type":"root","type_id":10,"children":[]}]*[]*

Actions #2

Updated by Changcheng Liu over 5 years ago

Changcheng Liu wrote:

The extra null list should be removed
[{"id":-1,"name":"default","type":"root","type_id":10,"children":[]}]*[]*

Actions #3

Updated by Changcheng Liu over 5 years ago

Changcheng Liu wrote:

Changcheng Liu wrote:

The extra null list should be removed
[{"id":-1,"name":"default","type":"root","type_id":10,"children":[]}][]

Actions #4

Updated by Vasu Kulkarni about 5 years ago

  • Project changed from 18 to RADOS
  • Affected Versions v13.0.0 added

Not a ceph-deploy issue but should fall under ceph

Actions #5

Updated by Noah Watkins about 5 years ago

Looks like this was from running an old monitor, and should be fixed in newer release.

Actions #6

Updated by Noah Watkins about 5 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF