Bug #22280
closedceph-volume - ceph.conf parsing error, due to whitespace
0%
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):
Updated by Alfredo Deza over 6 years ago
- Assignee set to Alfredo Deza
- Priority changed from Normal to High
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
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
Updated by Alfredo Deza over 6 years ago
- Status changed from New to Fix Under Review
PR open at https://github.com/ceph/ceph/pull/19259
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.
Updated by Alfredo Deza over 6 years ago
- Status changed from Fix Under Review to Resolved
merged commit b7a9c44 into master
Updated by Alfredo Deza over 6 years ago
Luminous backport https://github.com/ceph/ceph/pull/19526