Description of problem: pre-upgrade check script tells to wait even though there are no active tasks Version-Release number of selected component (if applicable): # rpm -qa | grep satellite satellite-installer-6.2.0.12-1.el7sat.noarch tfm-rubygem-foreman_theme_satellite-0.1.28-1.el7sat.noarch satellite-cli-6.2.2-1.1.el7sat.noarch satellite-6.2.2-1.1.el7sat.noarch How reproducible: Always Steps to Reproduce: # 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. Please wait for these to complete or cancel them from the Monitor tab. Actual results: See above - "Please wait for these to complete or cancel them from the Monitor tab." Expected results: The above line should not be printed. Instead, show something like: "Please proceed with the upgrade" Additional info:
Created redmine issue http://projects.theforeman.org/issues/17048 from this bug
Upstream Katello PR: https://github.com/Katello/katello/pull/6407
[root@rhel7 ~]# foreman-rake katello:upgrade_check /opt/theforeman/tfm/root/usr/share/gems/gems/redhat_access-2.0.3/app/services/redhat_access/telemetry/look_ups.rb:171: warning: key :hosts is duplicated and overwritten on line 172 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. [root@rhel7 ~]# su - postgres Last login: Wed Aug 23 16:25:33 UTC 2017 on pts/0 -bash-4.2$ psql foreman psql (9.2.21) Type "help" for help. foreman=# select * from foreman_tasks_tasks where state = 'running'; id | type | label | started_at | ended_at | state | result | external_id | parent_task_id | start_at | start_before ----+------+-------+------------+----------+-------+--------+-------------+----------------+----------+-------------- (0 rows) Failed QA
Note: the change introduced by the BZ was only to the text output when the task count was 0. The above appears to be a different problem where perhaps the count in the DB is 0; however, the app saw something different. Chris, can you provide details on the packages installed when this was run and any steps performed prior to the pre-upgrade check?
On my 6.2 instance (prior to updating the rpms to 6.3), I see the following output: [root@sat-snap-rhel7 ~]# 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 2 active tasks. Please wait for these to complete or cancel them from the Monitor tab. [root@sat-snap-rhel7 ~]# sudo su - postgres Last login: Wed Oct 18 17:45:34 UTC 2017 on pts/1 -bash-4.2$ psql foreman psql (9.2.23) Type "help" for help. foreman=# select id,label from foreman_tasks_tasks where state = 'running'; id | label --------------------------------------+--------------------------------------------- 293dc338-9f82-45ec-b17a-7284a5d9bb51 | Actions::Candlepin::ListenOnCandlepinEvents 3390e6b9-0324-4af3-8c05-07d39e73ac58 | Actions::Katello::EventQueue::Monitor (2 rows) The upgrade_check rake task is checking for: ::ForemanTasks::Task.active.where("label != '#{CP_LISTEN_ACTION}'").count In the console, it looks like the 2 tasks being returned are: [root@sat-snap-rhel7 ~]# foreman-rake console irb(main):003:0> ::ForemanTasks::Task.active.where("label != '#{CP_LISTEN_ACTION}'").select(:label) => #<ActiveRecord::Relation [#<ForemanTasks::Task id: nil, label: "Actions::Insights::EmailPoller">, #<ForemanTasks::Task id: nil, label: "Actions::Katello::EventQueue::Monitor">]> Neither of these are 'filtered' out by the script currently. Since I executed this on 6.2, updates may be needed to both 6.2.z and 6.3.
For release note: If the katello:upgrade_check returns active tasks, the following tasks may be ignored: Actions::Candlepin::ListenOnCandlepinEvents Actions::Katello::EventQueue::Monitor Actions::Insights::EmailPoller One way to see if these tasks are included, is to perform the following: Log in to the Satellite UI go to Monitor -> Tasks enter 'state = running or state = scheduled' in the search box click on Search
Note; based on discussion in irc, foreman-maintain may be the supported way to upgrade from 6.2 to 6.3. If that is the case, then this bugzilla may no longer be necessary.
Worked on Satellite 6.3 snap 30 with deprecation warning: # 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. You may proceed with the upgrade. DEPRECATION WARNING: katello:upgrade_check is being replaced with 'foreman-maintain upgrade check' and will be removed in 6.4
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