Bug 829208

Summary: Manifest import fail after creating a custom product
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: WebUIAssignee: Ivan Necas <inecas>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.1CC: cpelland, dmacpher, gkhachik, hhovsepy, inecas, jlaska, mmccune, omaciel, snansi, tomckay
Target Milestone: UnspecifiedKeywords: Triaged, ZStream
Target Release: Unused   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
System Engine did not include custom products when checking products on manifest import. This caused manifest imports to fail after custom product creation. This fix includes custom products when checking existing products. Manifests now import correctly.
Story Points: ---
Clone Of:
: 834010 (view as bug list) Environment:
Last Closed: 2012-12-04 19:46:33 UTC 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:
Bug Depends On:    
Bug Blocks: 834010    
Attachments:
Description Flags
Complete error log from production.log none

Description Sachin Ghai 2012-06-06 08:35:10 UTC
Description of problem:
Facing issue while importing manifest on latest puddle. Manifest import fails immediately after creating custom product.

I used the same manifest while 1.0 RC testing. And I was able to sync repos.

UI says:
=====
Subscription manifest upload for provider 'Red Hat' failed.
Reason: Validation failed: Products within an organization must have unique name.
If you are uploading an older manifest, you can use the Force checkbox to overwrite existing data.
Click here for more details.

Please note that this is a fresh environment and I'm importing the manifest first time.. No other manifest is imported before.



Version-Release number of selected component (if applicable):
[root@dhcp201-221 ~]# rpm -qa | grep katello-0
katello-0.1.313-1.el6_3.noarch


How reproducible:
always

Steps to Reproduce:
1. Create a custom product 
2. Import manifest
3.
  
Actual results:
Actual Result: Manifest import fail with error:

production.log:
===============
[ERROR: 2012-06-06 07:06:04 #5769] Failed to create product pulp for provider Glue::Candlepin::Product: Validation failed: Products within an organization must have unique name., /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/validations.rb:49:in `save!'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/attribute_methods/dirty.rb:30:in `save!'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/transactions.rb:245:in `save!'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/transactions.rb:292:in `with_transaction_returning_status'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/transactions.rb:207:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/transactions.rb:245:in `save!'
/usr/share/katello/app/models/lazy_accessor.rb:108:in `save!'
/usr/share/katello/app/models/glue/candlepin/product.rb:67:in `import_marketing_from_cp'
/usr/share/katello/app/models/glue/provider.rb:198:in `import_products_from_cp'

Expected results:
Manifest should be imported succesfully

Additional info:

Comment 1 Sachin Ghai 2012-06-06 08:38:42 UTC
Created attachment 589777 [details]
Complete error log from production.log

Comment 3 Ivan Necas 2012-06-06 09:16:45 UTC
The pull request fixing this issue opened against Katello:

https://github.com/Katello/katello/pull/183

Comment 5 Tom McKay 2012-06-12 19:54:20 UTC
  Branch: refs/heads/master
  Home:   https://github.com/Katello/katello
  Commit: 8cb8c62ca9ba667e87193166b5f4e07d8147c778
      https://github.com/Katello/katello/commit/8cb8c62ca9ba667e87193166b5f4e07d8147c778
  Author: Ivan Necas <inecas>
  Date:   2012-06-06 (Wed, 06 Jun 2012)

Comment 6 James Laska 2012-06-18 19:33:42 UTC
I'm also seeing this failure while testing manifest import while custom providers exist.

https://beaker.engineering.redhat.com/jobs/249790

:: [   INFO   ] ::  * candlepin-0.6.5-1.el6_2.src.rpm
:: [   INFO   ] ::  * katello-0.1.317-1.el6_2.src.rpm
:: [   INFO   ] ::  * katello-candlepin-cert-key-pair-1.0-1.src.rpm
:: [   INFO   ] ::  * katello-certs-tools-1.0.7-1.el6_3.src.rpm
:: [   INFO   ] ::  * katello-cli-0.1.111-1.el6_2.src.rpm
:: [   INFO   ] ::  * katello-configure-0.1.110-1.el6_3.src.rpm
:: [   INFO   ] ::  * katello-qpid-broker-key-pair-1.0-1.src.rpm
:: [   INFO   ] ::  * katello-qpid-client-key-pair-1.0-1.src.rpm
:: [   INFO   ] ::  * katello-selinux-0.1.10-1.el6.src.rpm
:: [   INFO   ] ::  * pulp-1.0.4-1.el6.src.rpm
:: [   INFO   ] ::  * redhat-release-server-6Server-6.3.0.3.el6.src.rpm
:: [   INFO   ] ::  * subscription-manager-0.99.19-1.el6.src.rpm

Comment 9 Sachin Ghai 2012-09-18 12:17:15 UTC
Verified with following CFSE build:

katello-qpid-client-key-pair-1.0-1.noarch
katello-common-1.1.12-7.el6cf.noarch
katello-all-1.1.12-7.el6cf.noarch
katello-cli-1.1.8-4.el6cf.noarch
katello-certs-tools-1.1.8-1.el6cf.noarch
katello-glue-candlepin-1.1.12-7.el6cf.noarch
katello-selinux-1.1.1-1.el6cf.noarch
katello-configure-1.1.9-3.el6cf.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-cli-common-1.1.8-4.el6cf.noarch
katello-glue-pulp-1.1.12-7.el6cf.noarch
katello-1.1.12-7.el6cf.noarch
katello-qpid-broker-key-pair-1.0-1.noarch

Verified that manifest import is successful after creating a custom product.

Comment 11 Hayk Hovsepyan 2012-12-04 15:15:25 UTC
Automation is covered in test class "com.redhat.qe.katello.tests.e2e.StackedSubscriptions"

Comment 12 errata-xmlrpc 2012-12-04 19:46:33 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/RHSA-2012-1543.html

Comment 13 Mike McCune 2013-08-16 18:12:53 UTC
getting rid of 6.0.0 version since that doesn't exist