Bug 1168964 - Unable to import, first import content view with id
Summary: Unable to import, first import content view with id
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Transitions
Version: 6.0.5
Hardware: x86_64
OS: Linux
medium
medium vote
Target Milestone: Unspecified
Assignee: Adam Price
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-28 14:41 UTC by Chris Roberts
Modified: 2020-07-16 08:31 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-02 17:37:44 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 17589 None None None 2016-12-06 15:27:42 UTC

Description Chris Roberts 2014-11-28 14:41:57 UTC
Description of problem:

when trying to import system profiles with hammer I get the following error:

Import content-host with arguments --csv-file /tmp/exports/system-profiles.csv --export-directory /root/rpm-working-dir Unable to import, first import content view with id 102 Unable to import

How reproducible:


Steps to Reproduce:

1. install satellite 6 on rhel 6.6
2. on satellite 5.6 machine run spacewalk-export --entities users,system-profiles
3. # mkdir -p /tmp/exports
4. # chgrp -R apache /tmp/exports/ # chmod -R 0750 /tmp/exports/
5. # hammer import all --directory=/tmp/exports

Actual results:
Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Summary No

Expected results:
orgs to import or come back with a message why they didnt import

Additional info: mine shows up with 144, so i am assuming the number is based on the system profile or something of that nature

Comment 1 RHEL Program Management 2014-11-28 14:43:42 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 6 Tomas Lestach 2015-08-19 09:08:42 UTC
Please, note, this is not an error. This BZ is about formulating another warning message for the user.

"Unable to import, first import content view with id 207" means you first need to finish transitioning content views, concretely the channel equivalent with id 207 on your Sat5 machine. You cannot really transition a system profile that is subscribed to a channel in Sat5, if the appropriate channel equivalent (content view) is not ready on your Sat6 yet.

Make sure you finished synchronizing underlying (redhat) repositories, and re-run the command to import content-views or repository-enable depending on what kind of content views you transition.

Comment 7 Chris Roberts 2015-09-23 01:10:02 UTC
I would provide a message stating the name instead of the id so the customer can quickly find the culprit and look into why the import failed.

Comment 9 Tomas Lestach 2015-11-24 16:01:13 UTC
Ameya,
the solution is to read the message, find out what content view(s) were not imported and either to import them or to find out, why they were not imported.

As stated earlier - this BZ does not describe a import issue, it is about formulating another warning message for the user in this situation.

Comment 11 Tomas Lestach 2015-11-25 09:59:03 UTC
Resetting Assignee to default for NEW Transitions BZs.

Comment 15 Adam Price 2016-12-06 13:55:17 UTC
(In reply to Chris Roberts from comment #7)
> I would provide a message stating the name instead of the id so the customer
> can quickly find the culprit and look into why the import failed.

This would be the most helpful solution, but unfortunately hammer-cli-import only knows what ID to look up based on the data that is exported for the given hosts.

Comment 16 Adam Price 2016-12-06 14:22:20 UTC
Would this message suffice?

"""
Unable to import. Please import the $ENTITY with id [ $ID ] then try again.
"""

Comment 17 Adam Price 2016-12-06 15:27:39 UTC
Created redmine issue http://projects.theforeman.org/issues/17589 from this bug

Comment 18 Bryan Kearney 2016-12-06 17:19:09 UTC
Upstream bug component is Uncategorized

Comment 19 Adam Price 2016-12-06 18:26:23 UTC
(In reply to Tomas Lestach from comment #6)
> Please, note, this is not an error. This BZ is about formulating another
> warning message for the user.
> 
> "Unable to import, first import content view with id 207" means you first
> need to finish transitioning content views, concretely the channel
> equivalent with id 207 on your Sat5 machine. You cannot really transition a
> system profile that is subscribed to a channel in Sat5, if the appropriate
> channel equivalent (content view) is not ready on your Sat6 yet.
> 
> Make sure you finished synchronizing underlying (redhat) repositories, and
> re-run the command to import content-views or repository-enable depending on
> what kind of content views you transition.

How will I know which RH repositories to sync before importing the content hosts?

Comment 21 Lukas Pramuk 2016-12-07 08:51:02 UTC
You'll know it out of csv file - /tmp/exports/system-profiles.csv:

server_id,profile_name,hostname,description,organization_id,organization_name,base_channel_id,base_channel_label,child_channel_id,child_channel_label,system_group_id,system_group,release,architecture,virtual_host,virtual_guest,is_virtualized,virt_type
1000010009,profile1,profile1.example.com,,1,Red Hat SatTeam QA,,,,,,,7Server,x86_64,,,No,
1000010011,nehalem.example.com,nehalem.example.com,,1,Red Hat SatTeam QA,101,rhel-x86_64-server-6,None;105,None;rhn-tools-rhel-x86_64-server-6,,,6Server,x86_64,,,No,
1000010010,profile2,profile2.example.com,,2,Organization #2,101,rhel-x86_64-server-6,None;105,None;rhn-tools-rhel-x86_64-server-6,,,6Server,x86_64,,,No,
1000010008,profile3,profile3.example.com,,3,Organization #3,102,rhel-x86_64-server-5,None;104,None;rhn-tools-rhel-x86_64-server-5,,,5Server,x86_64,,,Yes,KVM/QEMU

Columns: 
- base_channel_id
- child_channel_id (this is multival field, child channels ids are separated by ;)

base_channel_label and child_channel_label could be used to be more obvious what is missing - instead of just id 101, it could be id 101 (rhel-7-x86_64-rpms)

Importing of repos/channels is a step that must precede before importing of content hosts. 
- hammer import repository-enable (for RH repos)
- hammer import content-view (for custom/cloned repos/channels)
Here we refer to /tmp/exports/channels.csv

channel_id,channel_label,channel_name,number_of_packages,org_id
109,clone-rhn-tools-rhel-x86_64-server-5,Clone of Red Hat Network Tools for RHEL Server (v.5 64-bit x86_64),564,3
108,clone-rhn-tools-rhel-x86_64-server-6,Clone of RHN Tools for RHEL (v. 6 for 64-bit x86_64),129,2
107,clone-rhn-tools-rhel-x86_64-server-7,Clone of RHN Tools for RHEL Server (v. 7 for x86_64),25,1
110,custom-1,Custom 1,44,1
111,custom-2,Custom 2,84,2
112,custom-3,Custom 3,92,3
102,rhel-x86_64-server-5,Red Hat Enterprise Linux (v. 5 for 64-bit x86_64),0,
101,rhel-x86_64-server-6,Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64),0,
103,rhel-x86_64-server-7,Red Hat Enterprise Linux Server (v. 7 for 64-bit x86_64),0,
104,rhn-tools-rhel-x86_64-server-5,Red Hat Network Tools for RHEL Server (v.5 64-bit x86_64),564,
105,rhn-tools-rhel-x86_64-server-6,RHN Tools for RHEL (v. 6 for 64-bit x86_64),129,
106,rhn-tools-rhel-x86_64-server-7,RHN Tools for RHEL Server (v. 7 for x86_64),25,

Note RH repos have org_id 0 => we enable them in all imported orgs (in Sat5 RH content is not org specific)

Comment 23 Bryan Kearney 2016-12-16 19:07:51 UTC
Upstream bug component is Hammer

Comment 24 Bryan Kearney 2016-12-16 19:19:34 UTC
Upstream bug component is Uncategorized

Comment 25 Bryan Kearney 2016-12-19 13:19:06 UTC
Upstream bug assigned to adprice@redhat.com

Comment 26 pm-sat@redhat.com 2017-02-23 17:18:50 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17589 has been resolved.

Comment 28 Bryan Kearney 2017-06-02 17:37:44 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.

Comment 29 Bryan Kearney 2017-06-02 18:54:09 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.