shield icon indicating copy to clipboard operation
shield copied to clipboard

[BUG] cancelling a task results in No Such Task error

Open thomasmitchell opened this issue 6 years ago • 5 comments

Describe the bug Using the CLI, attempting to cancel a task results in no such task, even though putting in the UUID can return you information about the task itself.

$ shield --core my-core --tenant Ops cancel 25550307-ad4a-4b55-bedd-b9886683a40b
Owner:        tmitchell@local
Type:         backup
Status:       running

Started at:   2019-11-12 17:28:36+0000
Stopped at:   (running)

Job:          Daily (5862679a-a6f6-4cba-89da-a725ba5a81f5)
Archive UUID: 10dbe967-8355-460d-a80e-406c3f9debff
Cancel this task? [y/N] y
!!! No such task

To Reproduce Steps to reproduce the behavior:

  1. Start a task that runs long enough to cancel
  2. Try to cancel it with the CLI
  3. See error

Expected behavior It should have cancelled the task

Screenshots If applicable, add screenshots to help explain your problem.

SHIELD versions (please complete the following information):

  • SHIELD Core: 8.5.0
  • SHIELD CLI: 8.5.0

Browser version(s) (please complete if reporting a web UI bug):

  • OS: [e.g. OSX, windows]
  • Browser: [e.g. firefox, chrome, safari]
  • Version: [e.g. 22]

Additional context Add any other context about the problem here.

The task is not cancelled following the command, so the error is not just a mishandled check afterward.

thomasmitchell avatar Nov 13 '19 02:11 thomasmitchell

It appears to be broken in the 8.5.0 CLI. I can't look up a task by its UUID at all on this version.

Request:
GET /v2/tasks/25550307-ad4a-4b55-bedd-b9886683a40b HTTP/1.1
Host: THERE
Accept: application/json
X-Shield-Session: REDACTED


---------------------------
Response:
HTTP/1.1 404 Not Found
Connection: close
Content-Length: 25
Content-Type: application/json
Date: Wed, 13 Nov 2019 03:05:59 GMT
Server: nginx

{"error":"No such task"}

Even though that UUID was fetched from the list of UUIDs by the CLI by providing a substring of it.

thomasmitchell avatar Nov 13 '19 03:11 thomasmitchell

Having talked with James out of band, its likely that this was caused by not providing the --tenant flag on the command line to look at the task. The task can be listed without the flag, but not actually looked up individually.

thomasmitchell avatar Nov 14 '19 03:11 thomasmitchell

Tried this again today with the --tenant flag properly given, and it still gives No Such Task.

trace shows

DELETE /v2/tenants/ACTUAL-TENANT-ID/tasks/ACTUAL-TASK-ID b HTTP/1.1

thomasmitchell avatar Nov 25 '19 21:11 thomasmitchell

In which version can we see this fix?

mordax7 avatar Mar 23 '20 12:03 mordax7

The fix in 7a304474ee18 would have been included in v8.6.1 and onward.

jhunt avatar Mar 27 '20 13:03 jhunt