Project

General

Profile

Actions

Bug #19266

closed

Foreman not starting because: Role is locked for user modifications.

Added by Sandro Emma almost 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
High
Category:
Users, Roles and Permissions
Target version:
Difficulty:
medium
Triaged:
Fixed in Releases:
Found in Releases:

Description

We have Foreman installed on RHEL 7.3
We cannot start foreman:

Validation failed: Role is locked for user modifications. (ActiveRecord::RecordInvalid)
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/validations.rb:79:in `raise_record_invalid'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/validations.rb:43:in `save!'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:291:in `block in save!'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
  /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'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:291:in `save!'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:in `each'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:in `each'
  /usr/share/foreman/app/services/cache_manager.rb:13:in `create_new_filter_cache'
  /usr/share/foreman/app/services/cache_manager.rb:20:in `recache!'
  /usr/share/foreman/config/initializers/fix_cache.rb:10:in `<top (required)>'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `block in load'
  /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:268:in `load'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:166:in `instrument'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:651:in `load_config_initializer'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:615:in `each'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
  /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: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:420:in `block (2 levels) in each_strongly_connected_component_from'
  /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:419:in `block in each_strongly_connected_component_from'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:44:in `each'
  /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/initializable.rb:44:in `tsort_each_child'
  /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:413:in `call'
  /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:413: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'
  config.ru:3:in `block in <main>'
  /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:in `initialize'
  config.ru:1:in `new'
  config.ru:1:in `<main>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:112:in `eval'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:112:in `preload_app'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:158:in `<module:App>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `<main>'
Error ID
a02be618

Related issues 3 (0 open3 closed)

Related to Foreman - Feature #18001: Allow plugins to easily add their permissions to core's Viewer and ManagerClosedOndřej Pražák01/10/2017Actions
Related to Salt - Bug #20055: Salt seeds cannot run due to role locking on 1.15ClosedBernhard SuttnerActions
Has duplicate Foreman - Bug #20099: Passanger not starting after upgrading from 1.15.0 to 1.15.1 ( Centos 7.3 )Duplicate06/23/2017Actions
Actions #1

Updated by Dominic Cleal almost 7 years ago

  • Related to Feature #18001: Allow plugins to easily add their permissions to core's Viewer and Manager added
Actions #2

Updated by Dominic Cleal almost 7 years ago

  • Category changed from Web Interface to Users, Roles and Permissions
  • translation missing: en.field_release set to 209

Tentatively setting to 1.15.0 as the error message was introduced in #18001.

Actions #3

Updated by Daniel Lobato Garcia almost 7 years ago

Is this a clean install on 1.15-RC1 or an upgrade from 1.14?

Actions #4

Updated by Daniel Lobato Garcia almost 7 years ago

When do you see this error / where do you see it? Is it after restarting httpd (systemctl restart httpd), in /var/log/foreman/production.log?

Actions #5

Updated by Marek Hulán almost 7 years ago

Also would it be possible to list plugins you have installed and their versions?

Actions #6

Updated by Sandro Emma almost 7 years ago

We have foreman installed via package and upgraded from 1.14 to 1.15 so no clean install of 1.15.

We get this error when restarting httpd and we cannot access foreman Web Client.

I think this is an Issue with the DB if we create a new DB and restart Foreman everything works somehow, i'm currently working on searching the query that lets the application crash..

Last Query before foreman "crashes" :

 
SELECT `taxonomies`.id FROM `taxonomies` INNER JOIN `taxable_taxonomies` 
ON `taxonomies`.`id` = `taxable_taxonomies`.`taxonomy_id` 
WHERE `taxable_taxonomies`.`taxable_id` = 32 AND `taxable_taxonomies`.`taxable_type` = 'Filter' AND `taxonomies`.`type` = 'Location'  
ORDER BY `taxonomies`.`title` ASC;

ROLLBACK;
Actions #7

Updated by Sandro Emma almost 7 years ago

Could you maybe help us out with some more detail on the database architecture ?
Like why is the Table 'foreman.taxonomies' and 'foreman.taxable_taxonomies' empty ? As those ar the last SELECT's before foreman crashes..

Actions #8

Updated by Marek Hulán almost 7 years ago

These two tables are only used if you enable organizations and/or locations in settings.yaml. So they are empty because you probably didn't allow it.

Actions #9

Updated by Sandro Emma almost 7 years ago

So we were able to fix this issue for now by downgrading again to 1.14 after we checked that the db seems to work again on 1.14 we upgraded again to 1.15 and it seems to work at the moment. If you want i can provide some more details..

Thanks
Sandro

Actions #10

Updated by Daniel Lobato Garcia almost 7 years ago

  • translation missing: en.field_release deleted (209)

Removing the 1.15.0 release tag as it seems to work well on manual testing (1.14.3 to 1.15.0 and fresh install). Maybe it's what Marek said above about disabling orgs/locs on upgrade.

Actions #11

Updated by Rob Sanders almost 7 years ago

I've got the same problem while upgrading from 1.14.1 to 1.15. Running foreman-installer --scenario katello --upgrade produces the same backtrace.

Actions #12

Updated by Rob Sanders almost 7 years ago

I've got the same problem while upgrading from 1.14.1 to 1.15. Running foreman-installer --scenario katello --upgrade produces similar backtrace:

Upgrade Step: db_seed...
rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Filters.role is locked for user modifications.
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/validations.rb:79:in `raise_record_invalid'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/validations.rb:43:in `save!'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:291:in `block in save!'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
/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'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:291:in `save!'
/usr/share/foreman/app/models/role.rb:154:in `add_permissions!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-8.0.2/db/seeds.d/75-salt_seeds.rb:9:in `block in <top (required)>'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:in `each'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-8.0.2/db/seeds.d/75-salt_seeds.rb:8:in `<top (required)>'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `block in load'
/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:268:in `load'
/usr/share/foreman/db/seeds.rb:38:in `block in <top (required)>'
/usr/share/foreman/db/seeds.rb:36:in `each'
/usr/share/foreman/db/seeds.rb:36:in `<top (required)>'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `block in load'
/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:268:in `load'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:547:in `load_seed'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:250:in `load_seed'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/databases.rake:183:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:seed
(See full trace by running task with --trace)
Successfully encrypted field for Setting::Auth oauth_consumer_key
Successfully decrypted field for Setting::Auth oauth_consumer_key
Successfully decrypted field for Setting::Auth oauth_consumer_key
Successfully encrypted field for Setting::Auth oauth_consumer_secret
Successfully decrypted field for Setting::Auth oauth_consumer_secret
Successfully decrypted field for Setting::Auth oauth_consumer_secret
Seeding /usr/share/foreman/db/seeds.d/02-permissions_list.rb
Seeding /usr/share/foreman/db/seeds.d/02-roles_list.rb
Seeding /usr/share/foreman/db/seeds.d/03-auth_sources.rb
Seeding /usr/share/foreman/db/seeds.d/03-permissions.rb
Seeding /usr/share/foreman/db/seeds.d/03-roles.rb
Seeding /usr/share/foreman/db/seeds.d/04-admin.rb
Seeding /usr/share/foreman/db/seeds.d/05-taxonomies.rb
Seeding /usr/share/foreman/db/seeds.d/06-architectures.rb
Seeding /usr/share/foreman/db/seeds.d/07-data.rb
Seeding /usr/share/foreman/db/seeds.d/07-provisioning_templates.rb
Seeding /usr/share/foreman/db/seeds.d/08-data.rb
Seeding /usr/share/foreman/db/seeds.d/08-partition_tables.rb
Seeding /usr/share/foreman/db/seeds.d/10-installation_media.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.0.2/db/seeds.d/101-locations.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.0.2/db/seeds.d/102-organizations.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.0.2/db/seeds.d/103-provisioning_templates.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.0.2/db/seeds.d/104-proxy.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.0.2/db/seeds.d/106-mail_notifications.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.0.2/db/seeds.d/107-enable_dynflow.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.0.2/db/seeds.d/108-subcription-bookmarks.rb
Seeding /usr/share/foreman/db/seeds.d/11-smart_proxy_features.rb
Seeding /usr/share/foreman/db/seeds.d/13-compute_profiles.rb
Seeding /usr/share/foreman/db/seeds.d/15-bookmarks.rb
Seeding /usr/share/foreman/db/seeds.d/16-mail_notifications.rb
Seeding /usr/share/foreman/db/seeds.d/17-notification_blueprints.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.1/db/seeds.d/20-foreman_tasks_permissions.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.1/db/seeds.d/60-dynflow_proxy_feature.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.3.1/db/seeds.d/60-ssh_proxy_feature.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.1/db/seeds.d/61-foreman_tasks_bookmarks.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-1.4.5/db/seeds.d/62_ansible_proxy_feature.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_azure-1.3.1/db/seeds.d/70-cloudapp-domain.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.3.1/db/seeds.d/70-job_templates.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.0.2/db/seeds.d/75-job_templates.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-8.0.2/db/seeds.d/75-salt_seeds.rb
foreman-rake db:seed failed! Check the output for error!
Upgrade step db_seed failed. Check logs for more information.

Actions #13

Updated by Marek Hulán almost 7 years ago

The problem Rob Sanders reports seems to be caused by foreman_salt not using the plugin DSL for seeding roles but rather doing it its own way - https://github.com/theforeman/foreman_salt/blob/master/db/seeds.d/75-salt_seeds.rb

Actions #14

Updated by Marek Hulán almost 7 years ago

This fix for #19039 - PR https://github.com/theforeman/foreman/pull/4415 contains the fix. If we need to fix it for 1.15.z and #19039 would not be acceptable for stable branch, here's the patch that should help.

diff --git a/app/registries/foreman/plugin.rb b/app/registries/foreman/plugin.rb
index dd0e343..4e2ffc3 100644
--- a/app/registries/foreman/plugin.rb
+++ b/app/registries/foreman/plugin.rb
@@ -245,7 +245,9 @@ module Foreman #:nodoc:
       return false if pending_migrations || Rails.env.test?
       Role.transaction do
         role = Role.where(:name => name).first_or_create
-        role.add_permissions!(permissions) if role.permissions.empty?
+        role.ignore_locking do
+          role.add_permissions!(permissions) if role.permissions.empty?
+        end
         rbac_registry.role_ids << role.id
       end
     rescue PermissionMissingException => e

Actions #15

Updated by Ido Kaplan almost 7 years ago

Hi,

I'm getting the same error when upgrading from "1.14.3" to "1.15.1".
It looks like that the upgrade finished successfully and foreman is running, but there is still error when running "foreman-rake db:seed".
In addition, tried to patch the file "/usr/share/foreman/app/services/foreman/plugin.rb", but still getting the same error.

Please advise.
Thanks,
Ido

Seeding /usr/share/foreman/db/seeds.d/02-permissions_list.rb
Seeding /usr/share/foreman/db/seeds.d/02-roles_list.rb
Seeding /usr/share/foreman/db/seeds.d/03-auth_sources.rb
Seeding /usr/share/foreman/db/seeds.d/03-permissions.rb
Seeding /usr/share/foreman/db/seeds.d/03-roles.rb
Seeding /usr/share/foreman/db/seeds.d/04-admin.rb
Seeding /usr/share/foreman/db/seeds.d/05-taxonomies.rb
Seeding /usr/share/foreman/db/seeds.d/06-architectures.rb
Seeding /usr/share/foreman/db/seeds.d/07-data.rb
Seeding /usr/share/foreman/db/seeds.d/07-provisioning_templates.rb
Seeding /usr/share/foreman/db/seeds.d/08-data.rb
Seeding /usr/share/foreman/db/seeds.d/08-partition_tables.rb
Seeding /usr/share/foreman/db/seeds.d/10-installation_media.rb
Seeding /usr/share/foreman/db/seeds.d/11-smart_proxy_features.rb
Seeding /usr/share/foreman/db/seeds.d/13-compute_profiles.rb
Seeding /usr/share/foreman/db/seeds.d/15-bookmarks.rb
Seeding /usr/share/foreman/db/seeds.d/16-mail_notifications.rb
Seeding /usr/share/foreman/db/seeds.d/17-notification_blueprints.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.1/db/seeds.d/20-foreman_tasks_permissions.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-9.0.0/db/seeds.d/50_discovery_templates.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.1/db/seeds.d/60-dynflow_proxy_feature.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-9.0.0/db/seeds.d/60_discovery_proxy_feature.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.1/db/seeds.d/61-foreman_tasks_bookmarks.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-9.0.0/db/seeds.d/70_discovery_mail_notification.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-8.0.2/db/seeds.d/75-salt_seeds.rb
rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Filters.role is locked for user modifications.
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/validations.rb:79:in `raise_record_invalid'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/validations.rb:43:in `save!'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:291:in `block in save!'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
/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'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:291:in `save!'
/usr/share/foreman/app/models/role.rb:154:in `add_permissions!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-8.0.2/db/seeds.d/75-salt_seeds.rb:9:in `block in <top (required)>'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:in `each'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-8.0.2/db/seeds.d/75-salt_seeds.rb:8:in `<top (required)>'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `block in load'
/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:268:in `load'
/usr/share/foreman/db/seeds.rb:38:in `block in <top (required)>'
/usr/share/foreman/db/seeds.rb:36:in `each'
/usr/share/foreman/db/seeds.rb:36:in `<top (required)>'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `block in load'
/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:268:in `load'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:547:in `load_seed'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:250:in `load_seed'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/databases.rake:183:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:seed
(See full trace by running task with --trace)

Actions #16

Updated by Marek Hulán almost 7 years ago

Ido, the patch mentioned here only works for the trace that Sandro encountered. Your (and Robs) trace is caused by the foreman_salt plugin that tries to seed permissions in non-standard way https://github.com/theforeman/foreman_salt/blob/master/db/seeds.d/75-salt_seeds.rb#L9

It should use this Foreman DSL http://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin#Adding-roles

EDIT: I suggest you open issue at http://projects.theforeman.org/projects/salt

Actions #17

Updated by Marek Hulán almost 7 years ago

  • Description updated (diff)
Actions #18

Updated by Ido Kaplan almost 7 years ago

OK, Thanks, I have opened a ticket.

Can you please help me to understand why this error occurs since the upgrade and what is the impact of this issue?

Actions #19

Updated by Marek Hulán almost 7 years ago

  • Related to Bug #20055: Salt seeds cannot run due to role locking on 1.15 added
Actions #20

Updated by Tomer Brisker almost 7 years ago

  • Has duplicate Bug #20099: Passanger not starting after upgrading from 1.15.0 to 1.15.1 ( Centos 7.3 ) added
Actions #21

Updated by Tomer Brisker almost 7 years ago

  • translation missing: en.field_release set to 266

Looks like the issue here is triggered by setting 'fix_db_cache' to true, as that triggers a save of all filters.
Setting as blocker for 1.15.2, as this can cause upgrade to fail and break the system.

Actions #22

Updated by The Foreman Bot almost 7 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Daniel Lobato Garcia
  • Pull request https://github.com/theforeman/foreman/pull/4623 added
Actions #23

Updated by Anonymous over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF