reanahub / reana-client

REANA command-line client
http://reana-client.readthedocs.io/
MIT License
10 stars 46 forks source link

cli: trying to stop jobs that didn't start result in an error #300

Closed okraskaj closed 3 years ago

okraskaj commented 5 years ago
$ reana-client stop --force -w helloworld.serial.2

Workflow could not be stopped:
(404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Date': 'Tue, 25 Jun 2019 13:28:57 GMT', 'Content-Length': '262'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"jobs.batch \"6d37ccb1-0a71-4e95-b579-fff0126e8229\" not found","reason":"NotFound","details":{"name":"6d37ccb1-0a71-4e95-b579-fff0126e8229","group":"batch","kind":"jobs"},"code":404}

It fails in reana-job-controller because there is no job to be deleted.

$ kubectl get pods

batch-serial-c2fcf669-1f71-4cd0-8bed-7ab8bacd87a3-sktt8   2/2     Running   0          32m
db-6d845f7ff9-2kmn6                                       1/1     Running   0          62m
job-controller-fff79fd56-w52x7                            1/1     Running   0          63m
message-broker-5bf98cc4f9-tr72n                           1/1     Running   0          63m
server-66f4d75c47-x8llq                                   2/2     Running   0          63m
wdb-cc658b4c7-99jrc                                       1/1     Running   0          62m
workflow-controller-67cb7b98b6-q4lkd                      2/2     Running   0

We should just delete everything connected with job regardless of what is running and what is not.

diegodelemos commented 5 years ago

It is worth noting that the referenced job -> `6d37ccb1-0a71-4e95-b579-fff0126e8229 didn't exist because during development there was an exception before submitting the POST call to Kubernetes API.

But in any case, since this could happen, that a job(s) associated with the workflow, for some reason, don't get created, stop should give a user understandable error and stop --force should just work.

diegodelemos commented 3 years ago

Duplicate of https://github.com/reanahub/reana-client/issues/360.