]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/cephadm: handle HostConnectionError when checking for valid addr 50900/head
authorAdam King <adking@redhat.com>
Wed, 15 Mar 2023 17:18:02 +0000 (13:18 -0400)
committerAdam King <adking@redhat.com>
Wed, 5 Apr 2023 19:36:07 +0000 (15:36 -0400)
commita9203d8c4aee26d3b2ee5116126593294d9174d3
tree8d379227772294b3bb0f7654e9a83586dc758320
parent8b88d76591e7a09b20f71968c37362772044a299
mgr/cephadm: handle HostConnectionError when checking for valid addr

Otherwise, the error is not properly passed back up the chain
and the user can get an error message like

TypeError: __init__() missing 2 required positional arguments: 'hostname' and 'addr'

when trying to add a host, despite the actual problem being

cephadm.ssh.HostConnectionError: Failed to connect to vm-01 (192.168.122.248). Permission denied

The tracker shows a bit more, but generally trying to add a host
that doesn't have the proper pub-key set as an authorized key
will get a misleasing error message. With this patch, the error message looks like

[ceph: root@vm-00 /]# ceph orch host add vm-01 192.168.122.29
Error EINVAL: Failed to connect to vm-01 (192.168.122.29). Permission denied
Log: Opening SSH connection to 192.168.122.29, port 22
[conn=1] Connected to SSH server at 192.168.122.29, port 22
[conn=1]   Local address: 192.168.122.156, port 49552
[conn=1]   Peer address: 192.168.122.29, port 22
[conn=1] Beginning auth for user root
[conn=1] Auth failed for user root
[conn=1] Connection failure: Permission denied
[conn=1] Aborting connection

which is much more useful

Fixes: https://tracker.ceph.com/issues/59081
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit efc6c585562ceda55a37ae591bf3c15ab35cdda8)
src/pybind/mgr/cephadm/module.py