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 1431107 - it is hard (or there is no way at all) to cancel pending tasks from old remote execution job
Summary: it is hard (or there is no way at all) to cancel pending tasks from old remot...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Remote Execution
Version: 6.2.8
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: Adam Ruzicka
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard: scale_lab
: 1422466 (view as bug list)
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
 
Reported: 2017-03-10 12:12 UTC by Jan Hutař
Modified: 2021-06-10 12:02 UTC (History)
10 users (show)

Fixed In Version: tfm-rubygem-foreman_remote_execution-1.3.4
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:43:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 19937 0 Normal Closed it is hard (or there is no way at all) to cancel pending tasks from old remote execution job 2021-02-10 17:10:01 UTC
Red Hat Bugzilla 1465521 0 medium CLOSED [RFE] API to cancel/delete Remote Execution tasks before their scheduled time 2021-12-10 15:15:47 UTC
Red Hat Bugzilla 1503037 0 low CLOSED [RFE] Cancelled future/recurring job invocations should not get the status "failed" but rather "cancelled" 2021-02-22 00:41:40 UTC

Internal Links: 1465521 1503037

Description Jan Hutař 2017-03-10 12:12:27 UTC
Description of problem:
It is hard (or there is no way at all) to cancel pending tasks from old remote execution job.


Version-Release number of selected component (if applicable):
satellite-6.2.8-4.0.el7sat.noarch


How reproducible:
always


Steps to Reproduce:
1. Have clients managed by capsule
2. Start ReX job on the clients and white (some of) them are in pending,
   stop capsule
3. Now lets say we have just removed that capsule for good so we want to
   finish all the pending tasks from Satellite


Actual results:
You have to go to job -> Job Task -> Sub tasks, select one by one and click "Cancel". I have not found anything in Hammer or in API. Master task have "Cancel" button inactive. Dynflow console does not have "cancel" or "skip" links.


Expected results:
There should be a way (ideally in all webUI, API and hammer) to cancel tasks of a given job (you can say this via task search query "parent_task_id = ...").


Additional info:
This is error I see in the child task before clicking "Cancel":

Error loading data from Capsule: RestClient::ResourceNotFound - 404 Resource Not Found

When I click "Cancel", this appears and after some time 3 more messages appears and then finally child task is completed:

Initialization error: RestClient::InternalServerError - 500 Internal Server Error

Comment 5 Adam Ruzicka 2017-06-06 11:00:35 UTC
Created redmine issue http://projects.theforeman.org/issues/19937 from this bug

Comment 6 Satellite Program 2017-07-13 14:15:32 UTC
Upstream bug assigned to aruzicka

Comment 7 Satellite Program 2017-07-13 14:15:36 UTC
Upstream bug assigned to aruzicka

Comment 8 Satellite Program 2017-08-03 16:15:10 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/19937 has been resolved.

Comment 9 Ivan Necas 2017-09-14 08:16:29 UTC
*** Bug 1422466 has been marked as a duplicate of this bug. ***

Comment 10 Lukáš Hellebrandt 2017-12-19 14:04:22 UTC
I would expect the subcommands Cancel and Abort in 'hammer job-invocation' but they are not there, tested with snap 29:

# hammer job-invocation --help
Usage:
    hammer job-invocation [OPTIONS] SUBCOMMAND [ARG] ...

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

Subcommands:
 create                        Create a job invocation
 info                          Show job invocation
 list                          List job invocations
 output                        View the output for a host

Options:
 -h, --help                    print help

# hammer --version
hammer (0.11.0.1)
 * hammer_cli_csv (unknown version)
 * hammer_cli_foreman (0.11.0.5)
 * hammer_cli_foreman_admin (0.0.7)
 * hammer_cli_foreman_bootdisk (0.1.3.3)
 * hammer_cli_foreman_discovery (1.0.0)
 * hammer_cli_foreman_docker (unknown version)
 * hammer_cli_foreman_openscap (unknown version)
 * hammer_cli_foreman_remote_execution (unknown version)
 * hammer_cli_foreman_tasks (unknown version)
 * hammer_cli_foreman_virt_who_configure (unknown version)
 * hammer_cli_katello (0.11.3.4)

Comment 11 Adam Ruzicka 2018-01-02 11:18:33 UTC
This bug wasn't about being or not being able to do hammer job-invocation cancel --id $id. That is covered in another BZ[1].

This BZ was about how under certain conditions a REX job could get stuck in pending and clicking the cancel button would do nothing. The fix for this BZ addresses this situation and makes the cancel button work even in that case.

I'm moving this to ON_QA once more. Please take a look at it again.

[1] - https://bugzilla.redhat.com/show_bug.cgi?id=1465521

Comment 12 Lukáš Hellebrandt 2018-01-02 12:51:40 UTC
In that case, I am verifying that the Cancel button actually cancels the pending jobs. Note that is something different than what is proposed in OP. Used Sat6.3 snap 29.

Used reproducer from OP. Cancelling the job takes some time (~minute) but works.

Comment 13 Bryan Kearney 2018-02-21 16:40:56 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, 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-2018:0336

Comment 14 Bryan Kearney 2018-02-21 16:43:38 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, 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-2018:0336

Comment 15 Satellite Program 2018-02-21 16:54:37 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, 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-2018:0336


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