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 2010230 - In Satellite upgrade, installer failed with exit status 6 in the db:migrate stage.
Summary: In Satellite upgrade, installer failed with exit status 6 in the db:migrate s...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.10.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: 6.10.0
Assignee: Ian Ballou
QA Contact: Stephen Wadeley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-04 09:28 UTC by Devendra Singh
Modified: 2021-11-16 14:14 UTC (History)
5 users (show)

Fixed In Version: tfm-rubygem-katello-4.1.1.33-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:13:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 33629 0 Normal New In Katello 4.1 upgrade, installer failed with exit status 6 in the db:migrate stage. 2021-10-04 22:59:35 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:14:07 UTC

Description Devendra Singh 2021-10-04 09:28:50 UTC
Description of problem: In Satellite upgrade,installer failed with exit status 6 in the db:migrate stage.


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

How reproducible:
always

Steps to Reproduce:
1. Prepare the 6.9.z setup using the upgrade template.
2. Run the pre-migration steps before running the upgrade for 6.10 snap21.
3. Pulp migration completes successfully.
4. Run the upgrade, with BZ#2009630 workaround.
5. In the upgrade, satellite-installer failed in the db:migrate stage.


stage.the/Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
 

Actual results:
foreman-rake-db:migrate failed in the installer

Expected results:
foreman-rake-db:migrate should be completed successfully.

Additional info:

Comment 2 Evgeni Golov 2021-10-04 09:40:08 UTC
the backtrace in the installer log looks like this:
2021-10-04 04:40:23 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: undefined method `upstream_authentication_token=' for #<Katello::RootRepository:0x00000000145d
2cd0>
2021-10-04 04:40:23 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: Did you mean?  upstream_authentication_token
2021-10-04 04:40:23 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns:                upstream_authentication_token_in_db
2021-10-04 04:40:23 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: /opt/theforeman/tfm/root/usr/share/gems/gems/activemodel-6.0.3.7/lib/active_model/attribute_me
thods.rb:432:in `method_missing'
2021-10-04 04:40:23 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/auditor.rb:99:in `metho
d_missing'
2021-10-04 04:40:23 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.29/app/models/katello/root_reposito
ry.rb:304:in `ensure_valid_authentication_token'


this points at this commit: https://gitlab.sat.engineering.redhat.com/satellite6/katello/-/commit/7b226bb1f4b361b960cd94269520a1e611919fb7

Comment 3 Evgeni Golov 2021-10-04 09:46:07 UTC
Is the problem that it's failing during "20210512192745 FixRedHatRootRepositoryArch" migration, but the token is only added in 20210831161843 "AddUpstreamAuthTokenToRootRepository"?

(I missed the following line from aboves paste:
2021-10-04 04:40:23 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.29/db/migrate/20210512192745_fix_red_hat_root_repository_arch.rb:5:in `up'

)

Comment 4 Evgeni Golov 2021-10-04 10:04:25 UTC
Funny.

If I execute that migration manually, I can then migrate all:

[root@dhcp-3-75 ~]# foreman-rake db:migrate:up VERSION=20210831161843
API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
== 20210831161843 AddUpstreamAuthTokenToRootRepository: migrating =============
-- add_column(:katello_root_repositories, :upstream_authentication_token, :string, {:limit=>1024})
   -> 0.0022s
== 20210831161843 AddUpstreamAuthTokenToRootRepository: migrated (0.0023s) ====

[root@dhcp-3-75 ~]# foreman-rake db:migrate
API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
== 20210512192745 FixRedHatRootRepositoryArch: migrating ======================
== 20210512192745 FixRedHatRootRepositoryArch: migrated (0.1125s) =============

== 20210525144427 EnforceUniqueTemplates: migrating ===========================
-- add_index(:templates, [:type, :name], {:unique=>true})
   -> 0.0072s
== 20210525144427 EnforceUniqueTemplates: migrated (0.0169s) ==================

== 20210608100743 DeleteRhevmProfiles: migrating ==============================
== 20210608100743 DeleteRhevmProfiles: migrated (0.0140s) =====================

== 20210609093404 DropOverrideTaxonomiesFromFilter: migrating =================
== 20210609093404 DropOverrideTaxonomiesFromFilter: migrated (0.0502s) ========

== 20210610131920 RestrictSendmailLocation: migrating =========================
== 20210610131920 RestrictSendmailLocation: migrated (0.0030s) ================

== 20210909140337 AddLastIndexedToRepos: migrating ============================
-- add_column(:katello_repositories, :last_indexed, :datetime, {:default=>Wed, 31 Dec 1969 19:00:00 -0500})
   -> 0.0028s
== 20210909140337 AddLastIndexedToRepos: migrated (0.0031s) ===================

== 20210910190324 MoveBackgroundSettingsToImmediate: migrating ================
== 20210910190324 MoveBackgroundSettingsToImmediate: migrated (0.0327s) =======



This is obviously not how it should be fixed, but interesting…

Comment 5 Ian Ballou 2021-10-04 22:59:34 UTC
Created redmine issue https://projects.theforeman.org/issues/33629 from this bug

Comment 9 Evgeni Golov 2021-10-20 08:56:08 UTC
- rhel-7-server-ansible-2.9-rpms
- rhel-7-server-ansible-2-rpms

you seem to have/had conflicting Ansible repos enabled, which messed up your system

Comment 10 Stephen Wadeley 2021-10-20 11:09:29 UTC
(In reply to Evgeni Golov from comment #9)
> - rhel-7-server-ansible-2.9-rpms
> - rhel-7-server-ansible-2-rpms
> 
> you seem to have/had conflicting Ansible repos enabled, which messed up your
> system

right, so dogfood CVs and activation keys --

Comment 24 errata-xmlrpc 2021-11-16 14:13:58 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 (Moderate: Satellite 6.10 Release), 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/RHSA-2021:4702


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