Project

General

Profile

Bug #7463

ceph-rest-api fails to start with no OSDs up

Added by Brian Andrus about 10 years ago. Updated about 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
ceph cli
Target version:
-
% Done:

0%

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

Description

ceph-rest-api fails to start id it can find no up OSDs:

osdid = find_up_osd(app)
File "/usr/lib/python2.6/site-packages/ceph_rest_api.py", line 59, in find_up_osd
raise EnvironmentError(errno.ENOENT, 'No up OSDs found')
EnvironmentError: [Errno 2] No up OSDs found

It should fail verbosely or continue starting.

Associated revisions

Revision db88e7f3 (diff)
Added by Dan Mick about 10 years ago

ceph_rest_api.py: don't fail if no up OSDs found on startup

allow find_up_osd() to return None, and have caller check for it

Fixes: #7463
Signed-off-by: Dan Mick <>

History

#1 Updated by Dan Mick about 10 years ago

  • Category set to ceph cli
  • Status changed from New to Fix Under Review

No reason not to start. This appears to fix it:

--- a/src/pybind/ceph_rest_api.py
+++ b/src/pybind/ceph_rest_api.py
@@ -56,7 +56,7 @@ def find_up_osd(app):
         raise EnvironmentError(errno.EINVAL, 'Invalid JSON back from osd dump')
     osds = [osd['osd'] for osd in osddump['osds'] if osd['up']]
     if not osds:
-        raise EnvironmentError(errno.ENOENT, 'No up OSDs found')
+        return None
     return int(osds[-1])

@@ -139,7 +139,7 @@ def api_setup(app, conf, cluster, clientname, clientid, args):
     app.ceph_sigdict = get_command_descriptions(app.ceph_cluster)

     osdid = find_up_osd(app)
-    if osdid:
+    if osdid is not None:
         osd_sigdict = get_command_descriptions(app.ceph_cluster,
                                                target=('osd', int(osdid)))

#2 Updated by Dan Mick about 10 years ago

  • Status changed from Fix Under Review to Resolved

#3 Updated by Brian Andrus about 10 years ago

Dan fixed in db88e7f385f4464f5f4de517845607391c314ef5

Also available in: Atom PDF