Bug 2164330

Summary: new wait task introduced by rh_cloud 6.0.44 is not recognized by maintain as OK to interrupt
Product: Red Hat Satellite Reporter: Evgeni Golov <egolov>
Component: Satellite MaintainAssignee: Evgeni Golov <egolov>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.12.1CC: bbuckingham, lpramuk, zhunting
Target Milestone: 6.13.0Keywords: AutomationBlocker, Regression, Triaged, Upgrades
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_maintain-1.2.4-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2176272 (view as bug list) Environment:
Last Closed: 2023-05-03 13:24:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Evgeni Golov 2023-01-25 08:55:41 UTC
Description of problem:
foreman_rh_cloud 6.0.44 introduced a new action in https://github.com/theforeman/foreman_rh_cloud/commit/8c38ff76b38f146baea755bc85d333da09d0c327: ForemanInventoryUpload::Async::DelayAction

This is a long-running action that is there to delay "the real" task.

However, this action is not part of the EXCLUDE_ACTIONS_FOR_RUNNING_TASKS (https://github.com/theforeman/foreman_maintain/blob/9d5f5c9315e71d08451d51fb2d41dc0f735bdfc9/definitions/features/foreman_tasks.rb#L16) list in foreman maintain, which means that when it's "running" (well, waiting, really), the "running tasks" check of foreman maintain will fail:

# satellite-maintain upgrade check --target-version 6.13
…
Check for running tasks:                                              [FAIL]
There are 1 active task(s) in the system.
Please wait for these to complete or cancel them from the Monitor tab.


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

How reproducible:
100%


Steps to Reproduce:
1. have a satellite system with rh_cloud 6.0.44+
2. check on the tasks page that "Wait and Generate all reports job" is running
3. satellite-maintain upgrade check --target-version 6.13

Actual results:
check fails

Expected results:
check suceeds as it's perfectly fine to perform maintenance when this waiting job is running

Additional info:

Comment 1 Evgeni Golov 2023-01-25 09:05:21 UTC
Created redmine issue https://projects.theforeman.org/issues/35992 from this bug

Comment 2 Evgeni Golov 2023-01-25 09:23:51 UTC
This obviously also applies to foreman-maintain 1.1.x when doing 6.12.z upgrades or executing the check in some other context.

Comment 3 Bryan Kearney 2023-01-25 12:03:15 UTC
Upstream bug assigned to egolov

Comment 4 Bryan Kearney 2023-01-25 12:03:17 UTC
Upstream bug assigned to egolov

Comment 5 Bryan Kearney 2023-01-25 20:03:23 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35992 has been resolved.

Comment 6 Lukas Pramuk 2023-02-03 12:52:01 UTC
VERIFIED.

@Satellite 6.13.0 Snap 9
rubygem-foreman_maintain-1.2.4-1.el8sat.noarch

by the upgrade automation running 6.12.1 -> 6.13.0 upgrade

# foreman-maintain upgrade check --plaintext --whitelist="repositories-validate" --target-version 6.13 -y
...

--------------------------------------------------------------------------------
Check for running tasks:                                              [OK]
--------------------------------------------------------------------------------
Check for old tasks in paused/stopped state:                          [OK]
--------------------------------------------------------------------------------
Check for pending tasks which are safe to delete:                     [OK]
--------------------------------------------------------------------------------
Check for tasks in planning state:                                    [OK]
--------------------------------------------------------------------------------
...

>>> there are now no running tasks reported so the upgrade can proceed

Comment 10 errata-xmlrpc 2023-05-03 13:24:53 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.13 Release), 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:2097