Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1473606 - Cancelled delayed plans are not picked up by cleaner rake task when using AFTER
Summary: Cancelled delayed plans are not picked up by cleaner rake task when using AFTER
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Tasks Plugin
Version: 6.2.9
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-21 09:37 UTC by Adam Ruzicka
Modified: 2018-09-04 17:45 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-04 17:45:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 20375 0 None None None 2017-07-21 09:42:17 UTC

Description Adam Ruzicka 2017-07-21 09:37:34 UTC
Description of problem:
When trying to remove cancelled delayed plans using the foreman_tasks:cleanup AFTER=$AFTER, it will skip those plans because they don't have started_at field set.

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


How reproducible:
Always

Steps to Reproduce:
1. Schedule remote execution job to be executed in the future
2. Go to its task and click cancel
3. Observe task flipping over to stopped-error
5. Run foreman-rake foreman_tasks:cleanup AFTER='10s'

Actual results:
The task remains there

Expected results:
The task is deleted

Additional info:


Workaround: 
Modify your cleanup cronjob/script to look like this

AFTER='30d' # Set desired time interval here

# Run your normal cleanup here
# foreman-rake foreman_tasks:cleanup AFTER=$AFTER ...

# Let the cleanup task compute the right cutoff date
TIMESTAMP="$(foreman-rake foreman_tasks:cleanup TASK_SEARCH='label != a_label' NOOP=true AFTER="$AFTER" | grep 'all tasks matching' | grep -P -o "\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d" | tail -n1)"

# Remove the broken leftovers
foreman-rake foreman_tasks:cleanup TASK_SEARCH="null? started_at AND ended_at < \"$TIMESTAMP\""

Comment 1 Adam Ruzicka 2017-07-21 09:42:16 UTC
Created redmine issue http://projects.theforeman.org/issues/20375 from this bug

Comment 3 Bryan Kearney 2018-09-04 17:45:07 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.


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