rbd-target-api crashes with python TypeError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ceph-iscsi (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
High
|
Unassigned | ||
Impish |
Fix Released
|
High
|
Unassigned |
Bug Description
[Impact]
* rbd-target-api service fails to start if there is a blocklist
entry for the unit making the service unavailable.
* When the rbd-target-api service starts it checks if any of the
ip addresses on the machine it is running on are listed as
blocked. If there are entries it tries to remove them. In the
process of removing the entries the code attempts to test whether
a string is in the result of a subprocess.
would have worked in python2 but with python3 a byte like object
is returned and check now throws a TypeError. This fix, taken from
upstream, changes the code to remove the `in` check and replace it
with a try/except
[Test Plan]
If an existing ceph-iscsi deployment is available then skip to
step 3.
1) Deploy the bundle below (tested with OpenStack providor).
series: focal
applications:
ceph-iscsi:
charm: cs:ceph-iscsi
num_units: 2
ceph-osd:
charm: ch:ceph-osd
num_units: 3
storage:
osd-devices: 'cinder,10G'
options:
osd-devices: '/dev/test-
channel: latest/edge
ceph-mon:
charm: ch:ceph-mon
num_units: 3
options:
monitor-
channel: latest/edge
relations:
- - 'ceph-mon:client'
- 'ceph-iscsi:
- - 'ceph-osd:mon'
- 'ceph-mon:osd'
2) Connect to ceph-iscsi unit:
juju ssh -m zaza-a1d88053ab85 ceph-iscsi/0
3) Stop rbd-target-api via systemd to make test case clearer:
sudo systemctl stop rbd-target-api
4) Add 2 blocklist entries for this unit (due to another issue the ordering of the output from `osd blacklist ls` matters which can lead to the reproduction of this bug being intermittent. To avoid this add two entries which ensures there is always an entry for this node in the list of blocklist entries to be removed).
sudo ceph -n client.ceph-iscsi --conf /etc/ceph/
sudo ceph -n client.ceph-iscsi --conf /etc/ceph/
sudo ceph -n client.ceph-iscsi --conf /etc/ceph/
listed 2 entries
172.20.0.135:0/2 2022-02-
172.20.0.135:0/1 2022-02-
5) Attempt to start service:
sudo /usr/bin/python3 /usr/bin/
Traceback (most recent call last):
File "/usr/bin/
main()
File "/usr/bin/
osd_state_ok = ceph_gw.
File "/usr/lib/
rm_ok = self.ceph_
File "/usr/lib/
if ("un-blacklisting" in result) or ("isn't blacklisted" in result):
TypeError: a bytes-like object is required, not 'str'
[Where problems could occur]
* Problems could occur with the service starting as this blocklist check is done at startup.
* Blocklist entries could fail to be removed.
Old bug description:
$ lsb_release -rd
Description: Ubuntu 20.04 LTS
Release: 20.04
$ dpkg -S /usr/lib/
ceph-iscsi: /usr/lib/
$ apt-cache policy ceph-iscsi
ceph-iscsi:
Installed: 3.4-0ubuntu2
Candidate: 3.4-0ubuntu2
Version table:
*** 3.4-0ubuntu2 500
500 http://
500 http://
100 /var/lib/
On second startup after a reboot, rbd-target-api crashes with a TypeError:
Traceback (most recent call last):
File "/usr/bin/
main()
File "/usr/bin/
osd_state_ok = ceph_gw.
File "/usr/lib/
rm_ok = self.ceph_
File "/usr/lib/
if ("un-blacklisting" in result) or ("isn't blacklisted" in result):
TypeError: a bytes-like object is required, not 'str'
Upstream has a fix: https:/
summary: |
- rbd-target-api crashes with python TypError + rbd-target-api crashes with python TypeError |
tags: | added: focal |
Changed in ceph-iscsi (Ubuntu): | |
status: | New → Confirmed |
description: | updated |
Changed in ceph-iscsi (Ubuntu): | |
status: | Confirmed → Fix Released |
Changed in ceph-iscsi (Ubuntu Focal): | |
status: | New → Triaged |
Changed in ceph-iscsi (Ubuntu Impish): | |
status: | New → Triaged |
Changed in ceph-iscsi (Ubuntu Focal): | |
importance: | Undecided → High |
Changed in ceph-iscsi (Ubuntu Impish): | |
importance: | Undecided → High |
Changed in ceph-iscsi (Ubuntu Focal): | |
status: | Fix Committed → Incomplete |
The attachment "deb.diff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]