Bug 1120839 - activation-key import fails with traceback
Summary: activation-key import fails with traceback
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Transitions
Version: 6.0.4
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: Unspecified
Assignee: Matej Kollar
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks: stargate-GA-tracker
TreeView+ depends on / blocked
 
Reported: 2014-07-17 20:08 UTC by Grant Gainey
Modified: 2019-09-26 14:45 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-11 12:20:25 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Grant Gainey 2014-07-17 20:08:04 UTC
hammer import activation-key fails for some keys with tracebacks like the following:

Caught HammerCLIImport::MissingObjectError:Need to import content_view with id 133 while processing following line:
{"base_channel_id"=>"133;None", "token"=>"7-f3e8de0a6f74dbb18a97099005018d2d", "note"=>"SOE-RHEL5-QA", "child_channel_id"=>"142;None", "usage_limit"=>nil, "org_id"=>"7", "server_group_id"=>"34"}
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/base.rb:220:in `get_translated_id'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/activationkey.rb:71:in `import_single_row'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/activationkey.rb:69:in `each'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/activationkey.rb:69:in `import_single_row'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/base.rb:412:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/base.rb:412:in `cvs_iterate'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/csvhelper.rb:44:in `csv_each'
/usr/lib/ruby/gems/1.8/gems/fastercsv-1.5.4/lib/faster_csv.rb:1545:in `each'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/csvhelper.rb:35:in `csv_each'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/base.rb:410:in `cvs_iterate'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/base.rb:422:in `import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/base.rb:451:in `execute'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'

This may be a 'normal' error-case - in which case, we shouldn't throw a traceback.

Comment 1 RHEL Product and Program Management 2014-07-17 20:34:14 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 2014-08-13 12:33:01 UTC
This is a more general issue than just AKs:

<tlestach> ggainey: if a prereq. is missing, e.g. a content view, then we are not able to create an activation key associated with the missing content view ...
<tlestach> ggainey: it's not a matter of act. keys, but generally

Need to figure out a way to handle this more gracefully

Comment 4 Matej Kollar 2014-08-14 09:04:07 UTC
Better way of handling mentioned exception.

hammer-cli-import.git: fe68d97040582285615aefe4708d9b402c14ae91

Comment 5 Matej Kollar 2014-08-14 12:34:05 UTC
Some more finetuning of log levels.

hammer-cli-import.git: 34c72e041369cb065f823072059dfc438a7adef6

Comment 7 Tazim Kolhar 2014-09-03 06:27:04 UTC
VERIFIED

Comment 8 Tazim Kolhar 2014-09-03 06:29:12 UTC
installed space-walk tool and tested it

Comment 9 Tazim Kolhar 2014-09-03 09:14:24 UTC
shifting this to ON_QA as discussed in the email will be handled by  @ggainey

Comment 10 Lukas Pramuk 2014-09-05 22:04:43 UTC
VERIFIED. rubygem-hammer_cli_import-0.10.4-1.1.el7sat.noarch

string in comment #0 was touched a bit:
Need to import content_view > Unable to import, first import content view 

# hammer import activation-key --csv-file /tmp/exports/activation-keys.csv 
Unable to import, first import content view with id 227
Unable to import, first import content view with id 227
Unable to import, first import content view with id 227
Unable to import, first import content view with id 225
Unable to import, first import content view with id 225
Unable to import, first import content view with id 227
Unable to import, first import content view with id 227
Unable to import, first import content view with id 224
Unable to import, first import content view with id 227
...

>>> handles MissingObjectError appropriately <<<


# hammer import activation-key --verbose --csv-file /tmp/exports/activation-keys.csv 
...
Updating activation key with id: 37
  Associating activation key [38] with content view [30]
Updating activation key with id: 38
Caught RestClient::UnprocessableEntity:422 Unprocessable Entity while processing activation key 38
/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
/usr/share/ruby/net/http.rb:852:in `start'
/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:76:in `put'
/usr/share/gems/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:195:in `http_call'
/usr/share/gems/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:150:in `call'
/usr/share/gems/gems/apipie-bindings-0.0.8/lib/apipie_bindings/resource.rb:14:in `call'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/base.rb:126:in `api_call'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/base.rb:138:in `api_call'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/base.rb:143:in `mapped_api_call'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/base.rb:439:in `update_entity'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/activationkey.rb:119:in `block (2 levels) in post_import'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/importtools.rb:302:in `call'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/importtools.rb:302:in `handle_missing_and_supress'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/activationkey.rb:106:in `block in post_import'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/activationkey.rb:105:in `each'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/activationkey.rb:105:in `post_import'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/base.rb:563:in `block in execute'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/importtools.rb:302:in `call'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/importtools.rb:302:in `handle_missing_and_supress'
/usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/base.rb:562:in `execute'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/abstract.rb:22:in `run'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/abstract.rb:22:in `run'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/abstract.rb:22:in `run'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
/usr/share/gems/gems/hammer_cli-0.1.1/bin/hammer:102:in `<top (required)>'
/usr/bin/hammer:23:in `load'
/usr/bin/hammer:23:in `<main>'
...

>>> caught exceptions (like RestClient::UnprocessableEntity:422) are shown only when using --verbose option <<<

Comment 11 Bryan Kearney 2014-09-11 12:20:25 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.


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