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 1645174 - Reimporting the existing CV version should have more refined validation message
Summary: Reimporting the existing CV version should have more refined validation message
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
low
Target Milestone: 6.5.0
Assignee: Chris Roberts
QA Contact: Jitendra Yejare
URL: https://projects.theforeman.org/issue...
Whiteboard:
Depends On:
Blocks: 1644596
TreeView+ depends on / blocked
 
Reported: 2018-11-01 14:24 UTC by Jitendra Yejare
Modified: 2019-11-05 22:36 UTC (History)
5 users (show)

Fixed In Version: tfm-rubygem-katello-3.10.0,tfm-rubygem-hammer_cli_katello-0.16.0.6-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:38:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 25406 0 Normal Closed Reimporting the existing CV version should have more refined validation message 2020-10-16 13:49:57 UTC
Foreman Issue Tracker 25932 0 High Closed Reimporting the existing CV version should have more refined validation message 2020-10-16 13:49:57 UTC
Github Katello hammer-cli-katello pull 625 0 None closed Fixes #25932 - Prevent reimport of same CV version 2020-10-16 13:49:57 UTC
Github Katello katello pull 7806 0 None closed Fixes #25406 - Update CV publish error to more friendly one. 2020-10-16 13:49:57 UTC
Red Hat Product Errata RHSA-2019:1222 0 None None None 2019-05-14 12:38:43 UTC

Description Jitendra Yejare 2018-11-01 14:24:16 UTC
Description of problem:
Currently, If one tries to reimport the CV version with the same minor and major version, Satellite throws validation message as :
"Validation failed: Minor , must be unique to major and version id version."

which I feel needs improvement.

Version-Release number of selected component (if applicable):
Satellite 6.5 snap 1

How reproducible:
Always

Steps to Reproduce:
1. Export the CV version (lets say 1.0 major 1 and minor 0)
2. Import the exported CV version in another org/satellite ( in our case confirm the imported CV version is 1.0 major 1 and minor 0) 
3. After successful import, try to reimport the exported CV version (in our case 1.0 major 1 minor 0)

Actual results:
The reimport throws a validation as:
"Validation failed: Minor , must be unique to major and version id version."

Expected results:
More refined validation message something like;
"CV Version with same major and minor version already exists"


Additional info:

Comment 2 Satellite Program 2018-11-02 18:08:39 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24569 has been resolved.

Comment 3 Chris Roberts 2018-11-06 18:12:04 UTC
need to make a new upstream issue for this

Comment 5 Jitendra Yejare 2018-12-17 15:51:46 UTC
The validation message is fixed, but still, satellite tries to resync the repositories(recreation of symlinks I believe) and while publishing it throws a message.

It would be great if we throw this message to user, even before resyncing(recreating symlink) and by first checking what version it is going to import and match with the existing one. This will save the users time.

Logs may help here, what I wanted to say :

```
# hammer content-view version import --organization-id 19 --export-tar /var/lib/pulp/katello-export/export-30.tar
[................................................................................................] [100%]
No new packages.
Could not import the content view.:
  A CV version already exists with the same major and minor version (1.0)

```

If you see above, first it resynced and then throw the message. It would be good if we throw the message first and abort resyncing.

Comment 6 Jitendra Yejare 2018-12-17 15:52:14 UTC
NeedInfo comment 5.

Comment 7 Chris Roberts 2019-01-16 16:02:51 UTC
After talking to beav about this and i will make a pr to move the check first so we dont try to resync

I will use the same redmine issue and just create a 'Refs' PR

Comment 8 Bryan Kearney 2019-01-16 17:08:40 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25406 has been resolved.

Comment 9 Jitendra Yejare 2019-01-21 10:19:09 UTC
@Toledo,

Even after the fix, the behavior from hammer looks same:

# hammer -u admin -p changeme content-view version import --export-tar /var/lib/pulp/katello-export/export-cvexpo_cv-401.tar --organization-id 304
[................................................................................................] [100%]
No new packages.
Could not import the content view.:
  A CV version already exists with the same major and minor version (1.0)


So if have fixed resyncing of repo, Can we have somehow remove the progress bar.

Comment 10 Jitendra Yejare 2019-01-24 16:18:47 UTC
As per discussion with DEV on irc ... moving this back to the assigned state.

Comment 13 Jitendra Yejare 2019-02-04 08:51:58 UTC
Verified!

As per Comment 5 and comment 9, I verified the said part in a comment. The first part is already verified in comment 5.

Steps:
Same as per bug description


Behavior(Expected):

The validation message is only shown and the re-sync is avoided:

# hammer content-view version import --export-tar /var/lib/pulp/katello-export/export-custom_cv-10.tar --organization-id 3
Could not import the content view:
  Error: The latest version (1.0) of the Content View 'custom_cv' is greater or equal to the version you are trying to import (1.0)

Comment 16 errata-xmlrpc 2019-05-14 12:38:32 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:1222


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