Project

General

Profile

Actions

Bug #24993

closed

ceph-volume fails to create OSD with Python 3

Added by Michael Jones almost 6 years ago. Updated almost 6 years ago.

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

0%

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

Description

ceph version 13.2.0 (79a10589f1f80dfe21e8f9794365ed98143071c4) mimic (stable)
Python 3.5.5
OS: Gentoo

fenrir ~ # ceph-volume lvm create --bluestore --data /dev/sda
Running command: /usr/bin/ceph-authtool --gen-print-key
Running command: /usr/bin/ceph --cluster ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring -i - osd new a1ff1660-7007-4d52-9ec9-bbb7bfc63fd8
-->  TypeError: memoryview: a bytes-like object is required, not 'str'

The log gives no indication of WHY ceph-volume was unable to prepare the device.

Note, this was a disk that was the bluestore storage of an OSD created by ceph-disk, so this isn't a hardware issue, or an issue of a non-working cluster. I'm just trying to migrate my OSD to ceph-volume.

/var/log/ceph/ceph-volume.log:

[2018-07-19 03:03:31,064][ceph_volume.main][INFO  ] Running command: ceph-volume  lvm create --bluestore --data /dev/sda
[2018-07-19 03:03:31,074][ceph_volume.process][INFO  ] Running command: /usr/bin/ceph-authtool --gen-print-key
[2018-07-19 03:03:31,143][ceph_volume.process][INFO  ] stdout AQDTRVBblYwpCBAA5BCd44IVFlUJhyrm2ox9kQ==
[2018-07-19 03:03:31,146][ceph_volume.process][INFO  ] Running command: /usr/bin/ceph --cluster ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring -i - osd new a1ff1660-7007-4d52-9ec9-bbb7bfc63fd8
[2018-07-19 03:03:31,152][ceph_volume.devices.lvm.prepare][ERROR ] lvm prepare was unable to complete
[2018-07-19 03:03:31,152][ceph_volume.devices.lvm.prepare][INFO  ] will rollback OSD ID creation
[2018-07-19 03:03:31,153][ceph_volume][ERROR ] exception caught by decorator
Traceback (most recent call last):
  File "/usr/lib64/python3.5/site-packages/ceph_volume/decorators.py", line 59, in newfunc
    return f(*a, **kw)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/main.py", line 153, in main
    terminal.dispatch(self.mapper, subcommand_args)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/terminal.py", line 182, in dispatch
    instance.main()
  File "/usr/lib64/python3.5/site-packages/ceph_volume/devices/lvm/main.py", line 38, in main
    terminal.dispatch(self.mapper, self.argv)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/terminal.py", line 182, in dispatch
    instance.main()
  File "/usr/lib64/python3.5/site-packages/ceph_volume/devices/lvm/create.py", line 69, in main
    self.create(args)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/decorators.py", line 16, in is_root
    return func(*a, **kw)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/devices/lvm/create.py", line 26, in create
    prepare_step.safe_prepare(args)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/devices/lvm/prepare.py", line 216, in safe_prepare
    self.prepare(args)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/decorators.py", line 16, in is_root
    return func(*a, **kw)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/devices/lvm/prepare.py", line 245, in prepare
    self.osd_id = prepare_utils.create_id(osd_fsid, json.dumps(secrets), osd_id=args.osd_id)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/util/prepare.py", line 72, in create_id
    show_command=True
  File "/usr/lib64/python3.5/site-packages/ceph_volume/process.py", line 200, in call
    stdout_stream, stderr_stream = process.communicate(stdin)
  File "/usr/lib64/python3.5/subprocess.py", line 803, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/usr/lib64/python3.5/subprocess.py", line 1441, in _communicate
    input_view = memoryview(self._input)
TypeError: memoryview: a bytes-like object is required, not 'str'

Creating an lvm volume by hand doesn't help matters either.

pvcreate /dev/sda ; vgcreate VGroup1 /dev/sda ; lvcreate -l100%VG VGroup1 ; ceph-volume lvm create --bluestore --data VGroup1/lvol0
  Physical volume "/dev/sda" successfully created.
  Volume group "VGroup1" successfully created
  Logical volume "lvol0" created.
Running command: /usr/bin/ceph-authtool --gen-print-key
Running command: /usr/bin/ceph --cluster ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring -i - osd new 5a225676-2d28-49bb-a538-f9419f510ffe
-->  TypeError: memoryview: a bytes-like object is required, not 'str'

/var/log/ceph/ceph-volume.log:

[2018-07-19 03:11:29,138][ceph_volume.main][INFO  ] Running command: ceph-volume  lvm create --bluestore --data VGroup1/lvol0
[2018-07-19 03:11:29,149][ceph_volume.process][INFO  ] Running command: /usr/bin/ceph-authtool --gen-print-key
[2018-07-19 03:11:29,227][ceph_volume.process][INFO  ] stdout AQCxR1BbSDP7DBAAjwyHEhhoyoUnF41tq0IfXQ==
[2018-07-19 03:11:29,230][ceph_volume.process][INFO  ] Running command: /usr/bin/ceph --cluster ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring -i - osd new 5a225676-2d28-49bb-a538-f9419f510ffe
[2018-07-19 03:11:29,235][ceph_volume.devices.lvm.prepare][ERROR ] lvm prepare was unable to complete
[2018-07-19 03:11:29,236][ceph_volume.devices.lvm.prepare][INFO  ] will rollback OSD ID creation
[2018-07-19 03:11:29,237][ceph_volume][ERROR ] exception caught by decorator
Traceback (most recent call last):
  File "/usr/lib64/python3.5/site-packages/ceph_volume/decorators.py", line 59, in newfunc
    return f(*a, **kw)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/main.py", line 153, in main
    terminal.dispatch(self.mapper, subcommand_args)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/terminal.py", line 182, in dispatch
    instance.main()
  File "/usr/lib64/python3.5/site-packages/ceph_volume/devices/lvm/main.py", line 38, in main
    terminal.dispatch(self.mapper, self.argv)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/terminal.py", line 182, in dispatch
    instance.main()
  File "/usr/lib64/python3.5/site-packages/ceph_volume/devices/lvm/create.py", line 69, in main
    self.create(args)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/decorators.py", line 16, in is_root
    return func(*a, **kw)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/devices/lvm/create.py", line 26, in create
    prepare_step.safe_prepare(args)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/devices/lvm/prepare.py", line 216, in safe_prepare
    self.prepare(args)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/decorators.py", line 16, in is_root
    return func(*a, **kw)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/devices/lvm/prepare.py", line 245, in prepare
    self.osd_id = prepare_utils.create_id(osd_fsid, json.dumps(secrets), osd_id=args.osd_id)
  File "/usr/lib64/python3.5/site-packages/ceph_volume/util/prepare.py", line 72, in create_id
    show_command=True
  File "/usr/lib64/python3.5/site-packages/ceph_volume/process.py", line 200, in call
    stdout_stream, stderr_stream = process.communicate(stdin)
  File "/usr/lib64/python3.5/subprocess.py", line 803, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/usr/lib64/python3.5/subprocess.py", line 1441, in _communicate
    input_view = memoryview(self._input)
TypeError: memoryview: a bytes-like object is required, not 'str'

fenrir ~ # pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda
  VG Name               VGroup1
  PV Size               931.51 GiB / not usable 1.71 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              238467
  Free PE               0
  Allocated PE          238467
  PV UUID               hiLPNH-Tr4L-ZGna-s4QW-yPqu-iPgC-Vcquyh

fenrir ~ # vgdisplay
  --- Volume group ---
  VG Name               VGroup1
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               931.51 GiB
  PE Size               4.00 MiB
  Total PE              238467
  Alloc PE / Size       238467 / 931.51 GiB
  Free  PE / Size       0 / 0
  VG UUID               XD8JW4-CmeL-mYf2-Idp7-JBt4-pJ2d-JNqJ7t

fenrir ~ # lvdisplay
  --- Logical volume ---
  LV Path                /dev/VGroup1/lvol0
  LV Name                lvol0
  VG Name                VGroup1
  LV UUID                MUBIEC-wxRu-Fje3-iTl6-dw6u-kKz8-vdeGPY
  LV Write Access        read/write
  LV Creation host, time fenrir, 2018-07-19 03:11:27 -0500
  LV Status              available
  # open                 0
  LV Size                931.51 GiB
  Current LE             238467
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0

So, I have no idea how to proceed here.

TypeError: memoryview: a bytes-like object is required, not 'str'

Isn't a meaningful error message. Heck, combine "ceph-volume" with the python error message on Google and you get 2 results total, and neither of them has anything to do with either ceph or python.

lvm prepare was unable to complete
will rollback OSD ID creation

Doesn't give me any direction in how to trouble shoot... since I can (and did) create the logical volume by hand, I'm at a complete loss on what to investigate.

And, it's also a liar. It totally did not roll back the OSD id creation. Had to purge that by hand (ceph osd purge # --yes-i-really-mean-it).


Files

ceph-osd.7.log (635 KB) ceph-osd.7.log Michael Jones, 07/25/2018 04:21 PM
ceph-volume.log (30.6 KB) ceph-volume.log Michael Jones, 07/25/2018 04:21 PM
ceph.audit.log (9.12 KB) ceph.audit.log Michael Jones, 07/25/2018 04:31 PM
ceph.log (8.21 KB) ceph.log Michael Jones, 07/25/2018 04:31 PM
Actions

Also available in: Atom PDF