Bug 2090328

Summary: [RFE] improve error message during content-view import
Product: Red Hat Satellite Reporter: Jan Jansky <jjansky>
Component: Inter Satellite SyncAssignee: satellite6-bugs <satellite6-bugs>
Status: NEW --- QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.10.5CC: apatel, kgaikwad, ofedoren, paji, pmoravec, rabajaj
Target Milestone: UnspecifiedKeywords: FutureFeature, UserExperience
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:

Description Jan Jansky 2022-05-25 14:22:03 UTC
Description of problem:
During content-view import i got message as below

Could not import the archive.:
  Missing values for repositories.

From above i really don't know what can be the issue, in the end i have found out that part of export was 1 repository with on_demand policy and that caused this, but from error message it is really not clear

I am even not sure why it is allowed to do export with repositories with not immediate download policy, but maybe that have some reason.

I will be glad if error message during import can be more clear or even better if will not be allowed to export content-view with repositories with different than immediate download policy (if there is not some special reason for it).

How reproducible:
Always

Steps to Reproduce:
1. Create Content view which contain repository with on_demand download policy
2. Create export (# hammer content-export complete version --organization <org_name> --lifecycle-environment <LFE_name> --id <cv_id>)
3. Import (# hammer content-import version --organization <org_name> --path <path>)

Actual results:

Could not import the archive.:
  Missing values for repositories.

Expected results:
a) not allow to create export with repositories without immediate download policy

b) Make message more obvious like "Repository X.Y have on_demand download policy"

Additional info:

Comment 1 Partha Aji 2022-06-27 21:37:45 UTC
Lets say you have 100 repos but 5 on-demand repos and you tried to export the library. Should we warn you and continue when you export? Or fail saying "cant export library because 5 repos are non-immediate". We chose the warn and continue route. There is also a --fail-on-missing-content flag to the hammer export command if you really want it to fail on non-immediate repositories.
If the export really didn't warn the user along the lines below then I would consider it as valid bug.
"""
$ hammer content-export complete version --id=46
NOTE: Unable to fully export this version because it contains repositories without the 'immediate' download policy. Update the download policy and sync affected repositories. Once synced republish the content view and export the generated version.
Use the following command to update the download policy of these repositories.
hammer repository update --id=<REPOSITORY_ID> --download-policy='immediate'

Id:           80
Name:         foo
Product:      pick_one
Content Type: yum
Url:

[....................................................................................................................................................................] [100%]

""" 
alternately you could do
"""
hammer content-export complete version --id=46 --fail-on-missing-content
"""
and that would not run the export operation.

If you gave it empty repositories the error message raised by the importer is correct.

Not a bug imo.

Comment 2 Jan Jansky 2022-06-28 07:42:27 UTC
You are correct it is not a bug it is a RFE.

Why it's possible to even do export when it fails on other machine during import?
Little note barely visible as it is on top of output is not enough imho. As for example export on my Satellite

# hammer content-export complete version --content-view RHEL7 --lifecycle-environment Library --organization JJAN_ORG
NOTE: Unable to fully export this version because it contains repositories without the 'immediate' download policy. Update the download policy and sync affected repositories. Once synced republish the content view and export the generated version.
Use the following command to update the download policy of these repositories.
hammer repository update --id=<REPOSITORY_ID> --download-policy='immediate'

Id:           2
Name:         Red Hat Enterprise Linux 7 Server - Extras RPMs x86_64
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/extras/os

Id:           452
Name:         Red Hat Enterprise Linux 7 Server - Optional RPMs x86_64 7.8
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7.8/x86_64/optional/os

Id:           449
Name:         Red Hat Enterprise Linux 7 Server - Optional RPMs x86_64 7.9
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7.9/x86_64/optional/os

Id:           3
Name:         Red Hat Enterprise Linux 7 Server - Optional RPMs x86_64 7Server
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/optional/os

Id:           568
Name:         Red Hat Enterprise Linux 7 Server - RH Common RPMs x86_64 7.8
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7.8/x86_64/rh-common/os

Id:           566
Name:         Red Hat Enterprise Linux 7 Server - RH Common RPMs x86_64 7.9
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7.9/x86_64/rh-common/os

Id:           567
Name:         Red Hat Enterprise Linux 7 Server - RH Common RPMs x86_64 7Server
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/rh-common/os

Id:           424
Name:         Red Hat Enterprise Linux 7 Server RPMs x86_64 7.8
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7.8/x86_64/os

Id:           423
Name:         Red Hat Enterprise Linux 7 Server RPMs x86_64 7.9
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7.9/x86_64/os

Id:           4
Name:         Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os

Id:           579
Name:         Red Hat Enterprise Linux 7 Server - Supplementary RPMs x86_64 7.8
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7.8/x86_64/supplementary/os

Id:           578
Name:         Red Hat Enterprise Linux 7 Server - Supplementary RPMs x86_64 7.9
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7.9/x86_64/supplementary/os

Id:           577
Name:         Red Hat Enterprise Linux 7 Server - Supplementary RPMs x86_64 7Server
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/supplementary/os

Id:           10
Name:         Red Hat Satellite Tools 6.10 for RHEL 7 Server RPMs x86_64
Product:      Red Hat Enterprise Linux Server
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6.10/os

Id:           460
Name:         Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server x86_64 7.8
Product:      Red Hat Software Collections (for RHEL Server)
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7.8/x86_64/rhscl/1/os

Id:           459
Name:         Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server x86_64 7.9
Product:      Red Hat Software Collections (for RHEL Server)
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7.9/x86_64/rhscl/1/os

Id:           12
Name:         Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server x86_64 7Server
Product:      Red Hat Software Collections (for RHEL Server)
Content Type: yum
Url:          https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/rhscl/1/os


Sure if you have content view with 1 repository its visible, but i think many customers have much more than just 1 repository in content view and as this "NOTE" is on top it's barely visible.

But more importantly i still do not understand why it is possible to export CV in a way that it will fail during import on other Satellite? What is the purpose? Imho --fail-on-missing-content should be set by default if there is not any special reasoning why to export CV with on_demand download policy and reasoning should be much more visible.

Comment 3 Pavel Moravec 2022-06-28 07:49:22 UTC
My 2c idea:

worth reverting the default behaviour and the hammer option? I.e. if any repo is non-immediate (such that generated export will fail to be imported, any time), we should stop generating the export with that error. And allow it only with user consent / when using --continue-on-missing-content option.

Comment 4 Brad Buckingham 2023-07-21 21:06:39 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team.  Thank you.