Bug 1729048 - Removing recurring logic fails with `katello_sync_plans.recurring_logic_id does not exist`
Summary: Removing recurring logic fails with `katello_sync_plans.recurring_logic_id do...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Sync Plans
Version: 6.5.0
Hardware: All
OS: All
unspecified
high vote
Target Milestone: 6.6.0
Assignee: Ivan Necas
QA Contact: Stephen Wadeley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-11 09:42 UTC by Anand Agrawal
Modified: 2019-10-22 19:51 UTC (History)
4 users (show)

Fixed In Version: tfm-rubygem-katello-3.12.0-1
Doc Type: If docs needed, set a value
Doc Text:
Deleting Sync Plans may result in an error. This will not effect existing Sync Plans but may be unable to be deleted with 6.6 Beta.
Clone Of:
Environment:
Last Closed: 2019-10-22 19:51:20 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 26028 Normal Closed Removing recurring logic fails with `katello_sync_plans.recurring_logic_id does not exist` 2020-02-24 12:43:19 UTC
Red Hat Knowledge Base (Solution) 4279961 None None None 2019-10-15 01:12:16 UTC

Description Anand Agrawal 2019-07-11 09:42:43 UTC
Description of problem:

# in foreman-rake console
> rl = ForemanTasks::RecurringLogic.last
> rl.destroy

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

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

How reproducible:
Always

Steps to Reproduce:
1. Create a sync plan
2. From the Monitor -> recurring logic, you will be able to see the created sync plan
3. Cancel this recurring logic.
3. Now try to delete this "cancelled" recurring logic

# foreman-rake console
ForemanTasks::RecurringLogic.where(state: "cancelled").destroy_all



Actual results:
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>

Expected results:

Delete the "cancelled" recurring logic

Additional info:

There is an upstream bug already fixed for the same issue. I have tried the patch and it works with no issue

https://projects.theforeman.org/issues/26028

Comment 3 Bryan Kearney 2019-07-12 16:04:27 UTC
Upstream bug assigned to inecas@redhat.com

Comment 4 Bryan Kearney 2019-07-12 16:04:28 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/26028 has been resolved.

Comment 6 Bryan Kearney 2019-10-22 19:51:20 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.