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 1152470 - [Activation_key] add_subscription command failing with exception: Missing arguments for 'subscriptions'
Summary: [Activation_key] add_subscription command failing with exception: Missing arg...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: Nightly
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Christine Fouant
QA Contact: Sachin Ghai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-14 08:47 UTC by Sachin Ghai
Modified: 2019-03-22 07:20 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 05:18:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1592 0 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 09:04:35 UTC

Description Sachin Ghai 2014-10-14 08:47:12 UTC
Description of problem:
I was trying to add subscriptions to activation_key using add_subscription sub-command and got following:

[root@dhcp207-190 ~]# hammer -v -d -u admin -p xxxxx  activation-key add-subscription --id '13' --subscription-id '8ac14f3e48f4c67e01490dba93151bfc' --quantity '1'
[ INFO 2014-10-14 14:02:48 Init] Initialization of Hammer CLI (0.1.3) has started...
[DEBUG 2014-10-14 14:02:48 Init] Running at ruby 1.8.7-p374
[ INFO 2014-10-14 14:02:48 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2014-10-14 14:02:48 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2014-10-14 14:02:48 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2014-10-14 14:02:48 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:67: warning: already initialized constant DEFAULT_LABEL_INDENT
[DEBUG 2014-10-14 14:02:48 Connection] Registered: foreman
[DEBUG 2014-10-14 14:02:48 API] Global headers: {
    "Accept-Language" => "en",
              :accept => "application/json;version=2",
        :content_type => "application/json"
}
[ INFO 2014-10-14 14:02:49 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2014-10-14 14:02:49 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2014-10-14 14:02:49 Modules] Extension module hammer_cli_katello (0.0.6) loaded
[ INFO 2014-10-14 14:02:49 Modules] Extension module hammer_cli_foreman (0.1.3) loaded
[ INFO 2014-10-14 14:02:49 Modules] Extension module hammer_cli_import (0.10.4) loaded
[DEBUG 2014-10-14 14:02:49 Init] Using locale 'en'
[DEBUG 2014-10-14 14:02:49 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/locale'
[DEBUG 2014-10-14 14:02:49 Init] 'mo' files for locale domain 'hammer-cli@system' loaded from '/usr/share/locale'
[DEBUG 2014-10-14 14:02:49 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/locale'
[DEBUG 2014-10-14 14:02:49 Init] 'mo' files for locale domain 'hammer-cli-foreman@system' loaded from '/usr/share/locale'
[DEBUG 2014-10-14 14:02:49 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.6/locale'
[ INFO 2014-10-14 14:02:49 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_password"=>"***", "option_username"=>"admin", "option_debug"=>true}
[ INFO 2014-10-14 14:02:49 HammerCLIKatello::ActivationKeyCommand] Called with options: {}
[ INFO 2014-10-14 14:02:49 HammerCLIKatello::ActivationKeyCommand::AddSubscriptionCommand] Called with options: {"option_quantity"=>"1", "option_subscription_id"=>"8ac14f3e48f4c67e01490dba93151bfc", "option_id"=>"13"}
[ERROR 2014-10-14 14:02:49 Exception] Missing arguments for 'subscriptions'
Could not add subscription to activation key:
  Missing arguments for 'subscriptions'
[ERROR 2014-10-14 14:02:49 Exception] 

ApipieBindings::MissingArgumentsError (Missing arguments for 'subscriptions'):
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.10/lib/apipie_bindings/action.rb:62:in `validate!'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.10/lib/apipie_bindings/api.rb:151:in `call'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.10/lib/apipie_bindings/resource.rb:14:in `call'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/command.rb:42:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:164:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/command.rb:33:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:68:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:68:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:68:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:126:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/bin/hammer:106
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19


Please note that error says:
ApipieBindings::MissingArgumentsError (Missing arguments for 'subscriptions'):


However if you see the help, there is no such option subscriptions.

[root@dhcp207-190 ~]# hammer -v  -u admin -p changeme  activation-key add-subscription --help
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:67: warning: already initialized constant DEFAULT_LABEL_INDENT
Usage:
    hammer activation-key add-subscription [OPTIONS]

Options:
 --id ID                       resource ID
 --quantity QUANTITY           subscription quantity
 --subscription-id ID          subscription ID
 -h, --help                    print help


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


How reproducible:
always 

Steps to Reproduce:
1. create activation-key
2. import manifest..
3. list subscription
4. add subscription to activation-key

Actual results:
HammerCLIKatello::ActivationKeyCommand::AddSubscriptionCommand] Called with options: {"option_quantity"=>"1", "option_subscription_id"=>"8ac14f3e48f4c67e01490dba93151bfc", "option_id"=>"13"}
[ERROR 2014-10-14 14:02:49 Exception] Missing arguments for 'subscriptions'
Could not add subscription to activation key:
  Missing arguments for 'subscriptions'
[ERROR 2014-10-14 14:02:49 Exception] 


Expected results:


Additional info:

Comment 3 Elyézer Rezende 2014-10-17 21:02:22 UTC
The subscription argument is now being processed but the command still failing:

# LANG=en_US.UTF-8 hammer -v -u admin -p changeme  activation-key add-subscription --subscription-id='<sub_id>' --id='1' --quantity='10'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:67: warning: already initialized constant DEFAULT_LABEL_INDENT
[ERROR 2014-10-17 02:23:38 Exception] Katello::Resources::Candlepin::ActivationKey: 400 Bad Request {"displayMessage":"Error: Only pools with multi-entitlement product subscriptions can be added to the activation key with a quantity greater than one.","requestUuid":"24e5ef4b-b1ba-43f8-b5e3-89216561aaec"} (POST /candlepin/activation_keys/ff808081491cc24f01491cc671e50430/pools/ff808081491cc24f01491cc4d08603ac?quantity=10)
Could not add subscription to activation key:
  Katello::Resources::Candlepin::ActivationKey: 400 Bad Request {"displayMessage":"Error: Only pools with multi-entitlement product subscriptions can be added to the activation key with a quantity greater than one.","requestUuid":"24e5ef4b-b1ba-43f8-b5e3-89216561aaec"} (POST /candlepin/activation_keys/ff808081491cc24f01491cc671e50430/pools/ff808081491cc24f01491cc4d08603ac?quantity=10)
[ERROR 2014-10-17 02:23:38 Exception] 

RestClient::BadRequest (400 Bad Request):
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `transmit'
    /usr/lib/ruby/1.8/net/http.rb:543:in `start'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/resource.rb:80:in `put'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.10/lib/apipie_bindings/api.rb:199:in `send'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.10/lib/apipie_bindings/api.rb:199:in `http_call'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.10/lib/apipie_bindings/api.rb:154:in `call'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.10/lib/apipie_bindings/resource.rb:14:in `call'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/command.rb:42:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:164:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/command.rb:33:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:68:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:68:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:68:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:126:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/bin/hammer:106
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

Comment 4 Sachin Ghai 2014-10-20 10:57:11 UTC
As per comment 3, the reported issue is now fixed. However now getting different issue and for that a separate bz is filed: https://bugzilla.redhat.com/show_bug.cgi?id=1154619.

Moving this to verified.

Comment 5 Bryan Kearney 2015-08-11 13:37:42 UTC
This bug is slated to be released with Satellite 6.1.

Comment 6 errata-xmlrpc 2015-08-12 05:18:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:1592


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