Project

General

Profile

Actions

Bug #20385

closed

rake db:seed fails for plugins

Added by Marek Hulán about 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Plugin integration
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

The role fails to create on first_on_create because of missing create permission. The role plugins DSL is not running under admin which is the reason it fails. Only to be found with 1.16 (develop branch)

the trace

rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Name has already been taken
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activerecord-4.2.9/lib/active_record/validations.rb:79:in `raise_record_invalid'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activerecord-4.2.9/lib/active_record/validations.rb:43:in `save!'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activerecord-4.2.9/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activerecord-4.2.9/lib/active_record/transactions.rb:291:in `block in save!'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activerecord-4.2.9/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activerecord-4.2.9/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activerecord-4.2.9/lib/active_record/transactions.rb:220:in `transaction'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activerecord-4.2.9/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activerecord-4.2.9/lib/active_record/transactions.rb:291:in `save!'
/var/lib/workspace/workspace/test_plugin_pull_request/database/postgresql/label/fast/ruby/2.3/foreman/app/models/role.rb:169:in `add_permissions!'
/var/lib/workspace/workspace/test_plugin_pull_request/database/postgresql/label/fast/ruby/2.3/foreman/app/registries/foreman/plugin.rb:249:in `block in role'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activerecord-4.2.9/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activerecord-4.2.9/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activerecord-4.2.9/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activerecord-4.2.9/lib/active_record/transactions.rb:220:in `transaction'
/var/lib/workspace/workspace/test_plugin_pull_request/database/postgresql/label/fast/ruby/2.3/foreman/app/registries/foreman/plugin.rb:247:in `role'
/var/lib/workspace/workspace/test_plugin_pull_request/database/postgresql/label/fast/ruby/2.3/plugin/lib/foreman_openscap/engine.rb:115:in `block (2 levels) in <class:Engine>'
/var/lib/workspace/workspace/test_plugin_pull_request/database/postgresql/label/fast/ruby/2.3/foreman/app/registries/foreman/plugin.rb:66:in `instance_eval'
/var/lib/workspace/workspace/test_plugin_pull_request/database/postgresql/label/fast/ruby/2.3/foreman/app/registries/foreman/plugin.rb:66:in `register'
/var/lib/workspace/workspace/test_plugin_pull_request/database/postgresql/label/fast/ruby/2.3/plugin/lib/foreman_openscap/engine.rb:44:in `block in <class:Engine>'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/railties-4.2.9/lib/rails/initializable.rb:30:in `instance_exec'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/railties-4.2.9/lib/rails/initializable.rb:30:in `run'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/railties-4.2.9/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/railties-4.2.9/lib/rails/initializable.rb:54:in `run_initializers'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/railties-4.2.9/lib/rails/application.rb:352:in `initialize!'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `public_send'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `method_missing'
/var/lib/workspace/workspace/test_plugin_pull_request/database/postgresql/label/fast/ruby/2.3/foreman/config/environment.rb:5:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:274:in `block in require'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/railties-4.2.9/lib/rails/application.rb:328:in `require_environment!'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/railties-4.2.9/lib/rails/application.rb:457:in `block in run_tasks_blocks'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.3.1@test_plugin_pull_request-2/bin/ruby_executable_hooks:15:in `<main>'


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #16884: Create permissions do not check filter limitsClosedMarek Hulán10/12/2016Actions
Actions #1

Updated by Marek Hulán about 7 years ago

  • Related to Bug #16884: Create permissions do not check filter limits added
Actions #2

Updated by The Foreman Bot about 7 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4690 added
Actions #3

Updated by Marek Hulán about 7 years ago

  • Description updated (diff)
Actions #4

Updated by Ivan Necas about 7 years ago

  • Status changed from Ready For Testing to Closed
  • Translation missing: en.field_release set to 240
Actions

Also available in: Atom PDF