Project

General

Profile

Bug #15564

hammer errata list for satellite host throws error: NoMethodError: undefined method `installable_errata' for nil:NilClass

Added by Walden Raines about 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Errata Management
Target version:
Difficulty:
easy
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

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>'

Associated revisions

Revision 43e237e4 (diff)
Added by Walden Raines about 3 years ago

Fixes #15564: ensure host has content facet when getting errata.

We were assuming that all hosts have content facets when returning
errata. This commit returns an empty list if the host does not have
a content facet.

http://projects.theforeman.org/issues/15564

Revision 226b040c
Added by Walden Raines about 3 years ago

Merge pull request #6161 from waldenraines/15564

Fixes #15564: ensure host has content facet when getting errata.

History

#1 Updated by The Foreman Bot about 3 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/6161 added

#2 Updated by Walden Raines about 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Justin Sherrill about 3 years ago

  • Category set to Errata Management
  • Legacy Backlogs Release (now unused) set to 143
  • Difficulty set to easy

Also available in: Atom PDF