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 1339682

Summary: Upgrade fails with undefined method error
Product: Red Hat Satellite Reporter: John Mitsch <jomitsch>
Component: UpgradesAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, cwelton, ehelms, lpramuk, sghai
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-katello-3.0.0.38-1,rubygem-katello-3.0.0.40-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:32:51 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: 1335807    
Attachments:
Description Flags
upgrade log migration error none

Description John Mitsch 2016-05-25 15:21:33 UTC
Created attachment 1161484 [details]
upgrade log migration error

Description of problem:

The Satellite upgrade fails when there is a capsule installed and a repo synced.

 /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: Failed to call refresh: /usr/sbin/foreman-rake db:seed returned 1 instead of one of [0]
 /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: /usr/sbin/foreman-rake db:seed returned 1 instead of one of [0]


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

6.1 > 6.2 upgrade 

How reproducible:

Always

Steps to Reproduce:
1. Install Satellite 6.1
2. Install a capsule
3. Sync a repo
4. Upgrade to 6.2

Actual results:

Upgrade fails 

Expected results:

upgrade succeeds

Additional info:
I had one zoo repo synced to the Satellite.

 I also attached an excerpt from the log where I believe the issue is, it looks like the migration fails, which makes it so there is pending migrations on the seeds step.

Comment 1 Brad Buckingham 2016-05-25 16:14:34 UTC
Created redmine issue http://projects.theforeman.org/issues/15184 from this bug

Comment 3 Brad Buckingham 2016-05-26 01:46:25 UTC
*** Bug 1339763 has been marked as a duplicate of this bug. ***

Comment 4 Brad Buckingham 2016-05-26 01:48:41 UTC
After fixing the error above, there was another error in MigrateContentHosts, then another and another...etc.  Since all of them needed to be fixed in order to have the migration succeed, they are all being included with this bug.  Refer to the PR for the full details:

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

Comment 5 Brad Buckingham 2016-05-26 01:49:22 UTC
Refer to bug 1339763 for a couple of those additional errors.

Comment 6 Brad Buckingham 2016-05-26 17:48:57 UTC
Upstream Katello PR: https://github.com/Katello/katello/pull/6066

Comment 7 Brad Buckingham 2016-05-31 12:30:04 UTC
*** Bug 1340614 has been marked as a duplicate of this bug. ***

Comment 8 Brad Buckingham 2016-05-31 13:21:13 UTC
An additional error was observed with the ContentHostMigration; therefore, we'll address it with this same bug.

The error is:
    "Could not find the inverse association for content_facet_repositories"

The fix will be submitted upstream with:
    http://projects.theforeman.org/issues/15239

Comment 9 Brad Buckingham 2016-06-01 13:09:10 UTC
Additional errors observed with the ContentHostMigration; therefore, addressing them with this same bug.  The errors below occurred when upgrading a Satellite that had a Capsule with a host (not in an org) and content host (in an org)

Error 1:

uninitialized constant MigrateContentHosts::SmartProxy::MigrateContentHosts::ContentHost/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/inheritance.rb:133:in `compute_type'

Error 2:

can't modify frozen Hash/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/attribute_methods/write.rb:91:in `write_attribute_with_type_cast'

The fix is submitted upstream with:
    http://projects.theforeman.org/issues/15255

Comment 10 Brad Buckingham 2016-06-03 00:18:57 UTC
*** Bug 1340197 has been marked as a duplicate of this bug. ***

Comment 11 Sachin Ghai 2016-06-03 08:14:22 UTC
Verified with upgrade from sat6.1.9 -> sat6.2 GA snap14.2 on rhel7.

Upgrade was successfully completed. I don't see any issue with migration step. Also this bz points to different migration issues and I believe all of them are fixed. For me upgrade was completed successfully without any issue.

SATELLITE UPGRADE started at: Fri Jun  3 02:18:11 2016
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] run: satellite-installer
--scenario satellite --upgrade
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrading...
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
stop_services...
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
start_databases...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
update_http_conf...
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
migrate_pulp...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
fix_pulp_httpd_conf...
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
start_httpd...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
start_qpidd...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
start_pulp...
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
migrate_candlepin...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
start_tomcat...
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
fix_katello_settings_file...
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
migrate_foreman...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
remove_nodes_distributors...
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
Running installer...

Done                                               [100%] []Installing         
   Done                                               [100%] []
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out:   The full log is at
/var/log/foreman-installer/satellite.log
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
restart_services...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
db_seed...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
import_package_groups (this may take a while) ...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
import_rpms (this may take a while) ...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
import_distributions (this may take a while) ...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
import_puppet_modules (this may take a while) ...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
import_subscriptions (this may take a while) ...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
elasticsearch_message...
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Elasticsearch has
been removed as a dependency.  The database files can be removed manually with
#rm -rf /var/lib/elasticsearch.  Some packages are no longer needed and can be
removed:  #rpm -e ruby193-rubygem-tire tfm-rubygem-tire elasticsearch
sigar-java sigar snappy-java lucene4-contrib lucene4
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
remove_docker_v1_content (this may take a while) ...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Upgrade Step:
remove_gutterball...

[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: Katello upgrade
completed!
[qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com] out: 

SATELLITE UPGRADE finished at: Fri Jun  3 03:07:19 2016

Comment 12 Sachin Ghai 2016-06-03 08:33:33 UTC
Just to correct: Verification is done with upgrade from sat6.1.9 -> sat6.2 GA snap14.1 on rhel7. Rpm version is 14.2

satellite-6.2.0-14.2.el7sat.noarch

Comment 13 Bryan Kearney 2016-07-27 11:32:51 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/RHBA-2016:1501