Bug #20231
closedrake db:seed fails
Description
Updating a foreman git checkout from a3213b1b4571f26a7427e3d43223cc696c3f0bf9
then running
bundle update
npm update
bundle exec rake db:migrate
bundle exec rake db:seed
fails in the last step with:
exec bin/rake db:seed Running via Spring preloader in process 4752 Seeding /var/scratch/src/foreman/foreman/db/seeds.d/02-partition_tables_list.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/02-permissions_list.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/02-provisioning_templates_list.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/02-roles_list.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/03-auth_sources.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/03-permissions.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/03-roles.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/04-admin.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/05-taxonomies.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/06-architectures.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/07-provisioning_templates.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/08-partition_tables.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/10-installation_media.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/11-smart_proxy_features.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/13-compute_profiles.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/15-bookmarks.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/16-mail_notifications.rb Seeding /var/scratch/src/foreman/foreman/db/seeds.d/17-notification_blueprints.rb rake aborted! JSON::ParserError: 784: unexpected token at 'null' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/store.rb:190:in `load' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/type/serialized.rb:58:in `default_value?' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/type/serialized.rb:16:in `type_cast_from_database' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute.rb:104:in `type_cast' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute.rb:42:in `original_value' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute.rb:37:in `value' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute_set.rb:31:in `fetch_value' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute_methods/read.rb:93:in `_read_attribute' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute_methods.rb:375:in `clone_attribute_value' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute_methods/dirty.rb:124:in `old_attribute_value' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute_methods/dirty.rb:95:in `write_attribute' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute_methods.rb:50:in `__temp__16364796f6e637' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute_assignment.rb:54:in `public_send' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute_assignment.rb:54:in `_assign_attribute' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute_assignment.rb:65:in `block in assign_nested_parameter_attributes' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute_assignment.rb:65:in `each' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute_assignment.rb:65:in `assign_nested_parameter_attributes' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute_assignment.rb:45:in `assign_attributes' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/persistence.rb:264:in `block in update!' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/transactions.rb:220:in `transaction' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/transactions.rb:348:in `with_transaction_returning_status' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/persistence.rb:263:in `update!' /var/scratch/src/foreman/foreman/app/services/ui_notifications/seed.rb:13:in `configure' /var/scratch/src/foreman/foreman/db/seeds.d/17-notification_blueprints.rb:38:in `block in <top (required)>' /var/scratch/src/foreman/foreman/db/seeds.d/17-notification_blueprints.rb:38:in `each' /var/scratch/src/foreman/foreman/db/seeds.d/17-notification_blueprints.rb:38:in `<top (required)>' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:268:in `load' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:268:in `block in load' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:240:in `load_dependency' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:268:in `load' /var/scratch/src/foreman/foreman/db/seeds.rb:38:in `block in <top (required)>' /var/scratch/src/foreman/foreman/db/seeds.rb:36:in `each' /var/scratch/src/foreman/foreman/db/seeds.rb:36:in `<top (required)>' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:268:in `load' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:268:in `block in load' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:240:in `load_dependency' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:268:in `load' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/railties-4.2.9/lib/rails/engine.rb:547:in `load_seed' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/tasks/database_tasks.rb:253:in `load_seed' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/railties/databases.rake:173:in `block (2 levels) in <top (required)>' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:268:in `load' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:268:in `block in load' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:240:in `load_dependency' /var/scratch/src/foreman/foreman/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:268:in `load' -e:1:in `<main>' Tasks: TOP => db:seed (See full trace by running task with --trace)
The line failing is
def load(yaml)
self.class.as_indifferent_hash(@coder.load(yaml || ''))
end
and yaml is ''. @coder.load('') fails with the empty string.
Updated by Daniel Lobato Garcia over 7 years ago
Does this happen on the latest develop version?
Updated by Guido Günther over 7 years ago
Daniel Lobato Garcia wrote:
Does this happen on the latest develop version?
It happened yesterday with ef217ff9da2085311dd7080ea05ba03f473975bf
and still fails today with 2be096df1c4d43800ef7f2e541dd9120559326d8.
The SHA1 I added above is the one I updated from (which was
working).
Updated by Anonymous over 7 years ago
I had this also some days ago - using the ruby-2.3 coming with Debian/testing, I guess that's the same configuration. However, with a fresh checkout today the problem went away for me.
Updated by Daniel Lobato Garcia over 7 years ago
Guido, can you try with the latest as Michael says? I haven't been able to reproduce either. There's been a similar issue recently fixed but the error is different.
Updated by Anonymous over 7 years ago
foreman core at 5a144e4bf516db2dff4ffb798ebeca19eccd624f should be fine (that was before the big changes of Friday)
Updated by Guido Günther over 7 years ago
- Status changed from New to Closed
Foo
Michael Moll wrote:
foreman core at 5a144e4bf516db2dff4ffb798ebeca19eccd624f should be fine (that was before the big changes of Friday)
Yes. That works. Thanks!