theforeman / puppetdb_foreman

PuppetDB proxy in Foreman
http://theforeman.org
GNU General Public License v3.0
32 stars 23 forks source link

Foreman 1.12 won't start after installing puppetdb_foreman plugin. #41

Closed amosin closed 5 years ago

amosin commented 7 years ago

Hi,

I am trying to install the PuppetDB_Foreman Plugin on my environment but Foreman won't load if plugin is installed.

RHEL 6 Foreman 1.12 Installation:

yum install tfm-rubygem-puppetdb_foreman

Installed: tfm-rubygem-puppetdb_foreman.noarch 0:2.0.0-1.fm1_12.el6

after running: service foreman restart I get an exception ->

Web application could not be started

some permissions were not found (ArgumentError) /usr/share/foreman/app/models/role.rb:122:in add_permissions' /usr/share/foreman/app/models/role.rb:137:inadd_permissions!' /usr/share/foreman/app/services/foreman/plugin.rb:235:in block in role' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:inblock in transaction' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/transaction.rb:184:in within_new_transaction' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:intransaction' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:220:in transaction' /usr/share/foreman/app/services/foreman/plugin.rb:233:inrole' /opt/theforeman/tfm/root/usr/share/gems/gems/puppetdb_foreman-2.0.0/lib/puppetdb_foreman/engine.rb:14:in block (2 levels) in <class:Engine>' /usr/share/foreman/app/services/foreman/plugin.rb:64:ininstance_eval' /usr/share/foreman/app/services/foreman/plugin.rb:64:in register' /opt/theforeman/tfm/root/usr/share/gems/gems/puppetdb_foreman-2.0.0/lib/puppetdb_foreman/engine.rb:9:inblock in ' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in instance_exec' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:inrun' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:55:in block in run_initializers' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:226:inblock in tsort_each' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:348:in block (2 levels) in each_strongly_connected_component' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:429:ineach_strongly_connected_component_from' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:347:in block in each_strongly_connected_component' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:ineach' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:in call' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:ineach_strongly_connected_component' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:224:in tsort_each' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:203:intsort_each' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:54:in run_initializers' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/application.rb:352:ininitialize!' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in public_send' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:inmethod_missing' /usr/share/foreman/config/environment.rb:5:in <top (required)>' /opt/rh/rh-ruby22/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:inrequire' /opt/rh/rh-ruby22/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in require' config.ru:3:inblock in

' /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/builder.rb:55:in instance_eval' /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/builder.rb:55:ininitialize' config.ru:1:in new' config.ru:1:in
' /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/helper-scripts/rack-preloader.rb:105:in eval' /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/helper-scripts/rack-preloader.rb:105:inpreload_app' /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/helper-scripts/rack-preloader.rb:150:in <module:App>' /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/helper-scripts/rack-preloader.rb:29:in' /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/helper-scripts/rack-preloader.rb:28:in `
' Application root /usr/share/foreman

Any Ideas?

Thanks!

Andre

amosin commented 7 years ago

Just a little more context on this... I just noticed that this won't happen with a freshly installed Foreman 1.12. The instance that I am having this issue is a box that has been upgraded multiple times.

Thanks!

Andre

timogoebel commented 7 years ago

@amosin: I don't think, this is related to the plugin. The common reason for this error is that permissions have not been seeded. Have you run foreman-rake db:seed.

amosin commented 7 years ago

@timogoebel Yes, I did run foreman-rake db:seed during foreman upgrade and there was no problem. If I remove the plugin and run that again, no problems. if I try to run after the plugin is installed I get the following error.

foreman-rake db:seed --trace Invoke db:seed (first_time) Execute db:seed Invoke db:abort_if_pending_migrations (first_time) Invoke environment (first_time) ** Execute environment rake aborted! ArgumentError: some permissions were not found /usr/share/foreman/app/models/role.rb:122:in add_permissions' /usr/share/foreman/app/models/role.rb:137:inadd_permissions!' /usr/share/foreman/app/services/foreman/plugin.rb:235:in block in role' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:inblock in transaction' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/transaction.rb:184:in within_new_transaction' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:intransaction' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:220:in transaction' /usr/share/foreman/app/services/foreman/plugin.rb:233:inrole' /opt/theforeman/tfm/root/usr/share/gems/gems/puppetdb_foreman-2.0.0/lib/puppetdb_foreman/engine.rb:14:in block (2 levels) in <class:Engine>' /usr/share/foreman/app/services/foreman/plugin.rb:64:ininstance_eval' /usr/share/foreman/app/services/foreman/plugin.rb:64:in register' /opt/theforeman/tfm/root/usr/share/gems/gems/puppetdb_foreman-2.0.0/lib/puppetdb_foreman/engine.rb:9:inblock in ' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in instance_exec' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:inrun' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:55:in block in run_initializers' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:226:inblock in tsort_each' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:348:in block (2 levels) in each_strongly_connected_component' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:429:ineach_strongly_connected_component_from' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:347:in block in each_strongly_connected_component' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:ineach' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:in call' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:ineach_strongly_connected_component' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:224:in tsort_each' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:203:intsort_each' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:54:in run_initializers' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/application.rb:352:ininitialize!' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in public_send' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:inmethod_missing' /usr/share/foreman/config/environment.rb:5:in <top (required)>' /opt/rh/rh-ruby22/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:inrequire' /opt/rh/rh-ruby22/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in require' /opt/rh/sclo-ror42/root/usr/share/gems/gems/polyglot-0.3.4/lib/polyglot.rb:65:inrequire' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in block in require' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:inload_dependency' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in require' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/application.rb:328:inrequire_environment!' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/application.rb:457:in block in run_tasks_blocks' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:incall' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in block in execute' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:ineach' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in execute' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:179:inblock in invoke_with_call_chain' /opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:in mon_synchronize' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:172:ininvoke_with_call_chain' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:201:in block in invoke_prerequisites' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:199:ineach' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:199:in invoke_prerequisites' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:178:inblock in invoke_with_call_chain' /opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:in mon_synchronize' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:172:ininvoke_with_call_chain' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:165:in invoke' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/databases.rake:182:inblock (2 levels) in <top (required)>' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in call' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:inblock in execute' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in each' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:inexecute' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:179:in block in invoke_with_call_chain' /opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:inmon_synchronize' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:172:in invoke_with_call_chain' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:165:ininvoke' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:150:in invoke_task' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:inblock (2 levels) in top_level' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in each' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:inblock in top_level' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:115:in run_with_threads' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:100:intop_level' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:78:in block in run' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:176:instandard_exception_handling' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:75:in run' /opt/rh/rh-ruby22/root/usr/bin/rake:33:in

' Tasks: TOP => db:abort_if_pending_migrations => environment

timogoebel commented 7 years ago

@amosin: This looks like http://projects.theforeman.org/issues/18977 . Would updating Foreman Core to 1.15 be an option for you?

amosin commented 7 years ago

@timogoebel: Not at this moment because we are on RHEL6 still... :( but thanks a lot for finding that.... I will see if I can use that information to patch 1.12 myself and see what happens... if not we I am going to have to wait to use puppetdb plugin when we get to 1.15. Thanks!

ekohl commented 5 years ago

Given its age I'm closing this. If this issue persists on supported versions or if it blocks upgrades, please reopen or open a new issue.