Project

General

Profile

Actions

Bug #22280

closed

ceph-volume - ceph.conf parsing error, due to whitespace

Added by Alwin Antreich over 6 years ago. Updated over 6 years ago.

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

0%

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

Description

If the ceph.conf has leading whitespace ceph-volume fails with a parsing error. But works if you remove the whitespace.

root@sumi2:~# ceph-volume lvm create --bluestore --data /dev/sdf
--> Unable to read configuration file: /etc/ceph/ceph.conf
--> File contains parsing errors: /etc/ceph/ceph.conf
    [line  2]: '        auth client required = cephx\n'
    [line  3]: '        auth cluster required = cephx\n'
    [line  4]: '        auth service required = cephx\n'
    [line  5]: '        cluster network = 10.10.10.0/24\n'
    [line  6]: '        fsid = 5a03e18d-d99d-4686-878c-f48dcdab3270\n'
    [line  7]: '        keyring = /etc/pve/priv/$cluster.$name.keyring\n'
    [line  8]: '        mon allow pool delete = true\n'
    [line  9]: '        osd journal size = 5120\n'
    [line 10]: '        osd pool default min size = 2\n'
    [line 11]: '        osd pool default size = 3\n'
    [line 12]: '        public network = 10.10.10.0/24\n'
    [line 15]: '        keyring = /var/lib/ceph/osd/ceph-$id/keyring\n'
    [line 18]: '        host = sumi3\n'
    [line 19]: '        mon addr = 10.10.10.36:6789\n'
    [line 22]: '        host = sumi1\n'
    [line 23]: '        mon addr = 10.10.10.34:6789\n'
    [line 26]: '        host = sumi2\n'
    [line 27]: '        mon addr = 10.10.10.35:6789\n'
No handlers could be found for logger "ceph_volume.configuration" 
--> Unable to read configuration file: /etc/ceph/ceph.conf
--> File contains parsing errors: /etc/ceph/ceph.conf
    [line  2]: '        auth client required = cephx\n'
    [line  3]: '        auth cluster required = cephx\n'
    [line  4]: '        auth service required = cephx\n'
    [line  5]: '        cluster network = 10.10.10.0/24\n'
    [line  6]: '        fsid = 5a03e18d-d99d-4686-878c-f48dcdab3270\n'
    [line  7]: '        keyring = /etc/pve/priv/$cluster.$name.keyring\n'
    [line  8]: '        mon allow pool delete = true\n'
    [line  9]: '        osd journal size = 5120\n'
    [line 10]: '        osd pool default min size = 2\n'
    [line 11]: '        osd pool default size = 3\n'
    [line 12]: '        public network = 10.10.10.0/24\n'
    [line 15]: '        keyring = /var/lib/ceph/osd/ceph-$id/keyring\n'
    [line 18]: '        host = sumi3\n'
    [line 19]: '        mon addr = 10.10.10.36:6789\n'
    [line 22]: '        host = sumi1\n'
    [line 23]: '        mon addr = 10.10.10.34:6789\n'
    [line 26]: '        host = sumi2\n'
    [line 27]: '        mon addr = 10.10.10.35:6789\n'
-->  AttributeError: 'NoneType' object has no attribute 'get'

AFAICT, the class _TrimIndentFile is nowhere called in the ceph-volume package.

ceph_volume/configuration.py
class _TrimIndentFile(object):
Actions #1

Updated by Alfredo Deza over 6 years ago

  • Assignee set to Alfredo Deza
  • Priority changed from Normal to High
Actions #2

Updated by Alfredo Deza over 6 years ago

Do you know what version of Python are you using to trigger this? I was only able to replicate with 2.6 which is deprecated already. Also, what distro/version would help

Actions #3

Updated by Alwin Antreich over 6 years ago

Alfredo Deza wrote:

Do you know what version of Python are you using to trigger this? I was only able to replicate with 2.6 which is deprecated already. Also, what distro/version would help

root@sumi1:~# python -V
Python 2.7.13

root@sumi1:~# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 9 (stretch)" 

root@sumi1:~# cat /etc/debian_version 
9.1
Actions #4

Updated by Alfredo Deza over 6 years ago

  • Status changed from New to Fix Under Review
Actions #5

Updated by Alwin Antreich over 6 years ago

Did a test of the PR on my ceph cluster, it worked with a ceph.conf that has different levels of whitespace.

Actions #6

Updated by Brad Hubbard over 6 years ago

  • Category set to 135
Actions #7

Updated by Alfredo Deza over 6 years ago

  • Status changed from Fix Under Review to Resolved

merged commit b7a9c44 into master

Actions

Also available in: Atom PDF