Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1354536 - hostgroup create throws misleading error: resource have no errors
Summary: hostgroup create throws misleading error: resource have no errors
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Host Group
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-11 13:57 UTC by Sachin Ghai
Modified: 2016-12-20 19:40 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-20 19:40:19 UTC


Attachments (Terms of Use)

Description Sachin Ghai 2016-07-11 13:57:30 UTC
Description of problem:
I was trying to create hostgroup and it failed with error: resource have no errors

--organizations='Default Organization' --location-ids 1 --puppet-proxy-id 1   --puppet-ca-proxy-id 1 --root-pass redhat123 --subnet-id 12 --domain-id 1
Could not create the hostgroup:
  resource have no errors

the error message is misleading, user should get proper error if some option/parameter required or if any wrong value passed to hostgroup create cmd.

Version-Release number of selected component (if applicable):
sat6.2 GA snap19.1

How reproducible:


Steps to Reproduce:
1.  hammer -u admin -p changeme hostgroup create --name test123512 --organizations='Default Organization' --location-ids 1 --puppet-proxy-id 1   --puppet-ca-proxy-id 1 --root-pass redhat123 --subnet-id 12 --domain-id 1
2.
3.

Actual results:
Could not create the hostgroup:
  resource have no errors

Expected results:
user should proper error.

Additional info:
[ INFO 2016-07-11 09:52:24 API] Server: https://localhost/
[ INFO 2016-07-11 09:52:24 API] POST /api/hostgroups
[DEBUG 2016-07-11 09:52:24 API] Params: {
    "hostgroup" => {
                      "name" => "test123512",
           "architecture_id" => 1,
        "puppet_ca_proxy_id" => 1,
                 "subnet_id" => 12,
                 "domain_id" => 1,
           "puppet_proxy_id" => 1,
              "location_ids" => [
            [0] "1"
        ],
          "organization_ids" => [
            [0] 1
        ],
           "puppetclass_ids" => nil,
                 "root_pass" => "redhat123"
    }
}
[DEBUG 2016-07-11 09:52:24 API] Headers: {}
[DEBUG 2016-07-11 09:52:24 API] 500 Internal Server Error
{
    "error" => {
        "message" => "resource have no errors"
    }
}
[ERROR 2016-07-11 09:52:24 Exception] resource have no errors
Could not create the hostgroup:
  resource have no errors
[ERROR 2016-07-11 09:52:24 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:67:in `post'
    /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.11/lib/hammer_cli/apipie/command.rb:43:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.9/lib/hammer_cli_foreman/commands.rb:190:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/apipie/command.rb:34: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.11/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.11/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.11/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.11/bin/hammer:125:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'

Comment 2 Tomer Brisker 2016-12-20 19:40:19 UTC
Seems to work in Satellite 6.2.6:

# hammer -u admin -p changeme hostgroup create --name test12345 --organizations='Test_Org' --location-ids 1 --puppet-proxy-id 1   --puppet-ca-proxy-id 1 --root-pass redhat123 --subnet-id 1 --domain-id 1
Hostgroup created

Closing, feel free to reopen if reproducible.


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