Remove "running" WFs from Admin UI (after having killed their jobs)

95 views
Skip to first unread message

ypatios ypatios

unread,
Apr 13, 2020, 10:34:40 AM4/13/20
to Opencast Users
Hello everyone,

let's assume someone is reckless enough to remove some running jobs from the service registry using DELETE service/job/{id}. (Operation:"START_OPERATION"; Type:"org.opencastproject.workflow")
How could they then remove the respective workflow instances in the Admin UI (which still appear with state "running" but are actually hollow)?

Asking for a friend of course.


Thank you,
ypatios

ps: I have tried various api ways that I thought appropriate; I have also cleared and recreated the Admin UI index: neither solved the problem.

Greg Logan

unread,
Apr 15, 2020, 6:21:54 PM4/15/20
to Opencast Users
Hi ypatios,

Have you tried the /workflow/stop REST endpoint?

G

--
To unsubscribe from this group and stop receiving emails from it, send an email to users+un...@opencast.org.

ypatios ypatios

unread,
Apr 16, 2020, 5:14:46 AM4/16/20
to Opencast Users
Hello Greg,

I did, but if I understand correctly, stopping a workflow does the following:
– waits for current running operation to finish
– cancels start of next operation (and thus stops the wf).

So, when I tried this I had no luck as the running operation never finishes.
In the Event Details/Workflows I can see the status Stopped, but the affected operation still appears as running.


Thanks,
ypatios
To unsubscribe from this group and stop receiving emails from it, send an email to us...@opencast.org.

Greg Logan

unread,
Apr 16, 2020, 12:11:11 PM4/16/20
to Opencast Users
Hi ypatios,

Hrm, so the workflow itself is likely stopped, but there are stuck jobs.  If you've got the job ids, can you use DELETE /services/job/{id} endpoint to remove them?  If there are multiple you could also use POST /services/removejobs with the jobIds field.

G

To unsubscribe from this group and stop receiving emails from it, send an email to users+un...@opencast.org.

ypatios ypatios

unread,
Apr 17, 2020, 1:52:56 PM4/17/20
to Opencast Users
Hello Greg,


Hrm, so the workflow itself is likely stopped, but there are stuck jobs.  If you've got the job ids, can you use DELETE /services/job/{id} endpoint to remove them?  If there are multiple you could also use POST /services/removejobs with the jobIds field.


this is exactly that caused the problem in the first place x_D
But your suggestion brought me back to the REST docs where I started trying things out again...
We installed a server update the other day and we had to restart Opencast and we also rebuilt the admin-UI AssetManager index. It seems that that helped, as now the following did work:
DELETE /api/workflows/{workflowInstanceId}

...which did not work when I first tried it (right after the incident).

So, the stuck workflows (stopped but with running operations) are now gone.


Thanks!
ypatios


gregor

unread,
Jun 30, 2021, 4:47:13 PM6/30/21
to Opencast Users, ypa...@gmail.com
Can you please explain in detail how you use the REST DELETE

Greg Logan

unread,
Jul 14, 2021, 5:36:06 PM7/14/21
to Opencast Users
Hi Gregor,

You can use the REST docs.  The specific endpoint in question is https://stable.opencast.org/docs.html?path=/api/workflows#deleteworkflowinstance-2.

G

Reply all
Reply to author
Forward
0 new messages