List disks fails with non-disk scsi devices

Bug #1833857 reported by Chris Sanders
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ceph OSD Charm
Fix Released
Medium
Unassigned

Bug Description

Error opening non disk device

# ./actions/list-disks
  Failed to find physical volume "/dev/cdrom".
Traceback (most recent call last):
  File "./actions/list-disks", line 46, in <module>
    not ceph.utils.is_pristine_disk(dev)):
  File "lib/ceph/utils.py", line 890, in is_pristine_disk
    f = open(dev, 'rb')
OSError: [Errno 123] No medium found: '/dev/sr0'

Devices on the system:
brw-rw---- 1 root disk 8, 0 Jun 23 14:24 /dev/sda
brw-rw---- 1 root disk 8, 1 Jun 23 14:25 /dev/sda1
brw-rw---- 1 root disk 8, 16 Jun 23 14:24 /dev/sdb
brw-rw---- 1 root disk 8, 32 Jun 23 14:24 /dev/sdc
brw-rw---- 1 ceph ceph 8, 33 Jun 23 14:24 /dev/sdc1
brw-rw---- 1 ceph ceph 8, 34 Jun 23 14:24 /dev/sdc2
crw-rw---- 1 root cdrom 21, 0 Jun 23 14:24 /dev/sg0
crw-rw---- 1 root disk 21, 1 Jun 23 14:24 /dev/sg1
crw-rw---- 1 root disk 21, 2 Jun 23 14:24 /dev/sg2
crw-rw---- 1 root disk 21, 3 Jun 23 14:24 /dev/sg3
crw------- 1 root root 10, 231 Jun 23 14:24 /dev/snapshot
brw-rw---- 1 root cdrom 11, 0 Jun 23 14:24 /dev/sr0

This is on a fresh Bionic:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
Kernel: 4.15.0-52-generic

At the very least, opening the device should probably have a try/except possibly keeping a list of devices that failed to read.

James Page (james-page)
Changed in charm-ceph-osd:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-ceph-osd (master)

Change abandoned by Alexandros Soumplis (<email address hidden>) on branch: master
Review: https://review.opendev.org/699398
Reason: Closed in favor of https://review.opendev.org/#/c/699404/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-ceph-osd (master)

Reviewed: https://review.opendev.org/699398
Committed: https://git.openstack.org/cgit/openstack/charm-ceph-osd/commit/?id=df8f477cd79ddf59309d130cf8f5dce3422a7fa5
Submitter: Zuul
Branch: master

commit df8f477cd79ddf59309d130cf8f5dce3422a7fa5
Author: Alexandros Soumplis <email address hidden>
Date: Tue Dec 17 13:48:07 2019 +0200

    Ignore devices with OSError

    This bug handles OSError when trying to read from CDrom devices with no
    disc in the is_pristine_disk function which makes the run-action
    list-disks to fail.

    Change-Id: I5e86895d1adff3f95c7feb5ed0f78b998c28ed1f
    Depends-On: I951897a699305604821f2c910ee9ea91582c4e40
    Closes-Bug: #1833857
    Signed-off-by: Alexandros Soumplis <email address hidden>

Changed in charm-ceph-osd:
status: Triaged → Fix Committed
James Page (james-page)
Changed in charm-ceph-osd:
milestone: none → 20.02
Liam Young (gnuoy)
Changed in charm-ceph-osd:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.