-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
6.14.z, 6.15.z, 6.16.z, 6.17.0
-
3
-
False
-
Moderate
-
sat-rocket
-
None
-
None
-
None
-
No Coverage
When running satellite-maintain health check or upgrade check , it may not always detect the paused tasks on the system.
As per https://github.com/theforeman/foreman_maintain/blob/master/definitions/features/foreman_tasks.rb#L66-L76 , the only time it will detect the paused tasks, if the task state is paused and result is error. If the task result is warning, then also, satellite-maintain can say that no paused tasks found.
How Reproducible:
100%
Steps to reproduce:
- install a satellite 6.16
- Run some REX jobs and note down the task id
- Get into foreman-database , and update the state of the task to paused and result to warning
- try "satellite-maintain health check" on another terminal
- For the same task, update the result to error
- Retry "satellite-maintain health check" on the other terminal
Actual Results:
Step 3:
foreman=# select id,type,label,state,result from foreman_tasks_tasks where id = '86586169-5878-44d3-97fb-8b3ee1be801e';
id | type | label | state | result
--------------------------------------+---------------------------------+--------------------------------------+--------+---------
86586169-5878-44d3-97fb-8b3ee1be801e | ForemanTasks::Task::DynflowTask | Actions::RemoteExecution::RunHostJob | paused | warning
(1 row)
Step 4:
# satellite-maintain health check Running preparation steps required to run the next scenarios ================================================================================ Check whether all services are running: [OK] -------------------------------------------------------------------------------- Running ForemanMaintain::Scenario::FilteredScenario ================================================================================ Clean old Kernel and initramfs files from tftp-boot: [OK] -------------------------------------------------------------------------------- Continue with step [Remove the files]?, [y(yes), n(no)] no Check number of fact names in database: [OK] -------------------------------------------------------------------------------- Check for verifying syntax for ISP DHCP configurations: [OK] -------------------------------------------------------------------------------- Check whether all services are running: [OK] -------------------------------------------------------------------------------- Check whether all services are running using the ping call: [OK] -------------------------------------------------------------------------------- Check for paused tasks: [OK] -------------------------------------------------------------------------------- Check whether system is self-registered or not: [OK] --------------------------------------------------------------------------------
Step 5:
foreman=# select id,type,label,state,result from foreman_tasks_tasks where id = '86586169-5878-44d3-97fb-8b3ee1be801e';
id | type | label | state | result
--------------------------------------+---------------------------------+--------------------------------------+--------+--------
86586169-5878-44d3-97fb-8b3ee1be801e | ForemanTasks::Task::DynflowTask | Actions::RemoteExecution::RunHostJob | paused | error
(1 row)
Step 6:
# satellite-maintain health check Running preparation steps required to run the next scenarios ================================================================================ Check whether all services are running: [OK] -------------------------------------------------------------------------------- Running ForemanMaintain::Scenario::FilteredScenario ================================================================================ Clean old Kernel and initramfs files from tftp-boot: [OK] -------------------------------------------------------------------------------- Continue with step [Remove the files]?, [y(yes), n(no)] n Check number of fact names in database: [OK] -------------------------------------------------------------------------------- Check for verifying syntax for ISP DHCP configurations: [OK] -------------------------------------------------------------------------------- Check whether all services are running: [OK] -------------------------------------------------------------------------------- Check whether all services are running using the ping call: [OK] -------------------------------------------------------------------------------- Check for paused tasks: [FAIL] There are currently 1 paused tasks in the system -------------------------------------------------------------------------------- There are multiple steps to proceed: 1) Resume paused tasks 2) Delete paused tasks 3) Investigate the tasks via UI Select step to continue, [n(next)]
Expected Results:
Whether the result is an error or warning or anything else, If the task state is paused, satellite-maintain should be able to detect it.
When we query the REST API i.e. https://satellite-fqdn/foreman_tasks/api/tasks?search=state=paused , we would be able to see it and hence satellite-maintain also be able to detect it.
If that is not expected to happen, then we should let end-users know, what is expected from satellite-maintain from the paused tasks check.
Additional Info:
It used to work as expected before https://projects.theforeman.org/issues/28479 was fixed via https://github.com/theforeman/foreman_maintain/pull/304
Not sure, why we needed to extend that query to include the result=error part but I am sure there's some valid explanations present.