Bug 1165151
Summary: | hammer import content-view is failing with "Error: can't convert nil into Integer" | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Neha <nerawat> |
Component: | Transitions | Assignee: | Grant Gainey <ggainey> |
Status: | CLOSED ERRATA | QA Contact: | Roman Plevka <rplevka> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.0.4 | CC: | bbuckingham, cperry, gabicr, ggainey, rplevka, sashinde, sthirugn |
Target Milestone: | Unspecified | Keywords: | 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 05:19:14 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: | |||
Bug Depends On: | |||
Bug Blocks: | 1115190 |
Description
Neha
2014-11-18 12:56:55 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. I am having no luck in recreating this error. The stacktrace above comes during hammer-import initializing - it's loading up its record of what has happened on previous runs (that's what 'persistentmap.rb' manages) Repeated runs, using the customer's data and the attached .transitions_data files, all seem to "just work". If one were to change this file: /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/persistentmap.rb by adding the following: === *** /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/persistentmap.rb.ORIG 2014-12-04 19:07:31.950036215 +0100 --- /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/persistentmap.rb 2014-12-04 19:22:56.559390969 +0100 *************** module PersistentMap *** 191,196 **** --- 191,197 ---- end def pm_decode_row(map_sym, row) + debug ">>> pm_decode_row, map_sym [#{map_sym}] row [#{row.inspect}]" key_spec, val_spec = self.class.map_description[map_sym] key = [] value = [] === and then run the command with --debug: # hammer -d import content-view --csv-file /tmp/exports/CHANNELS/export.csv --dir /tmp/exports/CHANNELS --debug You will see output like this in /root/import.log: === D, [2014-12-04T19:23:00.774680 #19632] DEBUG -- : >>> pm_decode_row, map_sym [redhat_repositories] row [["2", "415", nil, "-"]] === This might give us a hint as to what's going on, should it happen again. Fun - here's the problem: persistentmap.rb:28 def from_s(x) Integer(x) end On machines running ruby-1.8.7.374-2.el6.x86_64, it returns a 0 when passed nil.. On machines running ruby-2.0.0.353-22.el7_0.x86_64, it throws an exception when passed nil.. As a result, processing .transition_data where entities have been deleted (and therefore have 'nil' for their sat6-ids), fails on RHEL7 where 2.0 is the default ruby. While we're working on a fix - in .transition_data, find any files with '=' in the 'deleted' column, and try setting the sat6 column to -1 as a workaround. c#8 typo - s/with '=' in/with '-' in/ Aaand here's the actual fix, works on both versions: === --- /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/persistentmap.rb.SAVE 2014-12-05 04:34:54.793460071 -0500 +++ /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/persistentmap.rb 2014-12-05 04:35:18.147460870 -0500 @@ -26,7 +26,7 @@ class << Fixnum def from_s(x) - Integer(x) + Integer(x) rescue 0 end end katello/hammer-cli-import commit d2147d41ee791e6907217353158ad3fd665e01fb VERIFIED used data: # head -n2 ../.transition_data/redhat_repositories-2015-05-18T14\:53\:21+0000.csv org_id,channel_id,sat6,delete 1,101,,- results: Satellite-6.0.4-RHEL-7-20150227.0: # hammer import content-view --verbose --csv-file CHANNELS/export.csv Error: can't convert nil into Integer Satellite-6.1.0-RHEL-7-20150513.0: # hammer import content-view --verbose --csv-file CHANNELS/export.csv Importing from CHANNELS/export.csv No such {redhat_,}content_view: 105 Creating new content view: Clone of RHN Tools for RHEL (v. 6 for 64-bit x86_64) Summary Created 1 content view. This bug is slated to be released with Satellite 6.1. 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 |