Bug 1339682 - Upgrade fails with undefined method error
Summary: Upgrade fails with undefined method error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Upgrades
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Brad Buckingham
QA Contact: Sachin Ghai
URL:
Whiteboard:
: 1339763 1340197 1340614 (view as bug list)
Depends On:
Blocks: 1335807
TreeView+ depends on / blocked
 
Reported: 2016-05-25 15:21 UTC by John Mitsch
Modified: 2019-09-26 17:32 UTC (History)
5 users (show)

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:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:32:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
upgrade log migration error (6.98 KB, text/plain)
2016-05-25 15:21 UTC, John Mitsch
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15184 0 None None None 2016-05-25 16:14:36 UTC
Foreman Issue Tracker 15239 0 None None None 2016-05-31 13:21:12 UTC
Foreman Issue Tracker 15255 0 None None None 2016-06-01 13:09:09 UTC

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


Note You need to log in before you can comment on or make changes to this bug.