Problem: katello upgrade from 3.12 to 3.13 is failing at the step “Upgrade Step: migrate_foreman…”. I’m following Foreman :: Plugin Manuals for doing the upgrade.
Expected outcome:
Upgrade from katello-3.12 to katello-3.13 and foreman-1.22 to foreman-1.23
Foreman and Proxy versions:
Foreman and Proxy plugin versions:
Distribution and version:
Other relevant data:
When i run “foreman-installer --scenario katello --upgrade”, it fails at the below step throwing the below error
Upgrade Step: migrate_foreman…
[ INFO 2019-10-25T09:53:22 verbose] Upgrade Step: migrate_foreman…
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::ForeignKeyViolation: ERROR: insert or update on table “foreman_tasks_tasks” violates foreign key constraint “fk_rails_a56904dd86”
DETAIL: Key (user_id)=(5) is not present in table “users”.
: UPDATE “foreman_tasks_tasks” SET “user_id” = 5 WHERE “foreman_tasks_tasks”.“id” IN (SELECT “foreman_tasks_tasks”.“id” FROM “foreman_tasks_tasks” INNER JOIN “foreman_tasks_locks” ON “foreman_tasks_locks”.“task_id” = “foreman_tasks_tasks”.“id” WHERE “foreman_tasks_tasks”.“id” IN (SELECT “foreman_tasks_locks”.“task_id” FROM “foreman_tasks_locks” WHERE “foreman_tasks_locks”.“name” = $1 AND “foreman_tasks_locks”.“resource_id” = $2))
.
.
.
.
Caused by:
PG::ForeignKeyViolation: ERROR: insert or update on table “foreman_tasks_tasks” violates foreign key constraint “fk_rails_a56904dd86”
DETAIL: Key (user_id)=(5) is not present in table “users”.
.
.
.
.
== 20180927120509 AddUserId: migrating ========================================
– add_reference(:foreman_tasks_tasks, :user, {:type=>:integer, :foreign_key=>true})
-> 0.0116s
foreman-rake db:migrate failed! Check the output for error!