Project

General

Profile

Actions

Bug #55555

closed

cephadm: bootstrap with --skip-admin-label causes KeyError traceback for --apply-spec

Added by Voja Molani almost 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Category:
cephadm
Target version:
-
% Done:

0%

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

Description

When --skip-admin-label is passed to cephadm together with --apply-spec cluster.yaml there is a traceback:

cephadm --image 'https://registry.example.com/ceph' bootstrap --config ceph.conf --ssh-private-key /root/cephadm-key --ssh-public-key /root/cephadm-key.pub --allow-fqdn-hostname --registry-url https://registry.example.com --registry-username cephadm --registry-password password --cluster-network 192.0.2.0/24 --initial-dashboard-user ceph --initial-dashboard-password ceph --mon-ip 10.0.0.101 --apply-spec cluster.yaml --skip-firewalld --dashboard-password-noupdate --dashboard-key cert.key --dashboard-crt cert.crt --skip-ssh --skip-admin-label

[...]

Applying cluster.yaml to cluster
Traceback (most recent call last):
  File "/usr/sbin/cephadm", line 8634, in <module>
    main()
  File "/usr/sbin/cephadm", line 8622, in main
    r = ctx.func(ctx)
  File "/usr/sbin/cephadm", line 1938, in _default_image
    return func(ctx)
  File "/usr/sbin/cephadm", line 5137, in command_bootstrap
    for spec in parse_yaml_objs(f):
  File "/usr/sbin/cephadm", line 4920, in parse_yaml_objs
    objs.append(_parse_yaml_obj(d))
  File "/usr/sbin/cephadm", line 4907, in _parse_yaml_obj
    obj[current_key] += line.strip()
KeyError: ''

SSH keys and firewall are managed separately. Cephadm is from https://raw.githubusercontent.com/ceph/ceph/quincy/src/cephadm/cephadm

The spec file has been linted without errors and such an error is not seen without --skip-admin-label. The --skip-admin-label switch is being tried because without it cephadm errors at trying to add admin label to "nonexisting" host which could be a subject for another story....


Files

cluster.yaml (1.75 KB) cluster.yaml Voja Molani, 05/05/2022 11:51 AM
Actions #1

Updated by Voja Molani almost 2 years ago

Seems editing the issue is impossible. After adding debugging prints to cephadm, it seems the issue is not related to --skip-admin-label - it chokes parsing the SSL certificate.

Additionally the private key may be in wrong format in the attached cluster.yaml but the error persists even when the certificate is moved after the public key and changed to format:

    -----BEGIN PRIVATE KEY-----
    -----END PRIVATE KEY-----
Actions #2

Updated by Voja Molani almost 2 years ago

It seems like cephadm is not ready for bootstrapping ingress at all: if I understand correctly any line containing --- somewhere on it is considered a change of doc:

        if '---' in line:

This should probably instead check if the line is exactly ---.
But after doing that change the cluster.yaml still does not apply:

Unable to parse cluster.yaml succesfully
Actions #3

Updated by Redouane Kachach Elhichou almost 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Redouane Kachach Elhichou
Actions #4

Updated by Redouane Kachach Elhichou almost 2 years ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 46207
Actions #5

Updated by Redouane Kachach Elhichou almost 2 years ago

  • Status changed from Fix Under Review to Resolved
Actions #6

Updated by Redouane Kachach Elhichou almost 2 years ago

  • Status changed from Resolved to Pending Backport
Actions #7

Updated by Redouane Kachach Elhichou almost 2 years ago

  • Backport set to quincy,pacific
Actions #8

Updated by Redouane Kachach Elhichou almost 2 years ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF