Description of problem: Got an issue with clean up scripts I use. The script (example) is: [root@satellite62 tasks]# pwd /usr/share/foreman/lib/tasks [root@satellite62 tasks]# cat clean_listenOn.rake namespace :katello do task :clean_listenOn => ["environment"] do User.current = User.first tasks = [] puts "Cleaning listenOnCandlepinEvents...\n" ForemanTasks::Task.where(:label => 'Actions::Candlepin::ListenOnCandlepinEvents').destroy_all end end The error I get is: [root@satellite62 tasks]# service foreman-tasks stop Redirecting to /bin/systemctl stop foreman-tasks.service [root@satellite62 tasks]# foreman-rake katello:clean_listenOn /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.41/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.105/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here Cleaning listenOnCandlepinEvents... The error: /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.41/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.105/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here Version-Release number of selected component (if applicable): Satellite 6.2.8 upgraded from 6.2.7 today: How reproducible: Rerun cleanup job. Steps to Reproduce: Actual results: The cleanup seems to be working, the warning should not be there. Expected results: The cleanup seems to be working, the warning should not be there. Additional info:
Starting console also gives warning. [root@satellite62 ~]# foreman-rake console /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.41/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.105/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here /usr/share/foreman/lib/tasks/console.rake:4: warning: already initialized constant ARGV Loading production environment (Rails 4.1.5) irb(main):001:0>
This is also seen during .7→.8 upgrade: Upgrade Step: migrate_foreman... /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.41/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.105/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here true /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.41/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.105/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.41/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.105/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here false
The definitions that is complaining about are as follows (slightly different): /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.105/app/models/katello/ping.rb:7 -> 7 PACKAGES = %w(katello candlepin pulp qpid foreman tfm hammer) /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.41/app/models/concerns/satellite_packages.rb:4 -> 4 self.const_set(:PACKAGES, %w(katello candlepin pulp qpid foreman tfm ham mer satellite)) So they are different by a single package definition (satellite).
Starting foreman-rake console gives also the mentioned error for me: foreman-rake console /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.41/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.105/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here /usr/share/foreman/lib/tasks/console.rake:4: warning: already initialized constant ARGV Loading production environment (Rails 4.1.5)
This is a regression from https://bugzilla.redhat.com/show_bug.cgi?id=1329689, it's not fatal, but I agree the red herring messages are not nice.
*** Bug 1427673 has been marked as a duplicate of this bug. ***
Red Hat Knowledge Base (Solution) 2980231 does not take into account that Trend Monitoring jobs are filling up root's mailbox with mails containing the messages: /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.41/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.105/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here true It simply states to ignore the messages in system and application logs. Logs are rotate, root's mailbox has to be cleared manually.
Every 30 minutes I get an email from the trend analysis task with the same message. Still after upgrading to 6.2.9
VERIFIED on 6.2.11-2 yet, there's still the warning regarding the ARGV constant. B [root@dell-per320-01 environments]# foreman-rake console /usr/share/foreman/lib/tasks/console.rake:4: warning: already initialized constant ARGV Loading production environment (Rails 4.1.5) irb(main):001:0>
opened a new BZ for the other warning: https://bugzilla.redhat.com/show_bug.cgi?id=1474796
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/RHBA-2017:2466