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 1395400

Summary: Hammer transition cvs from the Satellite 5 to Satellite 6 is failing
Product: Red Hat Satellite Reporter: Fotios Tsiadimos <ftsiadim>
Component: TransitionsAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: urgent Docs Contact:
Priority: high    
Version: 6.2.2CC: adprice, bbuckingham, bkearney, dhlavacd, ftsiadim, inecas, kdixon, lpramuk, mhulan, tlestach, tstrachota, wpinheir
Target Milestone: UnspecifiedKeywords: Regression
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-02 15:51:34 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 Fotios Tsiadimos 2016-11-15 22:16:53 UTC
Description of problem:
Hammer transition cvs from the Satellite 5 to Satellite 6 is failing 

Customer followed the below solution to resovle the issue then it failed with the below error:

How to resolve the "Unable to import, first import content view with id xxx" error when importing content hosts into Satellite6? 
https://access.redhat.com/solutions/1993363

aught NoMethodError:undefined method `clear' for nil:NilClass while processing CSV line:
{"server_id"=>"1000324754", "profile_name"=>"test.test.test", "hostname"=>"test.test.test", "description"=>"Initial Registration Parameters:\nOS: redhat-release-server\nRelease: 7Server\nCPU Arch: x86_64", "organization_id"=>"1", "base_channel_id"=>nil, "base_channel_label"=>"rhel-x86_64-server-7", "child_channel_id"=>nil, "system_group_id"=>nil, "release"=>"7Server", "architecture"=>"x86_64", "virtual_host"=>nil, "virtual_guest"=>nil}
Caught NoMethodError:undefined method `clear' for nil:NilClass while processing 

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

Satellite 6.2.4

How reproducible:


I tried to reproduce but the solution did fix the issue form me:

On satellite 5:
# spacewalk-export 

On satellite 6:
 hammer import content-host --csv-file /tmp/exports/system-profiles.csv   --export-directory /root/content-hosts

Importing from /tmp/exports/system-profiles.csv
Unable to import, first import content view with id 101
Unable to import, first import organization with id 1
Unable to import, first import organization with id 1
Unable to import, first import organization with id 1
Unable to import, first import content view with id 101
Unable to import, first import organization with id 1
Unable to import, first import organization with id 1
Unable to import, first import organization with id 1
Summary
  No action taken.

Comment 8 Lukas Pramuk 2016-11-23 09:41:25 UTC
Brad, 

comment #6 says that it is broken only if credentials are provided by yaml.
When credentials are provided as cmdline params then it works.

Comment 9 Lukas Pramuk 2016-11-23 09:48:58 UTC
I possibly figured out what it causes - It was broken by fix for BZ #1325497

See https://github.com/Katello/hammer-cli-import/pull/26/files#r89281771

Comment 10 Lukas Pramuk 2016-11-23 10:33:13 UTC
Refining my comment #8 - It fails only if you are asked for password.  

# hammer -u admin import content-host --debug --csv-file system-profiles.csv --export-directory .
[Foreman] Password for admin: 
Importing from system-profiles.csv
Creating new host: profile1
Caught NoMethodError:undefined method `clear' for nil:NilClass while processing CSV line:
{"server_id"=>"1000010009", "profile_name"=>"profile1", "hostname"=>"tyan-gt24-01.example.com", "description"=>nil, "organization_id"=>"1", "base_channel_id"=>nil, "base_channel_label"=>nil, "child_channel_id"=>nil, "system_group_id"=>nil, "release"=>"7Server", "architecture"=>"x86_64", "virtual_host"=>nil, "virtual_guest"=>nil}
Summary
  No action taken.


While with credentials in yaml or as cmdline params it works:

# hammer -u admin -p changeme import content-host --debug --csv-file system-profiles.csv --export-directory .
Importing from system-profiles.csv
Creating new host: profile1

To build the system-profile-transition rpm, run:

	cd /root/SPECS && 
	  rpmbuild -ba --define "_topdir /root" system-profile-transition-<SATFQDN>-1479896313-0.0.1.spec

Then find your system-profile-transition-<SATFQDN>-1479896313 package
	in /root/RPMS/noarch/ directory.
Summary
  Created 1 host.

Comment 11 Lukas Pramuk 2016-11-23 10:40:12 UTC
What do we want to track here? 

Unable to import, first import content view with id 101 (probably not a bug)

vs.

Caught NoMethodError:undefined method `clear' (hit only if asked for password)

Comment 12 Bryan Kearney 2017-06-02 15:51:34 UTC
Thank you for your interest in Satellite 6. We have evaluated this bug, and we do not expect this to be implemented in product in the forseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.