Bug 1395400 - Hammer transition cvs from the Satellite 5 to Satellite 6 is failing
Summary: Hammer transition cvs from the Satellite 5 to Satellite 6 is failing
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Transitions
Version: 6.2.2
Hardware: x86_64
OS: Linux
high
urgent vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-15 22:16 UTC by Fotios Tsiadimos
Modified: 2020-08-13 08:42 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-02 15:51:34 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


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