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 2245056 - Long running task watching can trigger itself under certain scenarios
Summary: Long running task watching can trigger itself under certain scenarios
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Tasks Plugin
Version: 6.13.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 6.14.0
Assignee: Adam Ruzicka
QA Contact: Pavel Novotny
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-10-19 13:29 UTC by Adam Ruzicka
Modified: 2024-04-09 14:07 UTC (History)
4 users (show)

Fixed In Version: rubygem-foreman-tasks-8.3.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-08 14:20:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 36746 0 Normal Closed Long running task watching should autoskip on errors so that it doesn't get stuck in paused 2023-10-20 12:41:17 UTC
Foreman Issue Tracker 36848 0 Normal Closed Long running task watching can trigger itself under certain scenarios 2023-10-20 12:39:33 UTC
Red Hat Issue Tracker SAT-20883 0 None None None 2023-10-19 13:30:31 UTC
Red Hat Product Errata RHSA-2023:6818 0 None None None 2023-11-08 14:21:14 UTC

Description Adam Ruzicka 2023-10-19 13:29:37 UTC
Description of problem:
Long running task watching can trigger itself under certain scenarios


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


How reproducible:
Always


Steps to Reproduce:
1. Have a long running task (paused or running for more than 2 days)
2. Wait a day


Actual results:
Long running task watching kicks in and tries to email all admin users (and users who opt in for it). It also tries to email internal admin users who don't have email set. This will fail and the task watching task will go into paused state, thus triggering the notification attempt next time the check runs. The same issue can occur if you create an admin user without email.


Expected results:
Internal admin users and users without email set are ignored (delivery to those users is not attempted at all). If the delivery does fail for some reason, the task should go into stopped-error (or warning) so that it gets out of the way and doesn't trigger itself the next time it runs.


Additional info:
Task cleanup seems to be the most reliable way to get out of this circle of broken self-reporting.

Comment 1 Adam Ruzicka 2023-10-19 13:32:07 UTC
Version-Release number of selected component (if applicable) should be 6.14, sorry about that.

Comment 2 Bryan Kearney 2023-10-20 12:02:54 UTC
Upstream bug assigned to aruzicka

Comment 3 Bryan Kearney 2023-10-20 12:02:56 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36848 has been resolved.

Comment 4 Adam Ruzicka 2023-10-20 12:51:10 UTC
Releases containing fixes for this are now available in upstream.
6.15 compatible version is rubygem-foreman-tasks-8.3.1
6.14 compatible version is rubygem-foreman-tasks-8.1.3

Comment 5 Adam Ruzicka 2023-10-23 08:27:48 UTC
There was another issue found and fixed. Releases containing fixes for this are now available in upstream.
6.15 compatible version is rubygem-foreman-tasks-8.3.2
6.14 compatible version is rubygem-foreman-tasks-8.1.4

Comment 7 Pavel Novotny 2023-10-25 18:10:34 UTC
Verified in Satellite 6.14 snap 21:
rubygem-foreman-tasks-8.1.4-1.el8sat.noarch
satellite-6.14.0-3.el8sat.noarch

Verified according to reproducer from comment 0.

Tested with 2 groups of users:

Group 1 - users that should receive email notifications:

- admin user with Email Address set & Mail Enabled checked
- user with Org. admin role with Email Address set & Mail Enabled checked
- user without Org. admin role with Email Address set & Mail Enabled checked & subscribed to 'Long running tasks'

This group received email notification about any long running task.
The task 'Check for long running tasks' finished with success.


Group 2 - user matrix that should not receive email notifications:

_____________________	| admin user	| Org. admin role user	| regular user	|
blank email *1)		|	x	|	x		|	x	|
email disabled *2)	|	x	|	x		|	x	|
user disabled *3)	|	x	|	x		|	x	|

*1) Mail Enabled checked
*2) Email Address set
*3) Email Address set & Mail Enabled checked

With this group of users, neither of them received email about long running tasks.
The task 'Check for long running tasks' finished also with success and didn't remain stuck in paused state.

Comment 9 errata-xmlrpc 2023-11-08 14:20:21 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 (Important: Satellite 6.14 security and bug fix update), 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-2023:6818


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