Bug 1772884

Summary: Running hammer auth login basic command remotely gives Error: No such device or address @ rb_sysopen - /dev/tty
Product: Red Hat Satellite Reporter: Nikhil Kathole <nkathole>
Component: HammerAssignee: Martin Bacovsky <mbacovsk>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.7.0CC: apatel, egolov, kgaikwad, mbacovsk, mhulan, mshira, ofedoren, rabajaj
Target Milestone: 6.7.0Keywords: AutomationBlocker, Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-hammer_cli_foreman-0.19.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-14 15:54:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nikhil Kathole 2019-11-15 12:49:32 UTC
Description of problem:

Running hammer auth login basic command remotely gives Error: No such device or address @ rb_sysopen - /dev/tty


Version-Release number of selected component (if applicable):
Satellite 6.7 snap 1


How reproducible:
always

Steps to Reproduce:
1. set use_session as true in hammer config
2. ssh root.com "hammer auth login basic --username=CqVvXhXCSf --password=ExZccFurXO"

Actual results:
Error: No such device or address @ rb_sysopen - /dev/tty

Expected results:
Should run successfully.

Additional info: This is regression as the previous hammer auth login command was working fine if run remotely. Also this is automation blocker.

Comment 4 Nikhil Kathole 2019-11-19 13:17:21 UTC
[ INFO 2019-11-19T08:15:34 HammerCLI::MainCommand] Called with options: {"option_debug"=>true}
[ INFO 2019-11-19T08:15:34 HammerCLIForeman::Auth] Called with options: {}
[ INFO 2019-11-19T08:15:34 HammerCLIForeman::Auth::LoginCommand] Called with options: {}
[ INFO 2019-11-19T08:15:34 HammerCLIForeman::Auth::LoginCommand::Basic] Called with options: {"option_username"=>"CqVvXhXCSf", "option_password"=>"***"}
[DEBUG 2019-11-19T08:15:34 SSLoptions] SSL options: {
    :ssl_ca_file => "/etc/pki/katello/certs/katello-server-ca.crt",
     :verify_ssl => true
}
[DEBUG 2019-11-19T08:15:34 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[DEBUG 2019-11-19T08:15:34 API] Follow redirects: never
[DEBUG 2019-11-19T08:15:34 Connection] Registered: foreman
[DEBUG 2019-11-19T08:15:34 Exception] Using exception handler HammerCLIForeman::ExceptionHandler#handle_general_exception
[ERROR 2019-11-19T08:15:34 Exception] Error: No such device or address @ rb_sysopen - /dev/tty
Error: No such device or address @ rb_sysopen - /dev/tty
[ERROR 2019-11-19T08:15:34 Exception] 

Errno::ENXIO (No such device or address @ rb_sysopen - /dev/tty):
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.19.0/lib/hammer_cli/utils.rb:86:in `sysopen'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.19.0/lib/hammer_cli/utils.rb:86:in `interactive_output'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.19.0/lib/hammer_cli_foreman/authenticate/login.rb:7:in `execute_with_params'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.19.0/lib/hammer_cli_foreman/auth.rb:20:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.19.0/lib/hammer_cli/abstract.rb:76:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.19.0/lib/hammer_cli/abstract.rb:76:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.19.0/lib/hammer_cli/abstract.rb:76:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.19.0/lib/hammer_cli/abstract.rb:76:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.19.0/bin/hammer:147:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'

Comment 5 Martin Bacovsky 2019-11-20 14:36:20 UTC
Created redmine issue https://projects.theforeman.org/issues/28318 from this bug

Comment 6 Bryan Kearney 2019-11-20 17:01:57 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28318 has been resolved.

Comment 7 Nikhil Kathole 2019-12-02 14:08:12 UTC
VERIFIED

Version tested:
Satellite 6.7 snap 4

# ssh root.com "hammer auth login basic --username=admin --password=changeme"
Successfully logged in as 'admin'.

Comment 10 errata-xmlrpc 2020-04-14 15:54:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1455