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".
Created redmine issue https://projects.theforeman.org/issues/27814 from this bug
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?
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.
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:
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