Bug 1745573 - Upgrade is failing on use whitelist "foreman-docker-remove-foreman-docker"
Summary: Upgrade is failing on use whitelist "foreman-docker-remove-foreman-docker"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Upgrades
Version: 6.6.0
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: 6.6.0
Assignee: Lukas Zapletal
QA Contact: Nikhil Kathole
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-26 11:48 UTC by Ganesh Payelkar
Modified: 2019-10-22 19:49 UTC (History)
4 users (show)

Fixed In Version: tfm-rubygem-foreman_docker-5.0.0.1-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-22 19:49:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 27814 0 Normal Closed Upgrade is failing on use whitelist "foreman-docker-remove-foreman-docker" 2021-01-21 12:31:46 UTC

Description Ganesh Payelkar 2019-08-26 11:48:53 UTC
Description of problem:

Trying to upgrade satellite 6.5 to 6.6 Beta 

The upgrade is failing on use whitelist "foreman-docker-remove-foreman-docker"


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

# rpm -qa satellite 
satellite-6.6.0-5.beta.el7sat.noarch


How reproducible:

While upgrade 

Steps to Reproduce:

# shopt -s checkhash
# hash -d foreman-maintain 2> /dev/null
# subscription-manager refresh
# subscription-manager repos --enable rhel-7-server-satellite-maintenance-6-beta-rpms --enable rhel-7-server-ansible-2.8-rpms
# yum install rubygem-foreman_maintain -y
# export FOREMAN_MAINTAIN_USE_BETA='1'
# foreman-maintain upgrade list-versions
# foreman-maintain upgrade check --target-version 6.6
# foreman-maintain upgrade run --target-version 6.6

Actual results:

Cleaning data...
... deleting records from taxable_taxonomies
... deleting filters
... deleting permissions
... deleting docker compute resources
--------------------------------------------------------------------------------
Scenario [Procedures after migrating to Satellite 6.6] failed.

The following steps ended up in failing state:

  [foreman-docker-remove-foreman-docker]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="foreman-docker-remove-foreman-docker"


Expected results:

The upgrade should be completed successfully

Additional info:

ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR:  update or delete on table "compute_resources" violates foreign key constraint "fk_rails_61ca956e9a" on table "hostgroups"
DETAIL:  Key (id)=(1) is still referenced from table "hostgroups".
: DELETE FROM "compute_resources" WHERE "compute_resources"."id" = $1


Caused by:
PG::ForeignKeyViolation: ERROR:  update or delete on table "compute_resources" violates foreign key constraint "fk_rails_61ca956e9a" on table "hostgroups"
DETAIL:  Key (id)=(1) is still referenced from table "hostgroups".

Comment 3 Marek Hulan 2019-09-10 15:17:34 UTC
Created redmine issue https://projects.theforeman.org/issues/27814 from this bug

Comment 6 Marek Hulan 2019-09-17 15:02:56 UTC
The second PR was added that ehances the fix for more resources that could potentially be preventing the upgrade. There's very little chance users would hit it, but it would make the upgrade more robust. Given it hasn't been tested yet, Nikhil, should we try to push that fix to next snap or do you prefer to keep the version we have right now and rather not touching it?

Comment 7 Nikhil Kathole 2019-09-17 15:08:36 UTC
Hi Marek,

I am ok with having second PR in next snap, and collectively test them out next week, if that would help us to make it more robust.

Thanks.

Comment 8 Nikhil Kathole 2019-09-26 11:34:09 UTC
VERIFIED

Version tested:
Satellite 6.6.0 snap 22

Able to reproduce the issue with following steps while upgrading to beta

On 6.5,
1. Create docker compute resource
2. Create hostgroup associated with compute resorce
3. perform upgrade

Upgrade Step 10/10: katello:upgrades:3.12:remove_pulp2_notifier. foreman-rake upgrade:run finished successfully!
Upgrade completed!
                                      [OK]
--------------------------------------------------------------------------------
Running Procedures after migrating to Satellite 6.6
================================================================================
Drop foreman_docker plugin:                                           [FAIL]
Failed executing foreman-rake foreman_docker:cleanup, exit status 1:
 rake aborted!
ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR:  update or delete on table "compute_resources" violates foreign key constraint "fk_rails_61ca956e9a" on table "hostgroups"
DETAIL:  Key (id)=(1) is still referenced from table "hostgroups".
: DELETE FROM "compute_resources" WHERE "compute_resources"."id" = $1
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:603:in `async_exec'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:603:in `block (2 levels) in exec_no_cache'


Followed same steps and performed from 6.5 to 6.6 snap 22, upgrade completed successfully.

Upgrade completed!
Package versions are being locked.
                                      [OK]
--------------------------------------------------------------------------------

Running Procedures after migrating to Satellite 6.6
================================================================================
Drop foreman_docker plugin: 
==================================================================================================================================================
 Package                           Arch          Version                 Repository                                                          Size
==================================================================================================================================================
Removing:
 tfm-rubygem-foreman_docker        noarch        5.0.0.1-1.el7sat        @Sat6-CI_Red_Hat_Satellite_6_6_Composes_Satellite_6_6_RHEL7        391 k

Transaction Summary
==================================================================================================================================================
Remove  1 Package

Installed size: 391 k
Warning: RPMDB altered outside of yum.

Removed:
  tfm-rubygem-foreman_docker.noarch 0:5.0.0.1-1.el7sat                                                                                            
                                     [OK]
--------------------------------------------------------------------------------
Regenerate Apipie cache:                                              [OK]
--------------------------------------------------------------------------------
Start applicable services:

Comment 9 Bryan Kearney 2019-10-22 19:49: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/RHSA-2019:3172


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