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 1671319

Summary: Unable to export "Default Organization View 1.0" Content View
Product: Red Hat Satellite Reporter: vijsingh
Component: Inter Satellite SyncAssignee: Chris Roberts <chrobert>
Status: CLOSED ERRATA QA Contact: Jitendra Yejare <jyejare>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: ahumbe, bkearney, chrobert, dvoss, egolov, ehelms, jcrumple, mmccune, ramsingh, smane, trichard, unwosu
Target Milestone: 6.6.0Keywords: PrioBumpGSS, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: https://projects.theforeman.org/issues/27838
Whiteboard:
Fixed In Version: tfm-rubygem-hammer_cli_katello-0.18.0.3-1,rubygem-hammer_cli_katello-0.18.0.6-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1756045 (view as bug list) Environment:
Last Closed: 2019-10-22 19:47:44 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: 1644596    
Attachments:
Description Flags
tfm-rubygem-hammer_cli_katello-0.16.0.11-2.HOTFIXRHBZ1671319.el7sat.noarch.rpm none

Description vijsingh 2019-01-31 11:30:39 UTC
Description of problem:

Unable to export "Default Organization View 1.0" Content View

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

6.5 snap 13

How reproducible:

Always

Steps to Reproduce:

[root@qe-sat6-bm1 ~]# hammer -u admin content-view version list --organization-id 1
---|-------------------------------|---------|-----------------------
ID | NAME                          | VERSION | LIFECYCLE ENVIRONMENTS
---|-------------------------------|---------|-----------------------
8  | my_cv 3.0                     | 3.0     | Library               
7  | my_cv 2.0                     | 2.0     |                       
6  | my_cv 1.0                     | 1.0     |                       
1  | Default Organization View 1.0 | 1.0     | Library               
---|-------------------------------|---------|-----------------------

[root@qe-sat6-bm1 ~]# hammer -u admin content-view version export --id 1 --export-dir /root/
Could not export the content view:
  Missing arguments for 'id'
[root@qe-sat6 ~]# 



Actual results:
Content-view export fails with below error:

Could not export the content view:
  Missing arguments for 'id'

Expected results:

It should be export.

Comment 10 Bryan Kearney 2019-07-04 12:02:10 UTC
Upstream bug assigned to chrobert

Comment 11 Bryan Kearney 2019-07-04 12:02:12 UTC
Upstream bug assigned to chrobert

Comment 15 Mike McCune 2019-08-02 21:56:01 UTC
*** Satellite 6.5.1/6.5.2 Hotfix Available ****

1) Download tfm-rubygem-hammer_cli_katello-0.16.0.11-2.HOTFIXRHBZ1671319.el7sat.noarch.rpm from this Bug to your Satellite 6.5 server

2) install: rpm -Uvh tfm-rubygem-hammer_cli_katello-0.16.0.11-2.HOTFIXRHBZ1671319.el7sat.noarch.rpm

3) export Default content view. 

NOTE: You are still restricted to rpm type repos only. An upcoming update that will skip non-RPM types will be fixed in :


Bug 1726457 - Unable to export content-view that has at least one non-yum type repo

https://bugzilla.redhat.com/show_bug.cgi?id=1726457

Comment 16 Mike McCune 2019-08-02 21:56:44 UTC
Created attachment 1600152 [details]
tfm-rubygem-hammer_cli_katello-0.16.0.11-2.HOTFIXRHBZ1671319.el7sat.noarch.rpm

Comment 19 Jitendra Yejare 2019-08-20 06:54:28 UTC
Failed QA!

@ Satellite 6.6 snap 16

Description:
----------------
The Default content view version export works as expected but the import is broken with error:
Could not import the content view:
  Error: The latest version (1.0) of the Content View 'Default Organization View' is greater or equal to the version you are trying to import (1.0)

Steps:
----------------
1. Export the default content view version tar to the directory.
2. Attempt to import the exported-tar of default content-view from another org/satellite.


Observation:
----------------
1. The Default content view version export works as expected but the import is broken with error:
# hammer content-view version import --export-tar export-Default_Organization_View-1.0.tar --organization-id 3
Could not import the content view:
  Error: The latest version (1.0) of the Content View 'Default Organization View' is greater or equal to the version you are trying to import (1.0)

2. I tried w/o of changing the versions in exported json. But again satellite throws an error for 'cannot publish default cv' as expected:
]# hammer content-view version import --export-tar export-Default_Organization_View-1.0.tar --organization-id 3
[.....................................................................................................................................................................................................................................] [100%]
No new packages.
Error: RPM1004: Error retrieving metadata: [Errno 2] No such file or directory: '//./export-Default_Organization_View-1.0/Default_Organization/Library/custom/export_prod/export_repo/repodata/repomd.xml'
Could not import the content view:
  The default content view cannot be edited, published, or deleted.


So is there a better way of importing the default CV exported tar?

Comment 22 Chris Roberts 2019-09-13 20:07:36 UTC
*** Bug 1726457 has been marked as a duplicate of this bug. ***

Comment 23 Jitendra Yejare 2019-09-18 15:55:29 UTC
Failed QA!

Observation:
----------------------------

1. Export tar name has UUID instead of Default Organization View.
# ll
-rw-r--r--. 1 root root 163840 Sep 18 11:50 export-8f9af724-affa-4194-8ed4-5c7ecc018c7e-1.0.tar


2. Importing the exported tar fails with error:
# hammer content-view version import --export-tar export-8f9af724-affa-4194-8ed4-5c7ecc018c7e-1.0.tar --organization-id 114
[................................................................................................] [100%]
No new packages.
Error: RPM1004: Error retrieving metadata: [Errno 2] No such file or directory: '//./export-8f9af724-affa-4194-8ed4-5c7ecc018c7e-1.0/exportOrg/Library/custom/abp/abp_repo/repodata/repomd.xml'

Comment 24 Chris Roberts 2019-09-19 14:35:06 UTC
Odd I did not see this when we worked on the PR and had someone test it. I will spin up a 6.6 box and report back with my findings

Comment 25 Chris Roberts 2019-09-19 17:55:44 UTC
Export machine:

[root@toledoexport ~]# hammer content-view version export --id 1 --export-dir /tmp
[root@toledoexport ~]# ll /tmp/
-rw-r--r--. 1 root    root    97740800 Sep 19 15:41 export-Default_Organization_View-1.0.tar

Import machine:

[root@toledoimport ~]# ll /var/lib/pulp/katello-export/
-rw-r--r--. 1 root root 97740800 Sep 19 17:43 export-Default_Organization_View-1.0.tar

[root@toledoimport ~]# hammer content-view version import --organization-id 1 --export-tar /var/lib/pulp/katello-export/export-Default_Organization_View-1.0.tar
[.................................................................................................................................................................................................................................................................................] [100%]
New packages: 8 (74 MB).
[.................................................................................................................................................................................................................................................................................] [100%]
New packages: 32 (18.6 MB).
[.................................................................................................................................................................................................................................................................................] [100%]
New packages: 32 (76.7 KB).

Works for me, was the box you tested this on a fresh install of the latest 6.6 snap or an upgrade?

I am wondering if you had some leftover stuff on the box that didn't get properly updated correctly

Moving back to ON_QA

Happy to share the box info I used so you can test yourself on those if you would like.

Comment 26 Jitendra Yejare 2019-09-23 13:44:55 UTC
Toledo,

I tried on another system upgraded and also on a fresh setup, the sync between two orgs works. But still, the name of exported content tar doesn't have a name of Default Organization View.

# # ll /var/lib/pulp/katello-export/
total 164
-rw-r--r--. 1 root root 163840 Sep 23 08:53 export-1b38f899-4784-4ae0-a510-0c8a9d3e64f8-1.0.tar


Did you tried on a fresh setup? What foreman version do u have installed (mine is foreman-1.22.0.32-1.el7sat.noarch) ?

Comment 28 Jitendra Yejare 2019-09-24 09:28:14 UTC
Chris, Anyhow the sync between two orgs/satellites is working fine and hence I am moving this to verify state. Will raise a new bug for tar name issue.

So, as per comment 26 moving this bug to verified status.

Comment 31 Bryan Kearney 2019-10-22 19:47:44 UTC
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-2019:3172