Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgr/cephadm: handle HostConnectionError when checking for valid addr #50547

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

adk3798
Copy link
Contributor

@adk3798 adk3798 commented Mar 15, 2023

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

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

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>
@adk3798 adk3798 requested a review from a team as a code owner March 15, 2023 17:27
Copy link
Contributor

@phlogistonjohn phlogistonjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK to me

@adk3798
Copy link
Contributor Author

adk3798 commented Mar 20, 2023

jenkins retest this please

Copy link
Contributor

@rkachach rkachach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adk3798
Copy link
Contributor Author

adk3798 commented Mar 30, 2023

https://pulpito.ceph.com/adking-2023-03-15_01:34:51-orch:cephadm-wip-adk-testing-2023-03-14-1905-distro-default-smithi/

reruns of failed/dead jobs: https://pulpito.ceph.com/adking-2023-03-30_12:19:06-orch:cephadm-wip-adk-testing-2023-03-28-1716-distro-default-smithi/

After reruns, 6 failures:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants