Project

General

Profile

Actions

Bug #33993

closed

Errors in foreman_statistics plugin after upgrade

Added by Lars Wagner over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

We've upgraded our foreman to version 3.0. Since then we are having problems due to the foreman_statistics plugin. During upgrade foreman runs foreman-rake apipie:cache which fails because of the statistics plugin:

foreman-rake apipie:cache -v --trace
** Invoke apipie:cache (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
NameError: uninitialized constant Environment
/usr/share/foreman/vendor/ruby/2.7.0/gems/foreman_statistics-1.1.1/lib/foreman_statistics/engine.rb:91:in `block in <class:Engine>'
/usr/share/foreman/vendor/ruby/2.7.0/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:428:in `instance_exec'
/usr/share/foreman/vendor/ruby/2.7.0/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:428:in `block in make_lambda'
/usr/share/foreman/vendor/ruby/2.7.0/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:200:in `block (2 levels) in halting'
/usr/share/foreman/vendor/ruby/2.7.0/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:605:in `block (2 levels) in default_terminator'
/usr/share/foreman/vendor/ruby/2.7.0/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:604:in `catch'
/usr/share/foreman/vendor/ruby/2.7.0/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:604:in `block in default_terminator'
/usr/share/foreman/vendor/ruby/2.7.0/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:201:in `block in halting'
/usr/share/foreman/vendor/ruby/2.7.0/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:513:in `block in invoke_before'
/usr/share/foreman/vendor/ruby/2.7.0/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:513:in `each'
/usr/share/foreman/vendor/ruby/2.7.0/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:513:in `invoke_before'
/usr/share/foreman/vendor/ruby/2.7.0/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:134:in `run_callbacks'
/usr/share/foreman/vendor/ruby/2.7.0/gems/activesupport-6.0.3.7/lib/active_support/reloader.rb:88:in `prepare!'
/usr/share/foreman/vendor/ruby/2.7.0/gems/railties-6.0.3.7/lib/rails/application/finisher.rb:113:in `block in <module:Finisher>'
/usr/share/foreman/vendor/ruby/2.7.0/gems/railties-6.0.3.7/lib/rails/initializable.rb:32:in `instance_exec'
/usr/share/foreman/vendor/ruby/2.7.0/gems/railties-6.0.3.7/lib/rails/initializable.rb:32:in `run'
/usr/share/foreman/config/initializers/0_print_time_spent.rb:45:in `block in run'
/usr/share/foreman/config/initializers/0_print_time_spent.rb:17:in `benchmark'
/usr/share/foreman/config/initializers/0_print_time_spent.rb:45:in `run'
/usr/share/foreman/vendor/ruby/2.7.0/gems/railties-6.0.3.7/lib/rails/initializable.rb:61:in `block in run_initializers'
/usr/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
/usr/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/usr/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
/usr/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
/usr/lib/ruby/2.7.0/tsort.rb:347:in `each'
/usr/lib/ruby/2.7.0/tsort.rb:347:in `call'
/usr/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
/usr/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
/usr/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
/usr/share/foreman/vendor/ruby/2.7.0/gems/railties-6.0.3.7/lib/rails/initializable.rb:60:in `run_initializers'
/usr/share/foreman/vendor/ruby/2.7.0/gems/railties-6.0.3.7/lib/rails/application.rb:363:in `initialize!'
/usr/share/foreman/vendor/ruby/2.7.0/gems/railties-6.0.3.7/lib/rails/railtie.rb:190:in `public_send'
/usr/share/foreman/vendor/ruby/2.7.0/gems/railties-6.0.3.7/lib/rails/railtie.rb:190:in `method_missing'
/usr/share/foreman/config/environment.rb:5:in `<top (required)>'
/usr/share/foreman/vendor/ruby/2.7.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.7.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.7.0/gems/railties-6.0.3.7/lib/rails/application.rb:339:in `require_environment!'
/usr/share/foreman/vendor/ruby/2.7.0/gems/railties-6.0.3.7/lib/rails/application.rb:523:in `block in run_tasks_blocks'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'
Tasks: TOP => apipie:cache => environment

Currently installed version:

ii  ruby-foreman-statistics                1.1.1-1                           all          Foreman statistics plugin

After uninstalling the foreman statistics plugin everything works fine:

apt purge ruby-foreman-statistics

foreman-rake apipie:cache -v --trace
** Invoke apipie:cache (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute apipie:cache
2021-11-24 09:14:48 +0100 | Started
2021-11-24 09:14:49 +0100 | Documents loaded...
2021-11-24 09:14:49 +0100 | Processing docs for
2021-11-24 09:14:57 +0100 | Processing docs for en
2021-11-24 09:15:05 +0100 | Processing docs for de
2021-11-24 09:15:12 +0100 | Processing docs for pl
2021-11-24 09:15:20 +0100 | Processing docs for en_GB
2021-11-24 09:15:28 +0100 | Processing docs for gl
2021-11-24 09:15:36 +0100 | Processing docs for zh_TW
2021-11-24 09:15:44 +0100 | Processing docs for ja
2021-11-24 09:15:52 +0100 | Processing docs for es
2021-11-24 09:16:00 +0100 | Processing docs for ru
2021-11-24 09:16:08 +0100 | Processing docs for ko
2021-11-24 09:16:15 +0100 | Processing docs for sv_SE
2021-11-24 09:16:23 +0100 | Processing docs for nl_NL
2021-11-24 09:16:31 +0100 | Processing docs for cs_CZ
2021-11-24 09:16:39 +0100 | Processing docs for ca
2021-11-24 09:16:47 +0100 | Processing docs for zh_CN
2021-11-24 09:16:55 +0100 | Processing docs for it
2021-11-24 09:17:02 +0100 | Processing docs for fr
2021-11-24 09:17:10 +0100 | Processing docs for pt_BR
2021-11-24 09:17:18 +0100 | Finished

Any help is kindly appreciated and let me know if you need further information.

Actions #1

Updated by Lars Wagner over 2 years ago

Lars Wagner wrote:

We've upgraded our foreman to version 3.0. Since then we are having problems due to the foreman_statistics plugin. During upgrade foreman runs foreman-rake apipie:cache which fails because of the statistics plugin:

[...]

Currently installed version:
[...]

After uninstalling the foreman statistics plugin everything works fine:
[...]

Any help is kindly appreciated and let me know if you need further information.

Were you able to reproduce it, or do you need further information?

Actions #2

Updated by Lars Wagner over 2 years ago

  • Status changed from New to Resolved

During the upgrade to foreman version 3.0 I uninstalled the foreman-statistics plugin and reinstalled it after upgrading to foreman 3.1. Everything is working fine now.

Actions

Also available in: Atom PDF