Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1690917 - foreman_tasks:cleanup leaves orphaned entries in DB when deleting CV publish/promote tasks
Summary: foreman_tasks:cleanup leaves orphaned entries in DB when deleting CV publish/...
Status: NEW
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Tasks Plugin
Version: 6.4
Hardware: x86_64
OS: Linux
high vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Jan Hutař
Depends On:
TreeView+ depends on / blocked
Reported: 2019-03-20 13:14 UTC by Michal Dekan
Modified: 2019-04-03 03:02 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:
Target Upstream Version:

Attachments (Terms of Use)

Description Michal Dekan 2019-03-20 13:14:48 UTC
Description of problem:

CV publish/promotes task gets stuck in running state and therefore its deleted:

foreman-rake foreman_tasks:cleanup TASK_SEARCH="id =  de85f56c-fdde-42c4-9a59-5ad8e763efad" STATES="running,paused,stopped,suspended"

However this leaves entry about the deleted task in table katello_content_view_histories

# su - postgres -c "psql -d foreman -c \"select * from katello_content_view_histories where task_id = 'de85f56c-fdde-42c4-9a59-5ad8e763efad';\""

 id  | katello_content_view_version_id | katello_environment_id |               task_id                | user  |   status    | notes |         created_at         |         updated_at         | action 
 133 |                              56 |                        | de85f56c-fdde-42c4-9a59-5ad8e763efad | admin | in progress |       | 2019-03-20 12:22:03.540997 | 2019-03-20 12:22:03.540997 |      1
(1 row)

This is confusing for the user because its showing deleted task in the Dashboard  Content Views -> In Progress 

When its deleted from the postgres db it also disappears from the Dashboard:

su - postgres -c "psql -d foreman -c \"delete from katello_content_view_histories where task_id = 'de85f56c-fdde-42c4-9a59-5ad8e763efad';\"" 

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


How reproducible: 100%

Actual results:

Deleted CV Promote/Publish with foreman_tasks:cleanup leaves entry in the table katello_content_view_histories which shows entry in dashboard. 

Expected results:

foreman_tasks:cleanup removes entry about deleted task also in table katello_content_view_histories so user does not have info about deleted task in the webui, dashboard.

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