Project

General

Profile

Bug #4952

ceph-create-keys talked to mon, got back non-JSON

Added by Dan Mick almost 6 years ago. Updated almost 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
05/08/2013
Due date:
% Done:

0%

Source:
Community (user)
Tags:
ceph-deploy
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

netmass in IRC today reported a failure to create the client.admin key with ceph-deploy; he found
a crash from ceph-create-keys that included an untrapped JSON exception:

PythonArgs: ['/usr/sbin/ceph-create-keys', '--cluster=ceph', '-i', 'ceph01']
Traceback:
Traceback (most recent call last):
File "/usr/sbin/ceph-create-keys", line 228, in <module>
main()
File "/usr/sbin/ceph-create-keys", line 199, in main
wait_for_quorum(cluster=args.cluster, mon_id=args.id)
File "/usr/sbin/ceph-create-keys", line 37, in wait_for_quorum
data = json.loads(out)
File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

I don't know what the monitor said, but IWBNI:

1) ceph-create-keys trapped that exception, and
2) logged something about what went wrong, and
3) perhaps added that to the retry loop conditions

Associated revisions

Revision e2528ae4 (diff)
Added by Sage Weil almost 6 years ago

ceph-create-keys: gracefully handle no data from admin socket

Old ceph-mon (prior to 393c9372f82ef37fc6497dd46fc453507a463d42) would
return an empty string and success if the command was not registered yet.
Gracefully handle that case by retrying.

If we still fail to parse, exit entirely with EINVAL.

Fixes: #4952
Signed-off-by: Sage Weil <>
Reviewed-by: Dan Mick <>

Revision 82b92995 (diff)
Added by Sage Weil almost 6 years ago

ceph-create-keys: gracefully handle no data from admin socket

Old ceph-mon (prior to 393c9372f82ef37fc6497dd46fc453507a463d42) would
return an empty string and success if the command was not registered yet.
Gracefully handle that case by retrying.

If we still fail to parse, exit entirely with EINVAL.

Fixes: #4952
Signed-off-by: Sage Weil <>
Reviewed-by: Dan Mick <>
(cherry picked from commit e2528ae42c455c522154c9f68b5032a3362fca8e)

History

#1 Updated by Dan Mick almost 6 years ago

  • Priority changed from High to Normal

Sage allows as how this is probably avoided by 30ffca77df006a244044604074779af538721f14 in
the cuttlefish branch, so I'll drop priority, but, ceph-create-keys should still be more
robust and diagnosable.

#2 Updated by Sage Weil almost 6 years ago

  • Status changed from New to In Progress
  • Assignee set to Sage Weil

#3 Updated by Sage Weil almost 6 years ago

  • Status changed from In Progress to Resolved

Also available in: Atom PDF