Closed amosin closed 5 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
@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
.
@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:in
add_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:in
block 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:in
transaction'
/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:in
role'
/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:in
instance_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:in
block in instance_exec' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in
run'
/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:in
block 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:in
each_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:in
each'
/opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:in call' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:in
each_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:in
tsort_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:in
initialize!'
/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:in
method_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:in
require'
/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:in
require'
/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:in
load_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:in
require_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:in
call'
/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:in
each'
/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:in
block 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:in
invoke_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:in
each'
/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:in
block 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:in
invoke_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:in
block (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:in
block 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:in
execute'
/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:in
mon_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:in
invoke'
/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:in
block (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:in
block 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:in
top_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:in
standard_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
@amosin: This looks like http://projects.theforeman.org/issues/18977 . Would updating Foreman Core to 1.15 be an option for you?
@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!
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.
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'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in '
/opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/builder.rb:55:in '
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/helper-scripts/rack-preloader.rb:105:in '
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/helper-scripts/rack-preloader.rb:28:in `'
Application root
/usr/share/foreman
add_permissions' /usr/share/foreman/app/models/role.rb:137:in
add_permissions!' /usr/share/foreman/app/services/foreman/plugin.rb:235:inblock 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:in
block 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:inwithin_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:in
transaction' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:220:intransaction' /usr/share/foreman/app/services/foreman/plugin.rb:233:in
role' /opt/theforeman/tfm/root/usr/share/gems/gems/puppetdb_foreman-2.0.0/lib/puppetdb_foreman/engine.rb:14:inblock (2 levels) in <class:Engine>' /usr/share/foreman/app/services/foreman/plugin.rb:64:in
instance_eval' /usr/share/foreman/app/services/foreman/plugin.rb:64:inregister' /opt/theforeman/tfm/root/usr/share/gems/gems/puppetdb_foreman-2.0.0/lib/puppetdb_foreman/engine.rb:9:in
block ininstance_exec' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in
run' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:55:inblock in run_initializers' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:226:in
block in tsort_each' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:348:inblock (2 levels) in each_strongly_connected_component' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:429:in
each_strongly_connected_component_from' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:347:inblock in each_strongly_connected_component' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:in
each' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:incall' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:in
each_strongly_connected_component' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:224:intsort_each' /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:203:in
tsort_each' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:54:inrun_initializers' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/application.rb:352:in
initialize!' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:inpublic_send' /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in
method_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:in
require' /opt/rh/rh-ruby22/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:inrequire' config.ru:3:in
block ininstance_eval' /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/builder.rb:55:in
initialize' config.ru:1:innew' config.ru:1:in
eval' /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/helper-scripts/rack-preloader.rb:105:in
preload_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
Any Ideas?
Thanks!
Andre