Problem:
I am not able to stop, cancel, nor force cancel stuck tasks in Foreman, mostly stuck sync plans and proxy sync tasks. Therefore I am also not able to publish the contents to Library.
Expected outcome:
Tasks cancelled and Publish tasks successfully executed
Foreman and Proxy versions:
foreman-3.15.0-1.el9.noarch
foreman-proxy-3.15.0-1.el9.noarch
Foreman and Proxy plugin versions:
foreman-3.15.0-1.el9.noarch
foreman-proxy-3.15.0-1.el9.noarch
Distribution and version:
RHEL9 - 5.14.0-611.30.1.el9_7.x86_64
Will provide any output or logs if required.
I have tried to cancel tasks, including force cancel, but they keep ârunningâ or Iâd say they are stuck as the progress is none for days, this started on last Thursday 5th of March 2026.
You donât mentioned the exact states those tasks are in. When using foreman_tasks:cleanup:run make sure to test your filter with NOOP=TRUE before really running it. You donât want to delete the scheduled/planned tasks accidentally.
All those tasks were in running/pending state and not progressing when checked with hammer task progress command
foreman=# select id, label, started_at, state, result from foreman_tasks_tasks where state = ârunningâ;
id | label | started_at | state | result
--------------------------------------±-----------------------------------±------------------------±--------±--------
5c2f4b07-a839-4dff-a9fe-8fffe39eda35 | Actions::Katello::Repository::Sync | 2026-03-06 03:10:15.763 | running | pending
(1 row)
In the whole desperation I eventually found this article:
Even old, from 2017, the procedure worked and I could have stopped all tasks.
I wrote how you can solve it in the current version. That old article is overly complicated and has a high potential to break the whole system. Itâs bad advice for anyone reading this thread. Do not try desperate things. Provide the information I have requested and use the command I told you should use.
As I wrote before, you can clean up tasks with foreman_tasks:cleanup:run. Thatâs how itâs supposed to be done.
Thanks! I only saw your update later, after I managed to fix it. Understood, that could have been dangerous. Should I run into this problem again, I will try to follow the recommended procedure. In the meanwhile I also hope that patched Foreman & Katello might have fixed some of these problems.