- Red Hat Satellite 6.5
Not able to delete recurring logics on Red Hat Satellite 6.5:
[firstname.lastname@example.org ~]# foreman-rake console Loading production environment (Rails 5.2.1) irb(main):001:0> ForemanTasks::RecurringLogic.where(state: "cancelled").destroy_all Traceback (most recent call last): 2: from lib/tasks/console.rake:5:in `block in <top (required)>' 1: from (irb):1 ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR: column katello_sync_plans.recurring_logic_id does not exist) LINE 1: ...llo_sync_plans".* FROM "katello_sync_plans" WHERE "katello_s... ^ : SELECT "katello_sync_plans".* FROM "katello_sync_plans" WHERE "katello_sync_plans"."recurring_logic_id" = $1 LIMIT $2 irb(main):002:0>
This is a known behavior which is filed in Bug.
To apply the patch on Red Hat Satellite 6.5, please first take a snapshot of the machine.
Go to the following location:
[email@example.com ~]# cd /opt/theforeman/tfm/root/usr/share/gems/gems/katello-126.96.36.199 (Depending on the version of Red Hat Satellite 6.5.0/6.5.1 the katello version might change)
Download the patch
recurring_logic.txtattached with this article to the path mentioned above.
Initialize git so that it is easy to revert any changes:
[firstname.lastname@example.org ~]# git init .; git add .; git commit -m "Original State"
Apply the patch:
[email@example.com ~]# patch -p1 < recurring_logic.txt
[firstname.lastname@example.org ~]# foreman-maintain service restart
Try deleting the recurring logics:
[email@example.com ~]# foreman-rake console >ForemanTasks::RecurringLogic.where(state: "cancelled").destroy_all
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.