Description of problem: The hammer error messages are not helpful to a new user of hammer Version-Release number of selected component (if applicable): [root@rhel7-2-sat6-1 ~]# rpm -q tfm-rubygem-hammer_cli tfm-rubygem-hammer_cli-0.5.1.11-4.el7sat.noarch Actual results: with no defaults set and no credentials file: [root@rhel7-2-sat6-1 ~]# hammer job-invocation output --host "rhel7-2-sat6-1.example.com" --id 1 [Foreman] Password for admin: Error initializing command #<Proxy::RemoteExecution::Ssh::Dispatcher::Command:0x0000000191e5c8> Net::SSH::AuthenticationFailed Authentication failed for user root.122.98 Exit status: EXCEPTION In the above I can guess that is a user name and password failure, but it seems to contain information best left for the logs. The example below does not give me a hint what I have done wrong: [root@rhel7-2-sat6-1 ~]# hammer job-invocation output --host "rhel7-2-sat6-1.example.com" --name ping [Foreman] Password for admin: Error: 400 Bad Request after adding a credentials file: [root@rhel7-2-sat6-1 ~]# hammer organization list Error: undefined method `request' for #<String:0x00000003b33320>
forgot to add this one, also before setting any defaults and with no credentials file: [root@rhel7-2-sat6-1 ~]# hammer job-invocation output --id 14 --host rhel7-2-sat6-1.example.com [Foreman] Password for admin: undefined method `pending?' for nil:NilClass
Hello I had a mistake in my credentials file, https was missing in the "host" line[1]. So the last example in comment 0 now works: [root@rhel7-2-sat6-1 ~]# hammer organization list ---|----------------------|----------------------|------------ ID | NAME | LABEL | DESCRIPTION ---|----------------------|----------------------|------------ 1 | Default Organization | Default_Organization | ---|----------------------|----------------------|------------ [1] "Authentication" https://access.redhat.com/documentation/en/red-hat-satellite/6.2/paged/hammer-cli-guide/12-authentication
Hello When I ran this: [root@rhel7-2-sat6-1 ~]# hammer job-invocation create --job-template "Ping a Host" --search-query "name = rhel7-2-sat6-1.example.com" Job invocation 17 created [.................................................] [100%] 1 task(s), 1 success, 0 fail and then in the web UI went to Jobs, I saw the job but when I tried to view the details I saw: Oops, we're sorry but something went wrong undefined method `name' for nil:NilClass Is that already a known issue? I will attach the trace just in case.
With 6.3, the job invocation output should better handle the exceptions: bin/hammer job-invocation output --id 581 --host='host-5.foreman.test' Error initializing command: Net::SSH::AuthenticationFailed - Authentication failed for user root.0.4 Exit status: EXCEPTION For the --name argument: the issue is with should not even show the name argument for this command, filing an issue for that.
Created redmine issue http://projects.theforeman.org/issues/21852 from this bug
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.