Project

General

Profile

Actions

Bug #51867

closed

[pybind] mirror_image_get_status() throws TypeError if remote_statuses isn't empty

Added by Ilya Dryomov over 2 years ago. Updated over 2 years ago.

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

0%

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

Description

Reported and fixed by Will Smith <>. The ticket is for tracking purposes.

When retrieving the status of a mirrored image from the Python rbd
library, a TypeError is raised.

### To Reproduce:

Set up two Ceph clusters for block storage, and configure image
mirroring between their pools.  Create a least one image with mirroring
enabled, then run the following script on either cluster (once the image
exists everywhere):

```python
import rados, rbd

CONF_PATH = "YOUR-CONF-PATH" 
POOL_NAME = "YOUR-POOL-NAME" 
IMAGE_LABEL = "YOUR-IMAGE-LABEL" 

with rados.Rados(conffile=CONF_PATH) as cluster:
  with cluster.open_ioctx(POOL_NAME) as ioctx:
    with rbd.Image(ioctx, IMAGE_LABEL) as image:
      image.mirror_image_get_status()
```

This will result in the following stack trace:

```
Traceback (most recent call last):
  File "repo-bug.py", line 10, in <module>
    image.mirror_image_get_status()
  File "rbd.pyx", line 3363, in rbd.requires_not_closed.wrapper
  File "rbd.pyx", line 5209, in rbd.Image.mirror_image_get_status
TypeError: list indices must be integers or slices, not str
```


Related issues 2 (0 open2 closed)

Copied to rbd - Backport #52005: octopus: [pybind] mirror_image_get_status() throws TypeError if remote_statuses isn't emptyResolvedIlya DryomovActions
Copied to rbd - Backport #52006: pacific: [pybind] mirror_image_get_status() throws TypeError if remote_statuses isn't emptyResolvedIlya DryomovActions
Actions #1

Updated by Ilya Dryomov over 2 years ago

  • Description updated (diff)
Actions #2

Updated by Ilya Dryomov over 2 years ago

Related issue: with TypeError fixed, remote_statuses list isn't populated with anything useful -- the use of += and the fact list(some_dict) returns a list of keys means that only strings like 'state', 'description', etc get appended.

Actions #3

Updated by Ilya Dryomov over 2 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #4

Updated by Backport Bot over 2 years ago

  • Copied to Backport #52005: octopus: [pybind] mirror_image_get_status() throws TypeError if remote_statuses isn't empty added
Actions #5

Updated by Backport Bot over 2 years ago

  • Copied to Backport #52006: pacific: [pybind] mirror_image_get_status() throws TypeError if remote_statuses isn't empty added
Actions #6

Updated by Loïc Dachary over 2 years ago

  • Status changed from Pending Backport to Resolved

While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".

Actions

Also available in: Atom PDF