Skip to content

cephadm: UX: Change error message when 'orch host add <host>' fails#35547

Merged
tchaikov merged 1 commit intoceph:masterfrom
adk3798:cephadm-45097
Jun 17, 2020
Merged

cephadm: UX: Change error message when 'orch host add <host>' fails#35547
tchaikov merged 1 commit intoceph:masterfrom
adk3798:cephadm-45097

Conversation

@adk3798
Copy link
Contributor

@adk3798 adk3798 commented Jun 11, 2020

Instead of printing out a traceback if adding the host fails
during bootstrapping process, should now print error message
telling user host failed to be added

Fixes: https://tracker.ceph.com/issues/45097
Signed-off-by: Adam King adking@redhat.com

@adk3798 adk3798 requested a review from a team as a code owner June 11, 2020 18:14
@adk3798
Copy link
Contributor Author

adk3798 commented Jun 11, 2020

Sample output when add host fails
newMessage

Also, the error message itself is completely up for discussion if anybody has ideas to improve it. Right now it's "Failed to ssh into host as root. Please check troubleshooting ssh-errors section of ceph documentation for more info."

Copy link
Contributor

@mgfritch mgfritch left a comment

Choose a reason for hiding this comment

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

I think we can keep the error msg very simple since most (or all?) of the actual failure context would be contained in the log lines from stderr ?

otherwise, lgtm!

try:
cli(['orch', 'host', 'add', host])
except RuntimeError as e:
raise Error('Failed to ssh into host %s as root. Please check troubleshooting ssh-errors section of ceph documentation for more info.' % (host))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
raise Error('Failed to ssh into host %s as root. Please check troubleshooting ssh-errors section of ceph documentation for more info.' % (host))
raise Error('Unable to add host: %s' % (host))

I think this can fail for more reasons than just failure to ssh ..

Copy link
Contributor Author

@adk3798 adk3798 Jun 11, 2020

Choose a reason for hiding this comment

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

I think you're probably right about it possibly being non-ssh issues. I'll remove that part. Do you think the recommendation to check the troubleshooting docs should be taken out entirely, or just changed so it it doesn't mention ssh specifically?

Copy link
Contributor

@mgfritch mgfritch Jun 11, 2020

Choose a reason for hiding this comment

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

I think consulting the troubleshooting guide is a given for any error, not just this one, so I'd probably drop that part too ...

@sebastian-philipp wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can drop this sentence. I mean, https://docs.ceph.com/docs/master/cephadm/troubleshooting/#ssh-errors is basically same as the error message of the exception.

@adk3798
Copy link
Contributor Author

adk3798 commented Jun 15, 2020

Changed error message to simpler message

try:
cli(['orch', 'host', 'add', host])
except RuntimeError as e:
raise Error('Failed to add host: %s' % (host))
Copy link
Member

@jmolmo jmolmo Jun 15, 2020

Choose a reason for hiding this comment

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

Always is interesting to have information about why the command failed.. please include the error message:
raise Error('failed to add host <%s>: %s' % (host,e))

Instead of printing out a traceback if adding the host fails
during bootstrapping process, should now print error message
telling user host failed to be added

Fixes: https://tracker.ceph.com/issues/45097
Signed-off-by: Adam King <adking@redhat.com>
@adk3798
Copy link
Contributor Author

adk3798 commented Jun 15, 2020

Added given error message from exception to the printout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants