Foreman-rake katello:upgrade_check: FAIL - there are 1 active tasks

Problem:
I am trying to upgrade to Foreman 3.12/Katello 4.14. using the following documentation:
https://docs.theforeman.org/3.12/Upgrading_Project/index-katello.html#Upgrading_foreman_upgrading-connected

When running the command foreman-rake katello:upgrade_check, I am getting the following error:

# foreman-rake katello:upgrade_check
This script makes no modifications and can be re-run multiple times for the most up to date results.
Checking upgradeability...

Checking for running tasks...
[FAIL] - There are 1 active tasks. 
         Please wait for these to complete or cancel them from the Monitor tab.

But there are not active tasks.
How can I stop the active task, when there is no active task?

$ psql foreman
psql (13.16)
Type "help" for help.

foreman=# select label, state, result from foreman_tasks_tasks where state != 'stopped';
                    label                     |   state   | result  
----------------------------------------------+-----------+---------
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::CheckLongRunningTasks               | scheduled | pending
 Actions::Katello::ContentView::Publish       | paused    | error
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 CreateExpiredManifestNotifications           | scheduled | pending
 CreateRssNotifications                       | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 CreateManifestExpireSoonWarningNotifications | scheduled | pending
 StoredValuesCleanupJob                       | scheduled | pending
 SendExpireSoonNotifications                  | scheduled | pending
 CreatePulpDiskSpaceNotifications             | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 CreateHostLifecycleExpireSoonNotifications   | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
 Actions::Katello::SyncPlan::Run              | scheduled | pending
(30 rows)

Expected outcome:
upgrade_check should not fail but confirm ok.
Or tell the real reason for the error.

Foreman and Proxy versions:
Foreman 3.11

Foreman and Proxy plugin versions:

Name Version
foreman-tasks 9.1.1
foreman_ansible 14.0.0
foreman_remote_execution 13.1.0
katello 4.13.1

Distribution and version:
Alma Linux 9 (latest)

Other relevant data:
Tried the following mitigation with no success: foreman-rake katello:reimport

After getting rid of the following task in “Paused”/“Error” state:

 Actions::Katello::ContentView::Publish       | paused    | error

, the upgrade_check returned with a SUCCESS status.

Which leads to the following questions:

  • Why can’t the upgrade_check return with a SUCCESS status, when the task is in “Paused” state? There shouldn’t be a problem with data consistency, as a “Paused” task isn’t running.
  • Why does the upgrade_check report an “active task”, when it is actually a “paused task”? This misreporting leads to confusion.

There is probably room to improve the upgrade_check either way.

“active” doesn’t mean “running”. A task is active which has been started but hasn’t finished, yet. It usually will be running but may sometimes be paused.

If the check complains go to the task page and it’ll show you the number of running and paused tasks. Those need attention before the upgrade. I’ve never found that confusing.

A “paused” task is by pure logic an inactive task. It cannot be “paused” and “active” at the same time.
How is this not confusing?

That’s your definition. It is what it is and it’s defined as it is. You may not agree with it but it doesn’t change it. A paused task can continue to run. It’s not yet finished…