-
Notifications
You must be signed in to change notification settings - Fork 79
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
Always use SSH in non-interactive mode #319
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The default configuration of the `net/ssh` gem uses _interactive_ mode. That means that when authentication with a provided password fails, the gem will retry, discarding the provided password and asking interactively for a new one. In the ManageIQ environment this will always fail, because there is no human user to type that alternative password. The result is the following error: Errno::ENOTTY: Inappropriate ioctl for device That happens when the gem tries to read the password using the `IO#noecho` method, because inside the ManageIQ process `$stdin` isn't attached to a terminal. The net result is an exception that isn't caught by the gem, and scary error messages in the log and in the UI. To avoid these problems this patch adds the `:non_interactive => true` option to the constructor of the SSH client. This instructs the gem to never retry failed authentications interactively. This addresses the following bug: Password change for a Host fails with error code 500 https://bugzilla.redhat.com/1516849 Signed-off-by: Juan Hernandez <[email protected]>
@pkliczewski @agrare please review. |
Checked commit https://github.com/jhernand/manageiq-gems-pending/commit/2e11a920da8c7fee52938ad920798dfa71b6238a with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 |
pkliczewski
approved these changes
Dec 12, 2017
agrare
approved these changes
Dec 12, 2017
@miq-bot add_labels bug, gaprindashvili/yes |
simaishi
pushed a commit
that referenced
this pull request
Dec 14, 2017
Always use SSH in non-interactive mode (cherry picked from commit 6372d23) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1526060
Gaprindashvili backport details:
|
cc @gmcculloug |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The default configuration of the
net/ssh
gem uses interactive mode.That means that when authentication with a provided password fails, the
gem will retry, discarding the provided password and asking
interactively for a new one. In the ManageIQ environment this will
always fail, because there is no human user to type that alternative
password. The result is the following error:
Errno::ENOTTY: Inappropriate ioctl for device
That happens when the gem tries to read the password using the
IO#noecho
method, because inside the ManageIQ process$stdin
isn'tattached to a terminal.
The net result is an exception that isn't caught by the gem, and scary
error messages in the log and in the UI.
To avoid these problems this patch adds the
:non_interactive => true
option to the constructor of the SSH client. This instructs the gem to
never retry failed authentications interactively.
Fixes https://bugzilla.redhat.com/1516849