Project

General

Profile

Bug #7157

ceph-disk list fails in encrypted disk setup

Added by Andreas Kurz about 10 years ago. Updated almost 10 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
ceph-disk
Target version:
-
% Done:

0%

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

Description

In a setup (Dumpling 0.67.5) that is using dm-crypt "ceph-disk" list fails with:

  1. ceph-disk list
    Traceback (most recent call last):
    File "/usr/sbin/ceph-disk", line 2340, in <module>
    main()
    File "/usr/sbin/ceph-disk", line 2329, in main
    args.func(args)
    File "/usr/sbin/ceph-disk", line 2013, in main_list
    tpath = mount(dev=dev, fstype=fs_type, options='')
    File "/usr/sbin/ceph-disk", line 678, in mount
    path,
    File "/usr/lib/python2.7/subprocess.py", line 506, in check_call
    retcode = call(*popenargs, **kwargs)
    File "/usr/lib/python2.7/subprocess.py", line 493, in call
    return Popen(*popenargs, **kwargs).wait()
    File "/usr/lib/python2.7/subprocess.py", line 679, in init
    errread, errwrite)
    File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
    TypeError: execv() arg 2 must contain only strings

Disks look like:

  1. lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 0 2.7T 0 disk
    ??sda1 8:1 0 2.7T 0 part
    ??4f8e15bd-ac8a-42bd-9bd8-6bc8ee3d193f (dm-2) 252:2 0 2.7T 0 crypt /var/lib/ceph/osd/ceph-90
    sdb 8:16 0 2.7T 0 disk
    ??sdb1 8:17 0 2.7T 0 part
    ??fb1b26ac-f435-47f5-a21a-a5acd0de2d28 (dm-3) 252:3 0 2.7T 0 crypt /var/lib/ceph/osd/ceph-91
  1. mount
    /dev/mapper/ed102d71-6c1e-4468-abf7-4461aa300989 on /var/lib/ceph/osd/ceph-106 type xfs (rw,noatime,inode64,logbsize=256k)
    /dev/mapper/6f0796b1-5c26-44cd-9c92-fe818fe7c120 on /var/lib/ceph/osd/ceph-107 type xfs (rw,noatime,inode64,logbsize=256k)

ceph-disk.diff View - My hack around the ceph-disk issue (1.71 KB) Stuart Longland, 01/21/2014 03:44 PM


Related issues

Duplicates devops - Bug #4887: ceph-disk list: Doesn't list properly devices using dm-mapper Resolved 05/01/2013

History

#1 Updated by Stuart Longland about 10 years ago

I'm having this problem, with a fresh install of Ubuntu 12.04 and the latest (as of yesterday) Ceph release (ceph version 0.72.2 (a913ded2ff138aefb8cb84d347d72164099cfd60)).

I've noticed that if ceph-disk can't detect the file system type in the function get_dev_fs (called on line 2019 of /usr/sbin/ceph-disk), get_dev_fs returns None. This gets passed to the mount function which passes the raw None to subprocess.check_call. The subprocess module then cracks it when it sees a non-String in its args array.

Causes for this would be various, such as the partition being corrupted (my case) or the volume being encrypted (Andreas' case).

Attached is a patch for ceph-disk that fixes the issue for me.

Without patch:

Traceback (most recent call last):
  File "/tmp/ceph-disk", line 2342, in <module>
    main()
  File "/tmp/ceph-disk", line 2331, in main
    args.func(args)
  File "/tmp/ceph-disk", line 2015, in main_list
    tpath = mount(dev=dev, fstype=fs_type, options='')
  File "/tmp/ceph-disk", line 678, in mount
    path,
  File "/usr/lib/python2.7/subprocess.py", line 506, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 493, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
TypeError: execv() arg 2 must contain only strings

With patch:

/dev/sda :
 /dev/sda1 ceph data, prepared, unknown cluster c04c8318-6adf-495b-a330-2c74e13ce7c7
/dev/sdb :
 /dev/sdb1 ceph data, unprepared
/dev/sdc :
 /dev/sdc1 other, xfs, mounted on /
 /dev/sdc2 other
 /dev/sdc5 other, Linux filesystem
 /dev/sdc6 other, Linux filesystem
 /dev/sdc7 swap, swap

#2 Updated by Sage Weil almost 10 years ago

  • Status changed from New to Duplicate

Also available in: Atom PDF