Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1222448

Summary: hammer import activation-key caught ArgumentError:missing param 'content_view_id' during post_import
Product: Red Hat Satellite Reporter: Lukas Pramuk <lpramuk>
Component: TransitionsAssignee: Tomas Lestach <tlestach>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Pramuk <lpramuk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: bbuckingham, bkearney, cperry, ggainey
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-12 13:58:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lukas Pramuk 2015-05-18 08:57:54 UTC
Description of problem:
Activationkey CV is not created, instead ArgumentError:missing param 'content_view_id' in parameters while processing activation key 2 was caught.


Version-Release number of selected component (if applicable):
Satellite-6.1.0-RHEL-6-20150513.0
rubygem-hammer_cli_import-0.10.6.5-1.el6_6sat.noarch

How reproducible:
100%

Steps to Reproduce:
1.# hammer import activation-key --verbose --csv-file /tmp/exports/activation-keys.csv
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 ifor channel ID [111] for key [2-key]
Creating new activation key: 3-key
  Associating activation key [3] with host collections [2]
  Skipping content-view associations.
Caught ArgumentError:missing param 'content_view_id' in parameters while processing activation key 2
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/route.rb:22:in `path'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:260:in `inject'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/route.rb:20:in `each'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/route.rb:20:in `inject'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/route.rb:20:in `path'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:162: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.6.5/lib/hammer_cli_import/base.rb:128:in `api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:138:in `api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:287:in `list_server_entities'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/importtools.rb:171:in `create_composite_content_view'
/usr/lib/ruby/1.8/set.rb:194:in `each'
/usr/lib/ruby/1.8/set.rb:194:in `each_key'
/usr/lib/ruby/1.8/set.rb:194:in `each'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/importtools.rb:170:in `create_composite_content_view'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/activationkey.rb:119:in `post_import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/importtools.rb:303:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/importtools.rb:303:in `handle_missing_and_supress'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/activationkey.rb:114:in `post_import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/activationkey.rb:113:in `each'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/activationkey.rb:113:in `post_import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:555:in `execute'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/importtools.rb:303:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/importtools.rb:303:in `handle_missing_and_supress'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/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.10/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.10/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.10/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.10/bin/hammer:108
/usr/bin/hammer:19:in `load'
/usr/bin/hammer:19
Creating new ak content view: ak_3
  Publishing content view: 15
  Associating activation key [3] with content view [15]
Updating activation key with id: 3
Summary
  Created 1 ak content view.
  Created 3 activation_keys.
---

Successive non-verbose run:
# hammer import activation-key --csv-file /tmp/exports/activation-keys.csv
Can't find content view ifor channel ID [111] for key [2-key]
Caught ArgumentError:missing param 'content_view_id' in parameters while processing activation key 2
Summary
  No action taken.


Actual results:
ArgumentError shown in verbose mode, no ak's CV being created (composite-CV?)
 
Expected results:
no error, CV being created


Additional info:
activation-keys.csv
---
org_id,token,note,usage_limit,is_disabled,deploys_configs,entitlement,channel_label,base_channel_id,child_channel_id,cfg_channel_pos,server_group,server_group_id,package_name
1,1-key,None,,0,N,enterprise_entitled;monitoring_entitled;provisioning_entitled,rhel-x86_64-server-7;rhn-tools-rhel-x86_64-server-7,103;None,None;106,config-1|1,,,
2,2-key,None,,0,N,enterprise_entitled;monitoring_entitled;provisioning_entitled,rhel-x86_64-server-6;custom-2,101;None,None;111,config-2|1,sysgrp-2,19,
3,3-key,None,,0,N,enterprise_entitled;virtualization_host,rhel-x86_64-server-5;rhn-tools-rhel-x86_64-server-5,102;None,None;104,,sysgrp-3,20,rhn-virtualization-host;zsh
---

Comment 1 RHEL Program Management 2015-05-18 09:02:32 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 Lukas Pramuk 2015-05-18 12:47:07 UTC
The error occurs when importing AK and related CUSTOM CHANNEL CV cannot be found.

Comment 4 Lukas Pramuk 2015-05-18 13:24:58 UTC
Created attachment 1026708 [details]
export data tar

Comment 5 Tomas Lestach 2015-06-03 15:33:57 UTC
The commit just prevents hammer-cli-import to fail. Just preventing creation of composite content views, in case the component content views are not available yet ...

hammer-cli-import.git: 389bcf01c386ee0dbbd1a885ce361df2f63d8baf

Comment 8 Lukas Pramuk 2015-06-15 09:43:24 UTC
VERIFIED. 
rubygem-hammer_cli_import-0.10.17-1.el7sat.noarch
@Satellite-6.1.0-RHEL-7-20150612.0

# hammer import activation-key --verbose --csv-file /tmp/exports/activation-keys.csv
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 for channel ID [106] for key [1-key]
Creating new activation key: 2-key
  Associating activation key [2] with host collections [1]
Skipping content view association for activation key [1]. Dependent content views not ready.
Creating new ak content view: ak_2
  Publishing content view: 19
  Associating activation key [2] with content view [19]
Updating activation key with id: 2
Summary
  Created 2 activation_keys.
  Created 1 ak content view.


>>> fixed >>> Skipping content view association for activation key [1]. Dependent content views not ready.

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

Comment 10 Bryan Kearney 2015-08-12 13:58:06 UTC
This bug was fixed in version 6.1.1 of Satellite which was released on 12 August, 2015.