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 1333774 - foreman-installer upgrade fails if unmanaged hosts exist on satellite
Summary: foreman-installer upgrade fails if unmanaged hosts exist on satellite
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: Ivan Necas
QA Contact: Roman Plevka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-06 11:57 UTC by Roman Plevka
Modified: 2019-09-26 16:20 UTC (History)
4 users (show)

Fixed In Version: rubygem-katello-3.0.0.28-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:13:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
/var/log/foreman-installer/katello.log (64.30 KB, text/plain)
2016-05-06 11:58 UTC, Roman Plevka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 14982 0 Normal Closed host description migration goes throuh unfaked-host validations 2021-01-25 18:42:40 UTC

Description Roman Plevka 2016-05-06 11:57:48 UTC
Description of problem:
foreman-installer --upgrade (from 6.2.0 Beta to GA10) failed.
foreman-installer/katello.log (attached) is showing the following

StandardError: An error has occurred, this and all later migrations canceled:

Validation failed: Build mode cannot be enabled for an unmanaged host/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/validations.rb:57:in `save!'

- My satellite contains multiple hosts with one of them being unmanaged.
after marking it 'managed' using UI, the installer proceeds (and fails on different error reported in: BZ#1333769)

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

Steps to Reproduce:
1. yum upgrade
2. foreman-installer --upgrade

Actual results:
Validation failed: Build mode cannot be enabled for an unmanaged host/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/validations.rb:57:in `save!'

Expected results:
upgrade works

Additional info:

Comment 1 Roman Plevka 2016-05-06 11:58:18 UTC
Created attachment 1154592 [details]
/var/log/foreman-installer/katello.log

Comment 6 Ivan Necas 2016-05-10 11:52:50 UTC
Created redmine issue http://projects.theforeman.org/issues/14982 from this bug

Comment 7 Ivan Necas 2016-05-10 12:09:30 UTC
Anyway, the problem lies here https://github.com/Katello/katello/blob/master/db/migrate/20160426145517_move_host_description_to_host_comment.rb#L13, where the code goes over the validations where it should not - we should limit the scope of the update

Comment 8 Ivan Necas 2016-05-10 12:23:20 UTC
The proposed fix https://github.com/Katello/katello/pull/6032

Comment 9 Roman Plevka 2016-05-27 14:27:44 UTC
VERIFIED
on sat6.2.0 Beta (GA13.1)

Upgrade now passes with no errors.


<pre>
# satellite-installer --upgrade --scenario satellite
Upgrading...
Upgrade Step: stop_services...
Upgrade Step: start_databases...
Upgrade Step: update_http_conf...
Upgrade Step: migrate_pulp...
Upgrade Step: fix_pulp_httpd_conf...
Upgrade Step: start_httpd...
Upgrade Step: start_qpidd...
Upgrade Step: start_pulp...
Upgrade Step: migrate_candlepin...
Upgrade Step: start_tomcat...
Upgrade Step: fix_katello_settings_file...
Upgrade Step: migrate_foreman...
Upgrade Step: migrate_gutterball...
Upgrade Step: remove_nodes_distributors...
Upgrade Step: Running installer...
Installing             Done                                               [100%] [............................................................]
  The full log is at /var/log/foreman-installer/satellite.log
Upgrade Step: restart_services...
Upgrade Step: db_seed...
Upgrade Step: import_package_groups (this may take a while) ...
Upgrade Step: import_rpms (this may take a while) ...
Upgrade Step: import_distributions (this may take a while) ...
Upgrade Step: import_puppet_modules (this may take a while) ...
Upgrade Step: import_subscriptions (this may take a while) ...
Upgrade Step: elasticsearch_message...
Upgrade Step: remove_docker_v1_content (this may take a while) ...
Katello upgrade completed!

</pre>

Comment 10 Bryan Kearney 2016-07-27 11:13:49 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.