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 1195329 - hammer import activation-key shows MissingArgumentsError: organization_id while processing activation key
Summary: hammer import activation-key shows MissingArgumentsError: organization_id whi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Transitions
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Unspecified
Assignee: Grant Gainey
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-23 15:30 UTC by Lukas Pramuk
Modified: 2017-02-23 20:27 UTC (History)
5 users (show)

Fixed In Version: rubygem-hammer_cli_import-0.10.10-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 05:27:06 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 Lukas Pramuk 2015-02-23 15:30:07 UTC
Description of problem:
hammer import activation-key shows with MissingArgumentsError: organization_id while processing activation key, when related content views need to be imported yet. Inconsistent output with the actions taken:

Unable to import, first import content view with id 103
   vs.
Created 3 activation_keys. + Associating activation key [1] with content view [] 


Version-Release number of selected component (if applicable):
rubygem-hammer_cli_import-0.10.9-1.el6.noarch
(against Satellite-6.1.0-RHEL-6-20150217.0)

How reproducible:
100%

Steps to Reproduce:
1.# hammer import activation-key --verbose --csv-file /tmp/exports/activation-keys.csv'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:68: warning: already initialized constant DEFAULT_LABEL_INDENT
Importing from /tmp/exports/activation-keys.csv
Creating new activation key: 1-key
Unable to import, first import content view with id 103
Creating new activation key: 2-key
  Associating activation key [2] with host collections [1]
Unable to import, first import content view with id 101
Creating new activation key: 3-key
  Associating activation key [3] with host collections [2]
Unable to import, first import content view with id 102
  Associating activation key [1] with content view []
Updating activation key with id: 1
Caught ApipieBindings::MissingArgumentsError:ApipieBindings::MissingArgumentsError: organization_id while processing activation key 1
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/action.rb:62:in `validate!'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:158:in `call'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/resource.rb:14:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:128:in `api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:138:in `api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:143:in `mapped_api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:431:in `update_entity'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/activationkey.rb:119:in `post_import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/importtools.rb:302:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/importtools.rb:302:in `handle_missing_and_supress'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/activationkey.rb:106:in `post_import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/activationkey.rb:105:in `each'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/activationkey.rb:105:in `post_import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:555:in `execute'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/importtools.rb:302:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/importtools.rb:302:in `handle_missing_and_supress'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:554:in `execute'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:23: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:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:23: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:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:23:in `run'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/bin/hammer:108
/usr/bin/hammer:19:in `load'
/usr/bin/hammer:19
  Associating activation key [2] with content view []
Updating activation key with id: 2
Caught ApipieBindings::MissingArgumentsError:ApipieBindings::MissingArgumentsError: organization_id while processing activation key 2
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/action.rb:62:in `validate!'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:158:in `call'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/resource.rb:14:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:128:in `api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:138:in `api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:143:in `mapped_api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:431:in `update_entity'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/activationkey.rb:119:in `post_import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/importtools.rb:302:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/importtools.rb:302:in `handle_missing_and_supress'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/activationkey.rb:106:in `post_import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/activationkey.rb:105:in `each'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/activationkey.rb:105:in `post_import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:555:in `execute'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/importtools.rb:302:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/importtools.rb:302:in `handle_missing_and_supress'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:554:in `execute'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:23: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:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:23: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:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:23:in `run'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/bin/hammer:108
/usr/bin/hammer:19:in `load'
/usr/bin/hammer:19
  Associating activation key [3] with content view []
Updating activation key with id: 3
Caught ApipieBindings::MissingArgumentsError:ApipieBindings::MissingArgumentsError: organization_id while processing activation key 3
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/action.rb:62:in `validate!'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:158:in `call'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/resource.rb:14:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:128:in `api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:138:in `api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:143:in `mapped_api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:431:in `update_entity'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/activationkey.rb:119:in `post_import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/importtools.rb:302:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/importtools.rb:302:in `handle_missing_and_supress'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/activationkey.rb:106:in `post_import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/activationkey.rb:105:in `each'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/activationkey.rb:105:in `post_import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:555:in `execute'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/importtools.rb:302:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/importtools.rb:302:in `handle_missing_and_supress'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.9/lib/hammer_cli_import/base.rb:554:in `execute'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:23: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:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:23: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:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:23:in `run'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/bin/hammer:108
/usr/bin/hammer:19:in `load'
/usr/bin/hammer:19
Summary
  Created 3 activation_keys.

Actual results:
- inconsistency of status written and actions taken
- unmasked error in post_import

Expected results:
- activation keys should not be created if we say "Unable to import, first import content view"
- masked error in post_import

Comment 1 RHEL Program Management 2015-02-23 17:13:24 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Grant Gainey 2015-02-23 21:14:13 UTC
First - the keys are actually created - that happens at import_row time. So the "Created <n> activation keys." message is correct.

Connecting keys to content views is supposed to fail (in this particular use-case) due to the content-views not existing. The code would note a MissingObject exception,record an error-message, and continue.

However, the API apprently requires (has always required) that organization_id be passed to PUT /katello/api/activation_keys/:id .  In 6.0, not sending org-id works. The new apipie input-validation for 6.1 catches the missing (required) org-id, and aborts the update.

Must be fixed for 6.1 - as it stands, one cannot currently connect imported activation-keys with their content-views even when those views are sync'd. hammer-import-activation-key is broken ina clear regression from 6.0.

Comment 4 Grant Gainey 2015-02-24 19:09:03 UTC
organization-id added to update-call.

Error-messaging changed to be more clear - example:

===
(master) ~/hammer-cli-import $ hammer import activation-key --csv-file /tmp/exports/activation-keys2.csv --verbose --debug
Importing from /tmp/exports/activation-keys2.csv
Activation key [1-a4f348badebba01453ec5fa85ce06fd8->1] already imported.
Can't find content view for channel ID [101] for key [1-a4f348badebba01453ec5fa85ce06fd8]
Creating new activation key: 1-a689408807e6597555dca6672015b6fe
Can't find content view for channel ID [101] for key [1-a689408807e6597555dca6672015b6fe]
Can't find content view ifor channel ID [102] for key [1-a689408807e6597555dca6672015b6fe]
Can't find content view ifor channel ID [103] for key [1-a689408807e6597555dca6672015b6fe]
Activation key 1 taken from cache.
  Skipping content-view associations.
Activation key 3 taken from cache.
  Skipping content-view associations.
Summary
  Created 1 activation key.
  Found 1 activation key.
(master)
===

hammer-cli-import.github 86ba01c98e419b33c540b0afacfc9c8fd5c7698aq

Comment 6 Grant Gainey 2015-03-02 18:28:14 UTC
Argh - extraneous 'q' at the end of the commit-hash:

>> WRONG: 86ba01c98e419b33c540b0afacfc9c8fd5c7698aq
>> RIGHT: 86ba01c98e419b33c540b0afacfc9c8fd5c7698a

Please retry with 86ba01c98e419b33c540b0afacfc9c8fd5c7698a

Comment 9 Lukas Pramuk 2015-03-10 10:30:53 UTC
rubygem-hammer_cli_import-0.10.10.1
no such version on any compose?! ON_QA?

Comment 12 Lukas Pramuk 2015-03-10 13:32:00 UTC
VERIFIED.
Satellite-6.1.0-RHEL-6-20150303.0

# hammer import activation-key --verbose --csv-file /tmp/exports/activation-keys.csv'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:68: warning: already initialized constant DEFAULT_LABEL_INDENT
Importing from /tmp/exports/activation-keys.csv
Creating new activation key: 1-key
Can't find content view for channel ID [103] for key [1-key]
Can't find content view ifor channel ID [106] for key [1-key]
Creating new activation key: 2-key
  Associating activation key [2] with host collections [1]
Can't find content view for channel ID [101] for key [2-key]
Can't find content view ifor channel ID [111] for key [2-key]
Creating new activation key: 3-key
  Associating activation key [3] with host collections [2]
Can't find content view for channel ID [102] for key [3-key]
Can't find content view ifor channel ID [104] for key [3-key]
  Skipping content-view associations.
  Skipping content-view associations.
  Skipping content-view associations.
Summary
  Created 3 activation_keys.

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

Comment 14 errata-xmlrpc 2015-08-12 05:27:06 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.