Created attachment 567124 [details] katello-debug-20120302130651.tar.gz Description of problem: Attempting to add a distribution to a changeset fails. The failure message is similar to that in bug#798737, but the reproducer is different. undefined method `errata_id' for #<ChangesetDistribution:0x7f0cc730ac70> Version-Release number of selected component (if applicable): * candlepin-0.5.23-1.el6.src.rpm * katello-0.1.301-2.el6.src.rpm * katello-candlepin-cert-key-pair-1.0-1.src.rpm * katello-certs-tools-1.0.3-1.el6.src.rpm * katello-cli-0.1.100-2.el6.src.rpm * katello-configure-0.1.101-1.el6.src.rpm * katello-qpid-broker-key-pair-1.0-1.src.rpm * katello-qpid-client-key-pair-1.0-1.src.rpm * katello-selinux-0.1.8-1.el6.src.rpm * pulp-1.0.0-4.el6.src.rpm How reproducible: Steps to Reproduce: # katello -u admin -p admin changeset create --name "02 - rht repos" Successfully created changeset [ 02 - rht repos ] for environment [ Stage ] # katello -u admin -p admin changeset update --name "02 - rht repos" --add_product "Red Hat Enterprise Linux Server" Successfully updated changeset [ 02 - rht repos ] # katello -u admin -p admin changeset update --name "02 - rht repos" --add_product "Red Hat CloudForms" Successfully updated changeset [ 02 - rht repos ] # katello -u admin -p admin changeset update --name "02 - rht repos" --from_product "Red Hat Enterprise Linux Server" --add_distribution "ks-Red Hat Enterprise Linux-Server-6.2-i386" Actual results: undefined method `errata_id' for #<ChangesetDistribution:0x7f0cc730ac70> Expected results: Successfully updated changeset [ 02 - rht repos ] Additional info:
After applying the commit used to fix bug#798737 ... this prevents adding a distribution to a changeset > # katello -u admin -p admin changeset update --name "02 - rht repos" --from_product "Red Hat Enterprise Linux Server" --add_distribution "ks-Red Hat Enterprise Linux-Server-6.2-i386" > Validation failed: Repository of the distribution 'ks-Red Hat Enterprise Linux-Server-6.2-i386' has not been promoted into the target environment! This error doesn't make sense. I know the distribution hasn't been promoted, that's why I'm adding it to a changeset for promotion.
*** This bug has been marked as a duplicate of bug 798737 ***
Re-opening to draw attention to the problem reported in comment#1
I could not reproduce this issue. When trying this scenario (see also "good distro promotion" attached script): 1. create org, env, product, 2 repos 2. promote product 3. synchronized repos (to get new distros, that were not in promoted repo before) 4. promote only a distribution Really, only the distribution (including image files) was promoted The only case, when I got the message "{distro} has not been promoted into the target environment" was in this scenario (see also "bad distro promotion" attached script): 1. create org, env, product, 1 repo 2. promote product 3. create second repo, with distro, synchronize 4. create a changeset with that distro Now you see the message, but it is correct, because the repository really was not promoted. And when you promote the whole repository, you get the distro with it. So I thing this is correct behavior as well It seems like some inconsistency in Pulp db might cause this problem, but it's really hard to reproduce
Created attachment 568694 [details] bad distro promotion script
Created attachment 568695 [details] good distro promotion script
Validated: * candlepin-0.5.24-1.el6.noarch * candlepin-tomcat6-0.5.24-1.el6.noarch * katello-0.1.303-1.el6.noarch * katello-all-0.1.303-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.102-1.el6.noarch * katello-cli-common-0.1.102-1.el6.noarch * katello-common-0.1.303-1.el6.noarch * katello-configure-0.1.104-1.el6.noarch * katello-glue-candlepin-0.1.303-1.el6.noarch * katello-glue-foreman-0.1.303-1.el6.noarch * katello-glue-pulp-0.1.303-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.8-1.el6.noarch * pulp-1.0.0-4.el6.noarch * pulp-common-1.0.0-4.el6.noarch * pulp-selinux-server-1.0.0-4.el6.noarch
After this fix, I'm unable to add a distribution to a changeset. While I no longer see the originally reported failure ... I now am preventing from adding a distro to a changeset. This makes the '--add_distribution' option to the 'changeset update' command not useful. katello -u admin -p admin changeset create --name "02 - rht repos" Successfully created changeset [ 02 - rht repos ] for environment [ Stage ] katello -u admin -p admin changeset update --name "02 - rht repos" --add_product "Red Hat Enterprise Linux Server" Successfully updated changeset [ 02 - rht repos ] katello -u admin -p admin changeset update --name "02 - rht repos" --add_product "Red Hat CloudForms" Successfully updated changeset [ 02 - rht repos ] katello -u admin -p admin changeset update --name "02 - rht repos" --from_product "Red Hat Enterprise Linux Server" --add_distribution "ks-Red Hat Enterprise Linux-Server-6.2-i386" Validation failed: Repository of the distribution 'ks-Red Hat Enterprise Linux-Server-6.2-i386' has not been promoted into the target environment! katello -u admin -p admin changeset update --name "02 - rht repos" --from_product "Red Hat Enterprise Linux Server" --add_distribution "ks-Red Hat Enterprise Linux-Server-6.2-x86_64" Validation failed: Repository of the distribution 'ks-Red Hat Enterprise Linux-Server-6.2-x86_64' has not been promoted into the target environment! katello -u admin -p admin changeset update --name "02 - rht repos" --from_product "Red Hat Enterprise Linux Server" --add_distribution "ks-Red Hat Enterprise Linux Server-None-5.8-i386" Validation failed: Repository of the distribution 'ks-Red Hat Enterprise Linux Server-None-5.8-i386' has not been promoted into the target environment! katello -u admin -p admin changeset update --name "02 - rht repos" --from_product "Red Hat Enterprise Linux Server" --add_distribution "ks-Red Hat Enterprise Linux Server-None-5.8-x86_64" Validation failed: Repository of the distribution 'ks-Red Hat Enterprise Linux Server-None-5.8-x86_64' has not been promoted into the target environment!
Comment#12 was reproduced with the following versions ... * candlepin-0.5.26-1.el6.src.rpm * katello-0.1.304-1.el6.src.rpm * katello-candlepin-cert-key-pair-1.0-1.src.rpm * katello-certs-tools-1.0.4-1.el6.src.rpm * katello-cli-0.1.104-1.el6.src.rpm * katello-configure-0.1.104-1.el6.src.rpm * katello-qpid-broker-key-pair-1.0-1.src.rpm * katello-qpid-client-key-pair-1.0-1.src.rpm * katello-selinux-0.1.8-1.el6.src.rpm * pulp-1.0.0-4.el6.src.rpm
Discussed the issue from comment#12 with inecas on IRC. I understand now that a distribution cannot be added to a changeset unless the associated repository is already promoted to the target environment. However, seems there may be room for the 'changeset update --add_distribution' command to check whether the repository associated with the distribution is already included in the same changeset. We'll track adjustments to that issue in bug#805002
getting rid of 6.0.0 version since that doesn't exist