Refactor #24605
closedforeman-rake console produces warning messages
Description
From Bugzilla
Description of problem:
Remove warning messages when executing rake scripts/foreman-rake console to improve user experience.
Version-Release number of selected component (if applicable):
Satellite 6.4 snap 17
How reproducible:
[root@mdekan-sat64 ~]# 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
/usr/share/foreman/lib/core_extensions.rb:182: warning: already initialized constant ActiveSupport::MessageEncryptor::DEFAULT_CIPHER
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/message_encryptor.rb:22: warning: previous definition of DEFAULT_CIPHER was here
Loading production environment (Rails 5.1.6)
Failed to load console gems, starting anyway
irb(main):001:0>
Actual results:
Also during the upgrade step, console is flooded with same kind of messages
[root@mdekan-sat64 ~]# satellite-installer --upgrade
....
....
....
Upgrade Step: import_distributions (this may take a while) ...
/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
/usr/share/foreman/lib/core_extensions.rb:182: warning: already initialized constant ActiveSupport::MessageEncryptor::DEFAULT_CIPHER
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/message_encryptor.rb:22: warning: previous definition of DEFAULT_CIPHER was here
Importing distribution data into repositories
foreman-rake katello:upgrades:2.4:import_distributions finished successfully!
Upgrade Step: import_puppet_modules (this may take a while) ...
/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
/usr/share/foreman/lib/core_extensions.rb:182: warning: already initialized constant ActiveSupport::MessageEncryptor::DEFAULT_CIPHER
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/message_encryptor.rb:22: warning: previous definition of DEFAULT_CIPHER was here
Importing Puppet Modules
foreman-rake katello:upgrades:2.4:import_puppet_modules finished successfully!
Upgrade Step: import_subscriptions (this may take a while) ...
/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
/usr/share/foreman/lib/core_extensions.rb:182: warning: already initialized constant ActiveSupport::MessageEncryptor::DEFAULT_CIPHER
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/message_encryptor.rb:22: warning: previous definition of DEFAULT_CIPHER was here
Importing Subscriptions
foreman-rake katello:import_subscriptions finished successfully!
Upgrade Step: import_product_content (this may take a while) ...
/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
/usr/share/foreman/lib/core_extensions.rb:182: warning: already initialized constant ActiveSupport::MessageEncryptor::DEFAULT_CIPHER
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/message_encryptor.rb:22: warning: previous definition of DEFAULT_CIPHER was here
foreman-rake katello:upgrades:3.6:import_product_content finished successfully!
Upgrade Step: add_export_distributor (this may take a while) ...
/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
/usr/share/foreman/lib/core_extensions.rb:182: warning: already initialized constant ActiveSupport::MessageEncryptor::DEFAULT_CIPHER
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/message_encryptor.rb:22: warning: previous definition of DEFAULT_CIPHER was here
Refreshing existing repositories to add export distributor
foreman-rake katello:upgrades:3.0:add_export_distributor finished successfully!
Upgrade Step: remove_docker_v1_content (this may take a while) ...
/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
/usr/share/foreman/lib/core_extensions.rb:182: warning: already initialized constant ActiveSupport::MessageEncryptor::DEFAULT_CIPHER
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/message_encryptor.rb:22: warning: previous definition of DEFAULT_CIPHER was here
Deleting repositories that only contain Docker v1 content....Done
Orphaned content deletion started in background.
foreman-rake katello:upgrades:3.0:delete_docker_v1_content finished successfully!
Upgrade Step: update_puppet_repository_distributors (this may take a while) ...
/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
/usr/share/foreman/lib/core_extensions.rb:182: warning: already initialized constant ActiveSupport::MessageEncryptor::DEFAULT_CIPHER
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/message_encryptor.rb:22: warning: previous definition of DEFAULT_CIPHER was here
Updating Puppet Repository Distributors
Updating Content View Puppet Environment Distributors
foreman-rake katello:upgrades:3.0:update_puppet_repository_distributors finished successfully!
Upgrade Step: update_subscription_facet_backend_data (this may take a while) ...
/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
/usr/share/foreman/lib/core_extensions.rb:182: warning: already initialized constant ActiveSupport::MessageEncryptor::DEFAULT_CIPHER
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/message_encryptor.rb:22: warning: previous definition of DEFAULT_CIPHER was here
Updating backend data for subscription facets
foreman-rake katello:upgrades:3.0:update_subscription_facet_backend_data finished successfully!
Upgrade Step: remove_event_queue...
Upgrade Step: set_virt_who_on_pools (this may take a while) ...
/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
/usr/share/foreman/lib/core_extensions.rb:182: warning: already initialized constant ActiveSupport::MessageEncryptor::DEFAULT_CIPHER
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/message_encryptor.rb:22: warning: previous definition of DEFAULT_CIPHER was here
Importing Subscriptions
foreman-rake katello:import_subscriptions finished successfully!
....
....
....
Expected results:
No warning messages.
Updated by Timo Goebel over 6 years ago
- Project changed from Foreman to Packaging
These warnings are adding in packaging, see https://github.com/theforeman/foreman-packaging/commit/ea45d271f89b1b9f47a083630c25f8c7b984fe1b.
Updated by The Foreman Bot over 6 years ago
- Status changed from New to Ready For Testing
- Assignee set to Timo Goebel
- Pull request https://github.com/theforeman/foreman-packaging/pull/2984 added
Updated by Timo Goebel over 6 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman-packaging|60fa34dc3bcd50f7f2dd3da6a8922808decdce0f.
Updated by Ewoud Kohl van Wijngaarden over 6 years ago
- Category set to RPMs
- Target version set to 1.20.0
- Fixed in Releases 1.20.0 added
Updated by Oliver Falk almost 6 years ago
- Found in Releases 1.20.1 added
I don't think this is fully solved yet. The only part that was solved was the one with the DEFAULT_CIPHER. There are still plenty of other warnings. Eg.
# 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.23/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.23/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.23/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.23/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.23/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.23/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.23/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.23/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.23/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.23/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.23/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.23/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.23/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.23/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.23/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.23/app/models/katello/concerns/subscription_facet_host_extensions.rb:41: warning: previous definition of PURPOSE_STATUS_MAP was here
Updated by Ewoud Kohl van Wijngaarden almost 6 years ago
Those were different issues. This was in particular about the warnings we introduced in packaging. #26194 is the generic solution.
Updated by Ewoud Kohl van Wijngaarden almost 6 years ago
- Related to Bug #26194: foreman-rake command throw lot of Warning messages while running any rake commands added