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 1648358 - [Container Admin] Failed promotion of CV with containers - error message is unhelpful
Summary: [Container Admin] Failed promotion of CV with containers - error message is u...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.5.0
Assignee: Justin Sherrill
QA Contact: Mirek Długosz
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-09 14:21 UTC by Mirek Długosz
Modified: 2020-06-29 09:47 UTC (History)
5 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 25558 0 Normal Closed [Container Admin Feature] Failed promotion of CV with containers - error message is unhelpful 2020-06-29 09:45:18 UTC
Foreman Issue Tracker 25782 0 Normal Closed publishing a cv with two docker repos with conflicting container names shows generic error 2020-06-29 09:45:18 UTC
Red Hat Product Errata RHSA-2019:1222 0 None None None 2019-05-14 12:38:50 UTC

Description Mirek Długosz 2018-11-09 14:21:49 UTC
There are two main reasons why we reject promotion of CV with containers - at least one of repository name will turn out to be invalid (empty, too long, with invalid characters) or few repositories will get the same name on new LE (pattern is not unique enough). Katello app/lib/katello/validators/environment_docker_repositories_validator.rb does good job at distinguishing these two scenarios and returning helpful error message.

However, app/models/katello/content_view.rb:check_docker_repository_names! will swallow these helpful messages and return generic "Content View publish to environment $FOO will result in invalid container image name of member repositories".

Could we present error message returned from environment_docker_repositories_validator to user? This would really help in figuring out where the root cause of the problem is and what corrective steps should be taken.


Steps to Reproduce:
1. Add new Lifecycle environment
2. Prepare docker product with at least two repositories
3. Create CV with product from earlier step
4. Set up LE Registry Name Patter to something not unique enough (like `<%= organization.label %>`)
5. Try to promote CV to LE


Actual results:
Unhelpful generic error message appears


Expected results:
Helpful error message about registry names not unique enough appears

Comment 3 Justin Sherrill 2018-11-26 19:52:04 UTC
Mirosław, would this sound better: 

Validation failed: Container repository name for repository 'docker' is not unique and cannot be created in 'Library'. Its Container Repository Name (busybox) conflicts with an existing repository. Consider changing the Lifecycle Environment's Registry Name Pattern to something more specific.

Comment 4 Justin Sherrill 2018-11-26 19:53:10 UTC
Created redmine issue https://projects.theforeman.org/issues/25558 from this bug

Comment 5 Mirek Długosz 2018-11-27 10:48:47 UTC
Justin,

yes, I think it's improvement.

But will we display that message every time when CV with docker repos promotion fails? I think promotion will usually fail due to registry name pattern not being specific enough, but may fail when published repository path is too long (over 255 characters) or contains invalid characters (not sure if possible to trigger, except for Bug 1646603). If we display this message when repository is rejected due to length, we are misleading users.

Comment 6 Justin Sherrill 2018-11-27 13:55:15 UTC
No, this message should only pop up when a non-unique registry name issue is encountered.  The invalid name will declare that it is invalid.

Comment 7 Mirek Długosz 2018-11-27 14:12:32 UTC
OK, that sounds good for me.

Comment 9 Satellite Program 2018-12-06 21:09:50 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25558 has been resolved.

Comment 10 Mirek Długosz 2019-01-04 17:30:28 UTC
Justin,

as we talked on IRC, when following steps to reproduce from original report, I still get generic error message.

I tested your proposed fix (https://github.com/Katello/katello/pull/7910) on my Satellite and this one will fix the issue.
Assigning it back to you, so this bugzilla can move back to ONQA once PR is included in Satellite snap.

Comment 11 Brad Buckingham 2019-01-23 18:42:11 UTC
The second issue tracker 25782 has been closed as the PR has been merged.  Moving BZ to POST.

Comment 13 Mirek Długosz 2019-01-28 12:45:56 UTC
Re-tested after patch has been included in downstream Satellite build.
Error messages on both Lifecycle Environment and Content View pages point to registry name pattern as root cause of issue.

On Lifecycle Environment page error message is: "An error occurred saving the Environment: Registry name pattern results in duplicate container image names for these repositories: alpine, busybox."
On Content View page error message is: "Registry name pattern results in duplicate container image names for these repositories: alpine, busybox. Consider changing the Lifecycle Environment's Registry Name Pattern to something more specific."


Tested on:
Satellite 6.5 snap 13
foreman-1.20.1.9-1.el7sat.noarch
satellite-6.5.0-6.beta.el7sat.noarch
katello-3.10.0-0.6.rc1.el7sat.noarch
pulp-server-2.18.0-0.1.rc.el7sat.noarch

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