Unable to end task in Katello

I am trying to cancel a Repo Sync task in Katello 3.7, however I am unable to. I tried through the tasks windows and through the dynaflow console, but still no luck. Any suggestions?

Just copy pasting what I found. If your tasks is paused, modify the state in the query.

foreman-rake foreman_tasks:cleanup TASK_SEARCH='label = Actions::Katello::Repository::Sync' STATES='running' VERBOSE=true

I already used this following command, but it looks like it was not recommended :sweat:

foreman-rake console
ForemanTasks::Task.where(:label => "Actions::Katello::Repository::Sync", :state => "paused").map { |task| task.update_column(:state, "stopped") }

After, it seems to be safe to run

foreman-rake katello:reimport

(it was reindex in previous version, I think)

That worked. Thank you for your help!