Comment 1 for bug 1625489

Revision history for this message
Dr. Jens Harbott (j-harbott) wrote : Re: Glance fails to retrieve image from rbd backend

Right, after doing a bit more debugging, this looks like a bug in python-rbd only. Running the following python code, I am seeing the same errors about 50% of the time:

import rados
import rbd
cluster = rados.Rados(conffile='/etc/ceph/ceph.conf')
cluster.connect()
ioctx = cluster.open_ioctx('images')
image = rbd.Image(ioctx, '41a6aadf-c655-49c8-b77d-eedd356f5349')
stat = image.stat()
print stat['size'] == image.size()

$ python test.py
True
$ python test.py
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    stat = image.stat()
  File "rbd.pyx", line 1124, in rbd.Image.stat (/build/ceph-XmVvyr/ceph-10.2.2/src/build/rbd.c:10803)
  File "rbd.pyx", line 433, in rbd.decode_cstr (/build/ceph-XmVvyr/ceph-10.2.2/src/build/rbd.c:2440)
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf4 in position 24: unexpected end of data

The "position" in the error is always 24, with varying byte values.