Bug 1895324

Summary: hammer task resume has broken.
Product: Red Hat Satellite Reporter: Suraj Patil <supatil>
Component: Tasks PluginAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: aruzicka, egolov, jpathan, mmccune, pcreech, ssainkar
Target Milestone: 6.9.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman-tasks-3.0.3 Doc Type: Known Issue
Doc Text:
The `hammer task resume` command does not resume all paused tasks and produces the following error: "Please provide at least one of the search or task_ids parameters in the request."
Story Points: ---
Clone Of:
: 1934406 (view as bug list) Environment:
Last Closed: 2021-04-21 13:18:52 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:
Bug Depends On:    
Bug Blocks: 1934406    

Description Suraj Patil 2020-11-06 10:48:36 UTC
Description of problem:
# hammer task resume command is not resuming all paused tasks as before.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[root@satellite ~]# hammer task --help 
Usage:
    hammer task [OPTIONS] SUBCOMMAND [ARG] ...

Parameters:
 SUBCOMMAND                    Subcommand
 [ARG] ...                     Subcommand arguments

Subcommands:
 info                          Show task details
 list                          List tasks
 progress                      Show the progress of the task
 resume                        Resume all tasks paused in error state   <<=======
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Currently command is raising the error - "Please provide at least one of search or task_ids parameters in the request". 


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


Actual results:
[root@satellite ~]# hammer task resume
400 Bad Request
  Please provide at least one of search or task_ids parameters in the request

Expected results:
Try to resume all the paused tasks without the need of providing task_ids as before. 

Additional info:

This issue seems to happen due to removal of scope search in below commit. 

https://github.com/theforeman/foreman-tasks/pull/516/files#diff-d5548a710d9ec9031997c62d4520fe761970aaa226d123b05af0a9949ab2e4dfL96

Comment 1 Adam Ruzicka 2020-11-06 11:44:04 UTC
Until this gets gixed, the workaround is to run hammer task resume --search ""

Comment 3 Jameer Pathan 2021-02-17 06:31:04 UTC
Verified

Verified with:
- Satellite 6.9.0 snap 13

Test steps:
- Publish a content view and cancel the task to create a paused task.
- Run "hammer task resume"

Observations:
- Task resumed and completed successfully.

hammer> task resume
Total tasks found paused in error state: 1
Total tasks resumed:                     1
Resumed tasks:                           
 1) Task identifier: 9bab2b65-7a32-479f-be26-e5b31611d7c0
    Task action:     Publish
    Task errors:     Task canceled, Task canceled, Task canceled, Task canceled, Task canceled, Task canceled
Total tasks failed to resume:            0
Failed tasks:                            

Total tasks skipped:                     0
Skipped tasks:

Comment 6 errata-xmlrpc 2021-04-21 13:18:52 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 (Moderate: Satellite 6.9 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-2021:1313