[BUG] cancelling a task results in No Such Task error
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:
- Start a task that runs long enough to cancel
- Try to cancel it with the CLI
- 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.
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.
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.
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
In which version can we see this fix?
The fix in 7a304474ee18 would have been included in v8.6.1 and onward.