Project

General

Profile

Actions

Bug #26344

closed

db:seed after fails when upgrading to 1.21

Added by Emil Dragu about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
DB migrations
Target version:
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Hi, after upgrading to 1.21, running foreman-rake db:seed fails with the following errors:

Seeding /usr/share/foreman/db/seeds.d/020-permissions_list.rb
Seeding /usr/share/foreman/db/seeds.d/020-roles_list.rb
Seeding /usr/share/foreman/db/seeds.d/030-auth_sources.rb
Seeding /usr/share/foreman/db/seeds.d/030-permissions.rb
Seeding /usr/share/foreman/db/seeds.d/035-admin.rb
Seeding /usr/share/foreman/db/seeds.d/040-roles.rb
Seeding /usr/share/foreman/db/seeds.d/050-taxonomies.rb
rake aborted!
ActiveRecord::HasManyThroughNestedAssociationsAreReadonly: Cannot modify association 'Location#puppetclasses' because it goes through more than one other association.
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/through_association.rb:104:in `ensure_not_nested'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/has_many_through_association.rb:132:in `delete_records'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/collection_association.rb:400:in `remove_records'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/has_many_through_association.rb:108:in `remove_records'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/collection_association.rb:393:in `block in delete_or_destroy'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/collection_association.rb:136:in `block in transaction'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:257:in `transaction'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/transactions.rb:212:in `transaction'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/collection_association.rb:135:in `transaction'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/collection_association.rb:393:in `delete_or_destroy'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/collection_association.rb:190:in `delete'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/collection_association.rb:414:in `replace_records'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/collection_association.rb:252:in `block in replace'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/collection_association.rb:136:in `block in transaction'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:259:in `block in transaction'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:259:in `transaction'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/transactions.rb:212:in `transaction'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/collection_association.rb:135:in `transaction'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/collection_association.rb:252:in `replace'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/collection_association.rb:41:in `writer'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/associations/builder/association.rb:116:in `puppetclasses='
/usr/share/foreman/db/seeds.d/050-taxonomies.rb:17:in `block (4 levels) in <top (required)>'
/usr/share/foreman/db/seeds.d/050-taxonomies.rb:16:in `each'
/usr/share/foreman/db/seeds.d/050-taxonomies.rb:16:in `block (3 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.1/lib/audited/auditor.rb:336:in `without_auditing'
/usr/share/foreman/db/seeds.d/050-taxonomies.rb:8:in `block (2 levels) in <top (required)>'
/usr/share/foreman/db/seeds.d/050-taxonomies.rb:7:in `each'
/usr/share/foreman/db/seeds.d/050-taxonomies.rb:7:in `block in <top (required)>'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:100:in `as'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:106:in `as_anonymous_admin'
/usr/share/foreman/db/seeds.d/050-taxonomies.rb:6:in `<top (required)>'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `load'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `block in load'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `load'
/usr/share/foreman/db/seeds.rb:36:in `block (2 levels) in <top (required)>'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:100:in `as'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:106:in `as_anonymous_admin'
/usr/share/foreman/db/seeds.rb:35:in `block in <top (required)>'
/usr/share/foreman/db/seeds.rb:29:in `each'
/usr/share/foreman/db/seeds.rb:29:in `<top (required)>'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `load'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `block in load'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `load'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/railties-5.2.2/lib/rails/engine.rb:551:in `load_seed'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:281:in `load_seed'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/activerecord-5.2.2/lib/active_record/railties/databases.rake:194:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby25/root/usr/local/share/gems/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'

Should puppetclasses be ignored also?

Actions #1

Updated by Tomer Brisker about 5 years ago

  • Assignee set to Tomer Brisker
  • Priority changed from Normal to High
  • Target version set to 1.21.1
Actions #2

Updated by The Foreman Bot about 5 years ago

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

Updated by Marek Hulán about 5 years ago

  • Fixed in Releases 1.22.0 added
Actions #4

Updated by Tomer Brisker about 5 years ago

  • Fixed in Releases 1.21.1 added
Actions #5

Updated by Tomer Brisker about 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF