Project

General

Profile

Bug #26194

foreman-rake command throw lot of Warning messages while running any rake commands

Added by John Mitsch about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rake tasks
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1674496

Description of problem:

Here is the output while running foreman-rake console command:

  1. foreman-rake console
    /usr/share/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP
    /usr/share/foreman/lib/foreman.rb:8: warning: previous definition of UUID_REGEXP was here
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/content_facet_host_extensions.rb:7: warning: already initialized constant Katello::Concerns::ContentFacetHostExtensions::ERRATA_STATUS_MAP
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/content_facet_host_extensions.rb:7: warning: previous definition of ERRATA_STATUS_MAP was here
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/content_facet_host_extensions.rb:14: warning: already initialized constant Katello::Concerns::ContentFacetHostExtensions::TRACE_STATUS_MAP
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/content_facet_host_extensions.rb:14: warning: previous definition of TRACE_STATUS_MAP was here
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/subscription_facet_host_extensions.rb:13: warning: already initialized constant Katello::Concerns::SubscriptionFacetHostExtensions::SUBSCRIPTION_STATUS_MAP
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/subscription_facet_host_extensions.rb:13: warning: previous definition of SUBSCRIPTION_STATUS_MAP was here
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/subscription_facet_host_extensions.rb:21: warning: already initialized constant Katello::Concerns::SubscriptionFacetHostExtensions::SLA_STATUS_MAP
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/subscription_facet_host_extensions.rb:21: warning: previous definition of SLA_STATUS_MAP was here
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/subscription_facet_host_extensions.rb:26: warning: already initialized constant Katello::Concerns::SubscriptionFacetHostExtensions::USAGE_STATUS_MAP
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/subscription_facet_host_extensions.rb:26: warning: previous definition of USAGE_STATUS_MAP was here
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/subscription_facet_host_extensions.rb:31: warning: already initialized constant Katello::Concerns::SubscriptionFacetHostExtensions::ROLE_STATUS_MAP
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/subscription_facet_host_extensions.rb:31: warning: previous definition of ROLE_STATUS_MAP was here
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/subscription_facet_host_extensions.rb:36: warning: already initialized constant Katello::Concerns::SubscriptionFacetHostExtensions::ADDONS_STATUS_MAP
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/subscription_facet_host_extensions.rb:36: warning: previous definition of ADDONS_STATUS_MAP was here
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/subscription_facet_host_extensions.rb:41: warning: already initialized constant Katello::Concerns::SubscriptionFacetHostExtensions::PURPOSE_STATUS_MAP
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.19/app/models/katello/concerns/subscription_facet_host_extensions.rb:41: warning: previous definition of PURPOSE_STATUS_MAP was here
    Loading production environment (Rails 5.2.1)
    Failed to load console gems, starting anyway
    irb(main):001:0>

The same output is seen while running any command using foreman-rake.

How reproducible:
Always

Steps to Reproduce:
1. Install Katello and run # foreman-rake console or # foreman-rake permissions:reset
2.
3.

Actual results:
Throws lot of Warning messages on the console.

Expected results:
There should not be any warning messages.

Additional info:


Related issues

Related to Packaging - Refactor #24605: foreman-rake console produces warning messagesClosed
Has duplicate Foreman - Bug #26193: foreman-rake command throw lot of Warning messages while running any rake commandsDuplicate

Associated revisions

Revision eb714e7d (diff)
Added by John Mitsch about 4 years ago

Fixes #26194 - Silence ruby warnings for foreman-rake

This commit adds the `-W 0` to ruby for foreman-rake

This will silence warnings for ruby. We already use the production
rails environment, which prevents rails warnings, but we don't alter
the logging for ruby, so ruby warnings are still visible

Here is the option in the ruby help menu:
```
-W[level=2] set warning level; 0=silence, 1=medium, 2=verbose
```

This can be reproduced in Katello production environments, where
there are currently ruby warnings.

History

#1 Updated by The Foreman Bot about 4 years ago

  • Assignee set to John Mitsch
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6527 added

#2 Updated by Tomer Brisker about 4 years ago

  • Subject changed from foreman-rake command throw lot of Warning messages while running any rake commands to foreman-rake command throw lot of Warning messages while running any rake commands
  • Fixed in Releases 1.22.0 added

#3 Updated by Tomer Brisker about 4 years ago

  • Has duplicate Bug #26193: foreman-rake command throw lot of Warning messages while running any rake commands added

#4 Updated by Tomer Brisker about 4 years ago

  • Priority changed from High to Normal

#5 Updated by John Mitsch about 4 years ago

  • Status changed from Ready For Testing to Closed

#6 Updated by Ewoud Kohl van Wijngaarden about 4 years ago

  • Related to Refactor #24605: foreman-rake console produces warning messages added

#7 Updated by Ewoud Kohl van Wijngaarden about 4 years ago

  • Target version set to 1.22.0

Also available in: Atom PDF