Upgrade from Red Hat Satellite 6.8 to 6.9 fails with error '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]

Solution Verified - Updated -

Issue

  • While attempting to upgrade the Red Hat Satellite server 6.8 to 6.9, It fails at the db:migrate stage with either of these two errors.

    2021-04-28 11:23:10 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: Caused by:
    2021-04-28 11:23:10 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: PG::ForeignKeyViolation: ERROR:  insert or update on table "katello_hostgroup_content_facets" violates foreign key constraint "fk_rails_9cae1dc9a3"
    2021-04-28 11:23:10 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: DETAIL:  Key (content_view_id)=(4) is not present in table "katello_content_views".
    

    or

    2021-04-26 15:06:49 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: Caused by:
    2021-04-26 15:06:49 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: PG::ForeignKeyViolation: ERROR:  insert or update on table "katello_hostgroup_content_facets" violates foreign key constraint "fk_rails_159087f51c"
    2021-04-26 15:06:49 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: DETAIL:  Key (lifecycle_environment_id)=(9) is not present in table "katello_environments".
    

Environment

  • Red Hat Satellite 6.9

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content