Bug #15564
closedhammer errata list for satellite host throws error: NoMethodError: undefined method `installable_errata' for nil:NilClass
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1351040
Description of problem: I was just trying to list errata for all hosts and its working fine. But when I checked the errata list for satellite host itself, it failed to list with below error:
~]# hammer u admin -p changeme host list
--|--------------------------------------------|------------------|------------|---------------|------------------
ID | NAME | OPERATING SYSTEM | HOST GROUP | IP | MAC
---|--------------------------------------------|------------------|------------|---------------|------------------
1 | cloud-qe-06.idmqe.lab.eng.bos.redhat.com | RHEL Server 6.8 | | 10.19.34.35 | 34:40:b5:8a:43:ff
[root@cloud-qe-06 ~]# hammer -u admin -p changeme host errata list --host-id 1
undefined method `installable_errata' for nil:NilClass
Please note that "--host-id 1" is of satellite server's itself.
Version-Release number of selected component (if applicable):
sat6.2 GA snap17
How reproducible:
always
Steps to Reproduce:
1. hammer -u admin -p changeme host errata list --host-id <id_of_satellite_server_host>
2.
3.
Actual results:
[root@cloud-qe-06 ~]# hammer -u admin -p changeme host errata list --host-id 1
undefined method `installable_errata' for nil:NilClass
Expected results:
no exception
Additional info:
[DEBUG 2016-06-29 01:43:18 API] 500 Internal Server Error
{
"displayMessage" => "undefined method `installable_errata' for nil:NilClass",
"errors" => [
[0] "undefined method `installable_errata' for nil:NilClass"
]
}
[ERROR 2016-06-29 01:43:18 Exception] undefined method `installable_errata' for nil:NilClass
undefined method `installable_errata' for nil:NilClass
[ERROR 2016-06-29 01:43:18 Exception]
RestClient::InternalServerError (500 Internal Server Error):
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:308:in `block in rest_client_call_block'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:228:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:228:in `process_result'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
/opt/rh/rh-ruby22/root/usr/share/ruby/net/http.rb:853:in `start'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:51:in `get'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:295:in `call_client'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:224:in `http_call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:174:in `call_action'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:169:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/resource.rb:14:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.10/lib/hammer_cli/apipie/command.rb:43:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.8/lib/hammer_cli_foreman/commands.rb:190:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.8/lib/hammer_cli_foreman/commands.rb:280:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.8/lib/hammer_cli_foreman/commands.rb:303:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.10/lib/hammer_cli/abstract.rb:22:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.10/lib/hammer_cli/abstract.rb:22:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.10/lib/hammer_cli/abstract.rb:22:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.10/lib/hammer_cli/abstract.rb:22:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.10/bin/hammer:125:in `<top (required)>'
/usr/bin/hammer:23:in `load'
/usr/bin/hammer:23:in `<main>'