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 874768

Summary: [1.0.1 to 1.1 UPGRADE] Katello database failed
Product: Red Hat Satellite Reporter: Og Maciel <omaciel>
Component: Content ManagementAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Og Maciel <omaciel>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: cpelland, dmacpher, gkhachik, inecas, lzap, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Upgrading from System Engine 1.0.1 to 1.1 fails at the database migration stage. This is due to label processing for environments set to nil. This fix corrects this issue.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 19:58:03 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:
Attachments:
Description Flags
katello_upgrade.log none

Description Og Maciel 2012-11-08 19:55:19 UTC
Created attachment 641058 [details]
katello_upgrade.log

Description of problem:

Upgrading CFSE 1.0.1 to latest 1.1 code breaks while upgrading katello DB. See full upgrade.log attached.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Install CFSE 1.0.1
2. Add Orgs, users, custom content, upload manifests, promote content, register systems
3. Upgrade to latest 1.1 following https://fedorahosted.org/katello/wiki/Upgrade
  
Actual results:


Expected results:


Additional info:

# katello-upgrade
================================================================================
 Katello upgrade
================================================================================

1/4: Update Pulp MongoDB database (0002_update_pulp.sh)
 Actions that need to be taken to upgrade Pulp subsystem

Do you want to proceed? (y/n): y

Update Pulp MongoDB database OK.

================================================================================

2/4: Update Candlepin (0003_update_candlepin.sh)
 Updates Candlepin database schema to the latest version

Do you want to proceed? (y/n): y

Update Candlepin OK.

================================================================================

3/4: Migrate Katello database (0004_migrate_katello_db.sh)
 Updates Katello database schema to the latest version

Do you want to proceed? (y/n): y

Migrate Katello database FAILED.
================================================================================
Finished 2 of 4 upgrade steps

Comment 1 Lukas Zapletal 2012-11-09 08:43:12 UTC
The reindex step fails:

undefined local variable or method `label' for #<Organization:0x7f36f02cbce8>
/usr/lib/ruby/gems/1.8/gems/activemodel-3.0.10/lib/active_model/attribute_methods.rb:392:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/attribute_methods.rb:46:in `method_missing'
/usr/share/katello/app/models/glue/candlepin/owner.rb:28:in `included'
/usr/share/katello/app/models/lazy_accessor.rb:135:in `instance_eval'
/usr/share/katello/app/models/lazy_accessor.rb:135:in `run_initializer'
/usr/share/katello/app/models/lazy_accessor.rb:74:in `service_levels'
/usr/share/katello/app/models/indexed_model.rb:136:in `send'
/usr/share/katello/app/models/indexed_model.rb:136:in `to_indexed_json'
/usr/share/katello/app/models/indexed_model.rb:135:in `each'
/usr/share/katello/app/models/indexed_model.rb:135:in `to_indexed_json'
/usr/lib/ruby/gems/1.8/gems/tire-0.3.12/lib/tire/index.rb:296:in `convert_document_to_json'
/usr/lib/ruby/gems/1.8/gems/tire-0.3.12/lib/tire/index.rb:76:in `bulk_store'
/usr/lib/ruby/gems/1.8/gems/tire-0.3.12/lib/tire/index.rb:68:in `map'
/usr/lib/ruby/gems/1.8/gems/tire-0.3.12/lib/tire/index.rb:68:in `bulk_store'
/usr/lib/ruby/gems/1.8/gems/tire-0.3.12/lib/tire/index.rb:118:in `import'
/usr/share/katello/lib/tasks/reindex.rake:11
/usr/share/katello/lib/tasks/reindex.rake:8:in `each'
/usr/share/katello/lib/tasks/reindex.rake:8

Comment 2 Ivan Necas 2012-11-09 09:03:24 UTC
It probably fails because the migrations are not successful, doesn't it?

Comment 3 Lukas Zapletal 2012-11-09 09:14:44 UTC
https://github.com/Katello/katello/pull/1027

Comment 7 Og Maciel 2012-11-09 18:24:37 UTC
Verified:

* candlepin-0.7.8.1-1.el6cf.noarch
* candlepin-selinux-0.7.8.1-1.el6cf.noarch
* candlepin-tomcat6-0.7.8.1-1.el6cf.noarch
* katello-1.1.12-22.el6cf.noarch
* katello-all-1.1.12-22.el6cf.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.1.8-1.el6cf.noarch
* katello-cli-1.1.8-12.el6cf.noarch
* katello-cli-common-1.1.8-12.el6cf.noarch
* katello-common-1.1.12-22.el6cf.noarch
* katello-configure-1.1.9-12.el6cf.noarch
* katello-glue-candlepin-1.1.12-22.el6cf.noarch
* katello-glue-foreman-0.1.318-1.el6cf.noarch
* katello-glue-pulp-1.1.12-22.el6cf.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-qpid-client-key-pair-1.0-1.noarch
* katello-selinux-1.1.1-2.el6cf.noarch
* pulp-1.1.14-1.el6cf.noarch
* pulp-common-1.1.14-1.el6cf.noarch
* pulp-selinux-server-1.1.14-1.el6cf.noarch

Comment 10 errata-xmlrpc 2012-12-04 19:58:03 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