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 1946348 - Importing an exported content view fails due to missing repository.
Summary: Importing an exported content view fails due to missing repository.
Keywords:
Status: CLOSED DUPLICATE of bug 1884212
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Inter Satellite Sync
Version: 6.8.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: 6.10.0
Assignee: satellite6-bugs
QA Contact: Lai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-05 20:33 UTC by Rudnei Bertol Jr.
Modified: 2024-06-14 01:07 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-11 18:16:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Rudnei Bertol Jr. 2021-04-05 20:33:02 UTC
Description of problem:

When trying to import an exported content view following the official documentation [1], it fails with the following message.

~~~
[root@dell-r430-1 katello-export]# hammer content-view version import --export-tar /var/lib/pulp/katello-export/export-02895680-1.0.tar --organization-id 1 
Could not import the content view:
  Error: Unable to sync repositories, no library repository found for Red_Hat_Satellite_Tools_6_5_for_RHEL_8_x86_64_RPMs
~~~

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

How reproducible:
Try to import an exported content view on a Satellite host with more than 20 repositories enabled. The repository present on the content view must not present on the 20 first results for the API call.

Steps to Reproduce:
1. Import an exported content view.

Actual results:
If the repository present on the exported content view is not one of the 20 first repositories, it will fail as the repository is not present in the library lifecycle environment.

Expected results:
The hammer import command should check for all repositories present on the library life cycle environment, not just the 20 firsts.


Additional info:

A producction.log snippet will be provided on a private comment.

[1] - https://access.redhat.com/documentation/en-us/red_hat_satellite/6.8/html-single/content_management_guide/index#importing_a_content_view_version

Comment 2 Rudnei Bertol Jr. 2021-04-05 20:50:31 UTC
Possible workaround.

On the file '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.22.2.3/lib/hammer_cli_katello/content_view_version.rb', add the folloing line to change the default items per page from '20' to '1000'.

~~~
493         repositories.each do |repo|
494           library_repos = index(
495             :repositories,
496             'organization_id' => organization_id,
497 +++         'per_page' => '1000',      <====== Add this line, with the option to get the 1000 items per page.
498             'library' => true
499           )
~~~

regards
rbertol

Comment 6 Chris Roberts 2021-06-11 18:16:19 UTC
This is a dupe of https://bugzilla.redhat.com/show_bug.cgi?id=1884212

*** This bug has been marked as a duplicate of bug 1884212 ***


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