Project

General

Profile

Bug #6693

"rbd ls" returns error if the pool empty

Added by Zoltan Arnold Nagy over 6 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
-
% Done:

0%

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

Description

if the pool exists but only empty, instead of not returning anything, it returns an error message that it's empty, and returns a -1 error code.

this breaks OpenStack:
2013-10-31 10:28:23.081 17751 TRACE nova.compute.manager [instance: d517287d-76ee-4501-89bd-752e97e7615c] Command: rbd -p zc2ephemeral ls
2013-10-31 10:28:23.081 17751 TRACE nova.compute.manager [instance: d517287d-76ee-4501-89bd-752e97e7615c] Exit code: 1
2013-10-31 10:28:23.081 17751 TRACE nova.compute.manager [instance: d517287d-76ee-4501-89bd-752e97e7615c] Stdout: ''
2013-10-31 10:28:23.081 17751 TRACE nova.compute.manager [instance: d517287d-76ee-4501-89bd-752e97e7615c] Stderr: "rbd: pool xypool doesn't contain rbd images\n

besides behaving incorrectly, this breaks openstack, so current latest stable from both (dumpling/havana) is not usable, so please backport.

Associated revisions

Revision ac547a5b (diff)
Added by Josh Durgin over 6 years ago

rbd: return 0 and an empty list when pool is entirely empty

rbd_list will return -ENOENT when no rbd_directory object
exists. Handle this in the cli tool and interpret it as success with
an empty list.

Add this to the release notes since it changes command line behavior.

Fixes: #6693
Signed-off-by: Josh Durgin <>

Revision c66b61f9 (diff)
Added by Josh Durgin over 6 years ago

rbd: return 0 and an empty list when pool is entirely empty

rbd_list will return -ENOENT when no rbd_directory object
exists. Handle this in the cli tool and interpret it as success with
an empty list.

Add this to the release notes since it changes command line behavior.

Fixes: #6693
Signed-off-by: Josh Durgin <>
(cherry picked from commit ac547a5b7dc94282f079aef78e66348d99d9d5e9)

Conflicts:
PendingReleaseNotes
src/rbd.cc

History

#1 Updated by Josh Durgin over 6 years ago

  • Priority changed from Immediate to High

I agree the exit code should be 0 in this case, but I'm downgrading the priority since there's an easy workaround and it only affects a new piece of functionality in openstack that's already broken for other reasons.

This only breaks nova's local rbd use, which is already broken for other reasons (https://bugs.launchpad.net/nova/+bug/1233188 and https://bugs.launchpad.net/nova/+bug/1226351). Cinder never users 'rbd ls'. Nova should be fixed to not use it as well.

A work around is to create and delete an image in the pool nova is using. This will create the rbd_directory object, whose non-existence is causing 'rbd ls' to return the error.

#2 Updated by Josh Durgin over 6 years ago

  • Status changed from New to Fix Under Review
  • Assignee set to Josh Durgin
  • Source changed from other to Community (dev)

#3 Updated by Josh Durgin over 6 years ago

  • Status changed from Fix Under Review to Resolved

commit:ac547a5b7dc94282f079aef78e66348d99d9d5e9

Also available in: Atom PDF