Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 798683

Summary: Promoting a product from CLI doesn't promote all product distributions
Product: Red Hat Satellite Reporter: James Laska <jlaska>
Component: katello-agentAssignee: Ivan Necas <inecas>
Status: CLOSED ERRATA QA Contact: Og Maciel <omaciel>
Severity: high Docs Contact:
Priority: medium    
Version: 6.0.1CC: cpelland, dgregor, inecas, jturner, mmccune, omaciel
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-15 18:54:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 798376    
Bug Blocks:    
Attachments:
Description Flags
katello-debug-20120229043828.tar.gz none

Description James Laska 2012-02-29 15:04:51 UTC
Created attachment 566566 [details]
katello-debug-20120229043828.tar.gz

Description of problem:

Promoting a product ("Red Hat Enterprise Linux Server") from the CLI doesn't seem to promote all distributions associated with the product.

After promoting the product, an attempt to promote a system template that uses distribution 'ks-Red Hat Enterprise Linux-Server-6.2-i386' fails because ...

Changeset [ 03 - template rhel-i386-server-6-cf-tools ] promotion failed: Validation failed: Distribution 'ks-Red Hat Enterprise Linux-Server-6.2-i386' not found in the 'Stage' environment

Version-Release number of selected component (if applicable):
 * candlepin-0.5.22-1.el6.src.rpm
 * katello-0.1.300-1.el6.src.rpm
 * katello-certs-tools-1.0.2-2.el6.src.rpm
 * katello-cli-0.1.100-2.el6.src.rpm
 * katello-configure-0.1.100-7.el6.src.rpm
 * katello-httpd-ssl-key-pair-1.0-1.src.rpm
 * katello-qpid-broker-key-pair-1.0-1.src.rpm
 * katello-selinux-0.1.7-1.el6.src.rpm
 * katello-trusted-ssl-cert-1.0-1.src.rpm
 * pulp-0.0.267-2.el6.src.rpm

How reproducible:
 * 2 out of 2 attempts failed


Steps to Reproduce:
 1. Sync and promote RHEL and CloudForms products

> alias ks='katello -u admin -p admin'
> ks provider synchronize --name "Red Hat"
> ks changeset create --name "02 - rht repos"
> ks changeset update --name "02 - rht repos" --add_product "Red Hat Enterprise Linux Server"
> ks changeset update --name "02 - rht repos" --add_product "Red Hat CloudForms"
> ks changeset promote --name "02 - rht repos"

 2. Create and promote a system template referencing a distribution from the promoted product

> ks changeset create --name "03 - template rhel-i386-server-6-cf-tools"
> ks changeset update --name "03 - template rhel-i386-server-6-cf-tools" --add_template rhel-i386-server-6-cf-tools
> ks changeset promote --name "03 - template rhel-i386-server-6-cf-tools"

Actual results:

> Changeset [ 03 - template rhel-i386-server-6-cf-tools ] promotion failed: Validation failed: Distribution 'ks-Red Hat Enterprise Linux-Server-6.2-i386' not found in the 'Stage' environment

Expected results:

> Changeset [ 03 - template rhel-i386-server-6-cf-tools ] promotion successful

Additional info:

 * The following command shows that the distributions do exist in 'Library' ...

> #
> # Library
> #
>  
> # ks product list -v --environment Library | grep "^Name:" | sed -e 's|Name:[ \t]*||' | sort | while read PRODUCT ; do echo "[product] $PRODUCT"; ks repo list -v --environment Library --product "$PRODUCT" | grep "^Name:" | sed -e 's|Name:[ \t]*||' | sort | while read REPO ; do echo "   [repo] $REPO" ; ks distribution list -v --environment Library --product "$PRODUCT" --repo "$REPO" | grep "^Id:"| sed -e 's|^Id:[ \t]*||' | sort |while read DISTRO ; do echo "       [distro] $DISTRO" ; done ; done ; done
> [product] Red Hat CloudForms
>    [repo] Red Hat CloudForms Cloud Engine Beta RPMs x86_64 6Server
>    [repo] Red Hat CloudForms Cloud Engine RPMs x86_64 6Server
>    [repo] Red Hat CloudForms System Engine Beta RPMs x86_64 6Server
>    [repo] Red Hat CloudForms System Engine RPMs x86_64 6Server
> [product] Red Hat Employee Subscription
> [product] Red Hat Enterprise Linux High Availability for RHEL Server
> [product] Red Hat Enterprise Linux Load Balancer for RHEL Server
> [product] Red Hat Enterprise Linux Resilient Storage for RHEL Server
> [product] Red Hat Enterprise Linux Scalable File System for RHEL Server
> [product] Red Hat Enterprise Linux Server
>    [repo] Red Hat CloudForms Tools for RHEL 5 Beta RPMs i386 5Server
>    [repo] Red Hat CloudForms Tools for RHEL 5 Beta RPMs x86_64 5Server
>    [repo] Red Hat CloudForms Tools for RHEL 5 RPMs i386 5Server
>    [repo] Red Hat CloudForms Tools for RHEL 5 RPMs x86_64 5Server
>    [repo] Red Hat CloudForms Tools for RHEL 6 Beta RPMs i386 6Server
>    [repo] Red Hat CloudForms Tools for RHEL 6 Beta RPMs x86_64 6Server
>    [repo] Red Hat CloudForms Tools for RHEL 6 RPMs i386 6Server
>    [repo] Red Hat CloudForms Tools for RHEL 6 RPMs x86_64 6Server
>    [repo] Red Hat Enterprise Linux 5 Server RPMs i386 5Server
>        [distro] ks-Red Hat Enterprise Linux Server-None-5.8-i386
>    [repo] Red Hat Enterprise Linux 5 Server RPMs x86_64 5Server
>        [distro] ks-Red Hat Enterprise Linux Server-None-5.8-x86_64
>    [repo] Red Hat Enterprise Linux 6 Server RPMs i386 6Server
>        [distro] ks-Red Hat Enterprise Linux-Server-6.2-i386
>    [repo] Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server
>        [distro] ks-Red Hat Enterprise Linux-Server-6.2-x86_64
> [product] Red Hat Enterprise Linux Server Self-support 1-2 sockets Up to 1 guest
> [product] Red Hat Enterprise Linux Workstation

 * ... but not in 'Stage' ...

> # ks product list -v --environment Stage | grep "^Name:" | sed -e 's|Name:[ \t]*||' | sort | while read PRODUCT ; do echo "[product] $PRODUCT"; ks repo list -v --environment Stage --product "$PRODUCT" | grep "^Name:" | sed -e 's|Name:[ \t]*||' | sort | while read REPO ; do echo "   [repo] $REPO" ; ks distribution list -v --environment Stage --product "$PRODUCT" --repo "$REPO" | grep "^Id:"| sed -e 's|^Id:[ \t]*||' | sort |while read DISTRO ; do echo "       [distro] $DISTRO" ; done ; done ; done
> [product] Red Hat CloudForms
>    [repo] Red Hat CloudForms Cloud Engine Beta RPMs x86_64 6Server
>    [repo] Red Hat CloudForms Cloud Engine RPMs x86_64 6Server
>    [repo] Red Hat CloudForms System Engine Beta RPMs x86_64 6Server
>    [repo] Red Hat CloudForms System Engine RPMs x86_64 6Server
> [product] Red Hat Enterprise Linux Server
>    [repo] Red Hat CloudForms Tools for RHEL 5 Beta RPMs i386 5Server
>    [repo] Red Hat CloudForms Tools for RHEL 5 Beta RPMs x86_64 5Server
>    [repo] Red Hat CloudForms Tools for RHEL 5 RPMs i386 5Server
>    [repo] Red Hat CloudForms Tools for RHEL 5 RPMs x86_64 5Server
>    [repo] Red Hat CloudForms Tools for RHEL 6 Beta RPMs i386 6Server
>    [repo] Red Hat CloudForms Tools for RHEL 6 Beta RPMs x86_64 6Server
>    [repo] Red Hat CloudForms Tools for RHEL 6 RPMs i386 6Server
>    [repo] Red Hat CloudForms Tools for RHEL 6 RPMs x86_64 6Server
>    [repo] Red Hat Enterprise Linux 5 Server RPMs i386 5Server
>        [distro] ks-Red Hat Enterprise Linux Server-None-5.8-i386
>    [repo] Red Hat Enterprise Linux 5 Server RPMs x86_64 5Server
>        [distro] ks-Red Hat Enterprise Linux Server-None-5.8-x86_64
>    [repo] Red Hat Enterprise Linux 6 Server RPMs i386 6Server
>    [repo] Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server

 * See attached katello-debug log

Comment 2 Ivan Necas 2012-03-05 17:29:37 UTC
Created new BZ for correct handling of failed synchronizations: https://bugzilla.redhat.com/show_bug.cgi?id=800078

Comment 3 Ivan Necas 2012-03-06 08:57:49 UTC
*** Bug 800078 has been marked as a duplicate of this bug. ***

Comment 4 Ivan Necas 2012-03-06 14:37:54 UTC
I've closed the bug#800078, because we can solve it here. It also relates to bug#798376. Once 798376 is solved it will be much easier to correct the behavior to show errors when synchronization of some files fails.

Comment 5 Ivan Necas 2012-03-13 18:00:50 UTC
Commit 7422b59e5b5a5777b891597bb90347968d7aef00 contains fix, that handles errors on synchronization and it should properly display details in user notification details, CLI messages and log of delayed_jobs.

Comment 6 Ivan Necas 2012-03-13 18:04:27 UTC
Checking on synchronization of http://inecas.fedorapeople.org/fakerepos/ks_invalid/, that has wrong checksums in img files

Comment 9 Og Maciel 2012-03-16 21:13:17 UTC
Verified:
* candlepin-0.5.26-1.el6.noarch
* candlepin-tomcat6-0.5.26-1.el6.noarch
* katello-0.1.304-1.el6.noarch
* katello-all-0.1.304-1.el6.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.0.4-1.el6.noarch
* katello-cli-0.1.105-1.el6.noarch
* katello-cli-common-0.1.105-1.el6.noarch
* katello-common-0.1.304-1.el6.noarch
* katello-configure-0.1.106-1.el6.noarch
* katello-glue-candlepin-0.1.304-1.el6.noarch
* katello-glue-foreman-0.1.304-1.el6.noarch
* katello-glue-pulp-0.1.304-1.el6.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-qpid-client-key-pair-1.0-1.noarch
* katello-selinux-0.1.9-1.el6.noarch
* pulp-1.0.0-5.el6.noarch
* pulp-common-1.0.0-5.el6.noarch
* pulp-selinux-server-1.0.0-5.el6.noarch

Comment 10 errata-xmlrpc 2012-05-15 18:54:14 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.

http://rhn.redhat.com/errata/RHEA-2012-0665.html

Comment 11 Mike McCune 2013-08-16 18:24:03 UTC
getting rid of 6.0.0 version since that doesn't exist