Bug 1671319 - Unable to export "Default Organization View 1.0" Content View
Summary: Unable to export "Default Organization View 1.0" Content View
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Inter Satellite Sync
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.6.0
Assignee: Chris Roberts
QA Contact: Jitendra Yejare
URL: https://projects.theforeman.org/issue...
Whiteboard:
: 1726457 (view as bug list)
Depends On:
Blocks: 1644596
TreeView+ depends on / blocked
 
Reported: 2019-01-31 11:30 UTC by vijsingh
Modified: 2020-10-12 09:41 UTC (History)
12 users (show)

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:
Clone Of:
: 1756045 (view as bug list)
Environment:
Last Closed: 2019-10-22 19:47:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
tfm-rubygem-hammer_cli_katello-0.16.0.11-2.HOTFIXRHBZ1671319.el7sat.noarch.rpm (118.79 KB, application/x-rpm)
2019-08-02 21:56 UTC, Mike McCune
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 27187 0 Normal Closed content-view version export fail for "Default Organization View 1.0" 2020-11-24 06:53:41 UTC
Foreman Issue Tracker 27838 0 High Closed Unable to export "Default Organization View 1.0" Content View 2020-11-24 06:53:18 UTC
Github Katello hammer-cli-katello pull 656 0 'None' closed Fixes #27187 - Fixing Content View version Export for default organiz… 2020-11-24 06:53:18 UTC
Github Katello hammer-cli-katello pull 697 0 'None' closed Fixes #27838 - Refactor cvv export to allow for default cv 2020-11-24 06:53:42 UTC
Red Hat Knowledge Base (Solution) 4254761 0 None None None 2019-06-28 17:01:00 UTC

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


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