Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1370442 - hammer host collection throws 500 internal server error for undefined method `id' for nil:NilClass
Summary: hammer host collection throws 500 internal server error for undefined method...
Keywords:
Status: CLOSED DUPLICATE of bug 1331875
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Host Collections
Version: 6.2.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-26 10:45 UTC by Anand Agrawal
Modified: 2016-08-29 14:49 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-29 14:49:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Anand Agrawal 2016-08-26 10:45:42 UTC
Description of problem:
Following command - 
hammer -d  host-collection list

returns the below error -

undefined method `id' for nil:NilClass

RestClient::InternalServerError (500 Internal Server Error):
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/rest-client-1.8.0/lib/restclient/abstract_response.rb:74:in `return!'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/apipie-bindings-0.0.17/lib/apipie_bindings/api.rb:309:in `block in rest_client_call_block'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:493:in `process_result'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:421:in `block in transmit'
    /home/aagrawal/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/net/http.rb:853:in `start'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:413:in `transmit'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:176:in `execute'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `execute'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/rest-client-1.8.0/lib/restclient/resource.rb:51:in `get'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/apipie-bindings-0.0.17/lib/apipie_bindings/api.rb:293:in `call_client'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/apipie-bindings-0.0.17/lib/apipie_bindings/api.rb:222:in `http_call'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/apipie-bindings-0.0.17/lib/apipie_bindings/api.rb:172:in `call_action'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/apipie-bindings-0.0.17/lib/apipie_bindings/api.rb:167:in `call'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/apipie-bindings-0.0.17/lib/apipie_bindings/resource.rb:14:in `call'
    /home/aagrawal/fork_project/new_hammer_repos/hammer-cli/lib/hammer_cli/apipie/command.rb:43:in `send_request'
    /home/aagrawal/fork_project/new_hammer_repos/hammer-cli-foreman/lib/hammer_cli_foreman/commands.rb:190:in `send_request'
    /home/aagrawal/fork_project/new_hammer_repos/hammer-cli-foreman/lib/hammer_cli_foreman/commands.rb:280:in `send_request'
    /home/aagrawal/fork_project/new_hammer_repos/hammer-cli-foreman/lib/hammer_cli_foreman/commands.rb:315:in `retrieve_all'
    /home/aagrawal/fork_project/new_hammer_repos/hammer-cli-foreman/lib/hammer_cli_foreman/commands.rb:299:in `execute'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /home/aagrawal/fork_project/new_hammer_repos/hammer-cli/lib/hammer_cli/abstract.rb:22:in `run'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /home/aagrawal/fork_project/new_hammer_repos/hammer-cli/lib/hammer_cli/abstract.rb:22:in `run'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /home/aagrawal/fork_project/new_hammer_repos/hammer-cli/lib/hammer_cli/abstract.rb:22:in `run'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
    /home/aagrawal/fork_project/new_hammer_repos/hammer-cli/bin/hammer:125:in `<top (required)>'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/bin/hammer:23:in `load'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/bin/hammer:23:in `<main>'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'

though with organization-id it works fine


Version-Release number of selected component (if applicable):
Satellite 6.2

How reproducible:
Always

Steps to Reproduce:
1. on satellite terminal run below command:
hammer host-collection list

Actual results:

undefined method `id' for nil:NilClass

RestClient::InternalServerError (500 Internal Server Error):
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/rest-client-1.8.0/lib/restclient/abstract_response.rb:74:in `return!'
    /home/aagrawal/.rvm/gems/ruby-2.3.0/gems/apipie-bindings-0.0.17/lib/apipie_bindings/api.rb:309:in `block in rest_client_call_block'
   

Expected results:
Host collection list

ID | NAME   | LIMIT | DESCRIPTION
---|--------|-------|------------
   |        |       |            
---|--------|-------|------------


Additional info:

Comment 2 Brad Buckingham 2016-08-29 14:49:42 UTC
The behavior observed is actually the result of an issue in the API.  That issue has been solved in the upstream and will be delivered in a future release of Satellite 6.

*** This bug has been marked as a duplicate of bug 1331875 ***


Note You need to log in before you can comment on or make changes to this bug.