theforeman / foreman_expire_hosts

Foreman plugin for limiting host lifetime
GNU General Public License v3.0
5 stars 12 forks source link

Database seeding broken with Foreman 3.4 #67

Closed dgoetz closed 1 year ago

dgoetz commented 2 years ago

When trying to seed the database with Foreman 3.4 I get the following error:

 /usr/sbin/foreman-rake db:seed
Rubocop not loaded.
Rubocop not loaded.
Rubocop not loaded.
rake aborted!
ActiveModel::UnknownAttributeError: unknown attribute 'description' for Setting::ExpireHosts.
/usr/share/gems/gems/activemodel-6.1.6.1/lib/active_model/attribute_assignment.rb:51:in `_assign_attribute'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/attribute_assignment.rb:21:in `block in _assign_attributes'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/attribute_assignment.rb:13:in `each'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/attribute_assignment.rb:13:in `_assign_attributes'
/usr/share/gems/gems/activemodel-6.1.6.1/lib/active_model/attribute_assignment.rb:34:in `assign_attributes'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/core.rb:518:in `initialize'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/inheritance.rb:72:in `new'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/inheritance.rb:72:in `new'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/persistence.rb:54:in `create!'
/usr/share/gems/gems/foreman_expire_hosts-7.0.4/app/models/setting/expire_hosts.rb:18:in `block (2 levels) in load_defaults'
/usr/share/gems/gems/foreman_expire_hosts-7.0.4/app/models/setting/expire_hosts.rb:18:in `each'
/usr/share/gems/gems/foreman_expire_hosts-7.0.4/app/models/setting/expire_hosts.rb:18:in `block in load_defaults'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/transactions.rb:209:in `transaction'
/usr/share/gems/gems/foreman_expire_hosts-7.0.4/app/models/setting/expire_hosts.rb:10:in `load_defaults'
/usr/share/foreman/app/services/setting_registry.rb:114:in `each'
/usr/share/foreman/app/services/setting_registry.rb:114:in `load'
/usr/share/foreman/config/initializers/foreman.rb:37:in `block in <top (required)>'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:427:in `instance_exec'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:427:in `block in make_lambda'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:603:in `catch'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:603:in `block in default_terminator'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:199:in `block in halting'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:512:in `block in invoke_before'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:512:in `each'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:512:in `invoke_before'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:105:in `run_callbacks'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:88:in `prepare!'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/initializable.rb:32:in `instance_exec'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/initializable.rb:32:in `run'
/usr/share/foreman/config/initializers/0_print_time_spent.rb:45:in `block in run'
/usr/share/foreman/config/initializers/0_print_time_spent.rb:17:in `benchmark'
/usr/share/foreman/config/initializers/0_print_time_spent.rb:45:in `run'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/initializable.rb:60:in `run_initializers'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/application.rb:391:in `initialize!'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `public_send'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `method_missing'
/usr/share/foreman/config/environment.rb:5:in `<top (required)>'
/usr/share/gems/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:332:in `block in require'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:332:in `require'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/application.rb:367:in `require_environment!'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/application.rb:533:in `block in run_tasks_blocks'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:seed => db:load_config => environment
(See full trace by running task with --trace)
evgeni commented 1 year ago

this has been fixed in https://github.com/theforeman/foreman_expire_hosts/commit/0ee94ca9028d08aec00f862df827e434cc8c4f5a