Bug 2172845

Summary: Hammer is not propagating error message from production log when content-export fails
Product: Red Hat Satellite Reporter: Vladimír Sedmík <vsedmik>
Component: Inter Satellite SyncAssignee: satellite6-bugs <satellite6-bugs>
Status: NEW --- QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.13.0CC: jlenz, ofedoren
Target Milestone: UnspecifiedKeywords: Triaged, UserExperience
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
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 Vladimír Sedmík 2023-02-23 09:56:41 UTC
Description of problem:
When incremental syncable export fails for a valid reason (like filtered vs. unfiltered CV version is incrementally exported), hammer does not show the reason message from the production log.


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


How reproducible:
always


Steps to Reproduce:
1) Sync some RH repo like Ansible, sync it (with IMMEDIATE policy!)
2) Create a CV, add the repo, add a filter (include rpm `ansible`, not `ansible-test` nor `sshpass`), publish
3) Export complete, check content -> 32 pkgs
# hammer content-export complete version --format syncable --organization-id 1 --id <CVV_id>
4) Add include filter for sshpass, publish.
5) Export incremental, check sshpass is exported.
# hammer content-export incremental version --format syncable --organization-id 1 --id <CVV_id + 1>
6) Remove both filters, publish.
7) Export incremental, check the result and production.log 
# hammer content-export incremental version --format syncable --organization-id 1 --id <CVV_id + 2>


Actual results:
[root@sat ~]# hammer content-export incremental version --format syncable --organization-id 1 --id 15
Could not export the content view version:
  400 Bad Request

In production.log:
2023-02-22T06:10:45 [E|bac|da9f3a38] Cannot incrementally export from a filtered and a non-filtered content view version. The exported content view version 'CV-RH 3.0'  cannot be incrementally updated from version '2.0.'.  Please do a full export. (Katello::Pulp3::ContentViewVersion::ExportValidationError)


Expected results:
[root@sat ~]# hammer content-export incremental version --format syncable --organization-id 1 --id 15
Could not export the content view version:
Cannot incrementally export from a filtered and a non-filtered content view version. The exported content view version 'CV-RH 3.0'  cannot be incrementally updated from version '2.0.'.  Please do a full export.

Comment 1 Vladimír Sedmík 2023-02-23 10:36:27 UTC
Similar result for different scenario:
1) Create new repo, add content, export complete importable format: hammer content-export complete repository --format importable --organization-id 1 --id <repo_id>
2) Check the export path -> tar.gz exported
3) Upload one rpm.
4) Export incremental syncable format: hammer content-export incremental repository --format syncable --organization-id 1 --id <repo_id>

Actual results:
[root@sat ~]# hammer content-export incremental repository --format syncable --organization-id 1 --id 80
Could not export the repository:
  400 Bad Request

production log:
2023-02-23T05:25:37 [E|app|63206f2c] Katello::HttpErrors::BadRequest: Unable to incrementally export. Do a Full Export on the repository content.


Expected results:
[root@sat ~]# hammer content-export incremental repository --format syncable --organization-id 1 --id 80
Could not export the repository:
Unable to incrementally export. Do a Full Export on the repository content.