Bug 1419845

Summary: foreman-rake katello:upgrade_check fails on Actions::Katello::EventQueue::Monitor task
Product: Red Hat Satellite Reporter: Kenny Tordeurs <ktordeur>
Component: UpgradesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Jonathon Turel <jturel>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.6CC: bbuckingham, brcoca, inecas, jcallaha, jturel, ktordeur, mbacovsk
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kenny Tordeurs 2017-02-07 08:49:21 UTC
Description of problem:
upgrade_check.rake does not exclude the monitor eventqueue from the check, upstream there is a fix for this per [0]

Version-Release number of selected component (if applicable):
6.2

How reproducible:
100%

Steps to Reproduce:
1. Upgrade
2. Fail with Active task for monitor eventqueue
3.

Actual results:
Upgrade stopped because of running task

Expected results:
It to ignore the Monitor task

Additional info:

[0] https://github.com/Katello/katello/blob/master/lib/katello/tasks/upgrade_check.rake

Comment 1 Brad Buckingham 2017-02-07 18:31:51 UTC
Would it be possible to attach the foreman-debug?  Thanks!

Comment 2 Kenny Tordeurs 2017-02-08 08:05:39 UTC
Unfortunately the customer already skipped the upgrade_check and did the upgrade.

But if I have a look at the current upgrade_check.rake it only does something for ListenOnCandlepinEvents nothing for the monitorqueue:

#cat /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.95/lib/katello/tasks/upgrade_check.rake
~~~
CP_LISTEN_ACTION = "Actions::Candlepin::ListenOnCandlepinEvents".freeze

namespace :katello do
  task :upgrade_check => ['environment'] do
    desc "Task that can be run before upgrading Katello to check if system is upgrade ready"
    success = "PASS"
    fail = "FAIL"

    puts "This script makes no modifications and can be re-run multiple times for the most up to date results."
    puts "Checking upgradeability...\n\n"

    # check for any running tasks
    task_count = ::ForemanTasks::Task.active.where("label != '#{CP_LISTEN_ACTION}'").count
    task_status = task_count > 0 ? fail : success
    puts "Checking for running tasks..."
    puts "[#{task_status}] - There are #{task_count} active tasks. "
    puts "         Please wait for these to complete or cancel them from the Monitor tab.\n\n"
  end
end

~~~

Comment 3 Brad Buckingham 2017-02-10 16:54:12 UTC
Moving to POST based on the state of the upstream redmine.

Comment 6 Jonathon Turel 2017-09-06 16:33:34 UTC
Verified against Sat 6.3 Snap 14 => satellite-6.3.0-17.0.beta.el7sat.noarch

Had the following running tasks:

ForemanTasks::Task.all.where(:state => :running).pluck(:label)
=> ["Actions::Candlepin::ListenOnCandlepinEvents", "Actions::Katello::EventQueue::Monitor"]

upgrade_check says:

[vagrant@sat63-qa-rhel7 foreman]$ sudo 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...
[PASS] - There are 0 active tasks.

Comment 8 Satellite Program 2018-02-21 16:54:37 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> > 
> > For information on the advisory, and where to find the updated files, follow the link below.
> > 
> > If the solution does not work for you, open a new bug report.
> > 
> > https://access.redhat.com/errata/RHSA-2018:0336