Failed migration: ActiveRecord::RecordNotFound: Couldn't find Badge with 'id'=9


(Eyal Levin) #1

Using vagrant for development, when I run

bundle exec rake db:migrate

I get:

== Seed from /vagrant/db/fixtures/005_users.rb
 - User {:id=>-1, :name=>"system", :username=>"system", :username_lower=>"system", :email=>"no_email", :password=>"2db06fedb92f03f6c95390c085c9d04c", :active=>true, :admin=>true, :moderator=>true, :email_direct=>false, :approved=>true, :email_private_messages=>false, :trust_level=>4}
rake aborted!
ActiveRecord::RecordNotFound: Couldn't find Badge with 'id'=9
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/runner.rb:46:in `eval'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/relation/finder_methods.rb:420:in `find_one'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/relation/finder_methods.rb:404:in `find_with_ids'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/relation/finder_methods.rb:68:in `find'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/querying.rb:3:in `find'
/vagrant/app/models/user.rb:627:in `grant_autobiographer'
/vagrant/app/models/user.rb:614:in `refresh_avatar'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:424:in `block in make_lambda'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:221:in `call'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:221:in `block in halting_and_conditional'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:215:in `call'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:86:in `call'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activesupport-4.1.4/lib/active_support/callbacks.rb:86:in `run_callbacks'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/callbacks.rb:302:in `create_or_update'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/persistence.rb:103:in `save'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/validations.rb:51:in `save'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/attribute_methods/dirty.rb:21:in `save'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/transactions.rb:268:in `block (2 levels) in save'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:199:in `transaction'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/transactions.rb:208:in `transaction'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/transactions.rb:268:in `block in save'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/transactions.rb:283:in `rollback_active_record_state!'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/transactions.rb:267:in `save'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/seeder.rb:74:in `seed_record'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/seeder.rb:36:in `block (2 levels) in seed'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/seeder.rb:36:in `map'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/seeder.rb:36:in `block in seed'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:199:in `transaction'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/transactions.rb:208:in `transaction'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/seeder.rb:35:in `seed'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/active_record_extension.rb:32:in `seed'
(eval):9:in `block (2 levels) in run_file'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/runner.rb:46:in `eval'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/runner.rb:46:in `block (2 levels) in run_file'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/runner.rb:58:in `block in open'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/runner.rb:57:in `open'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/runner.rb:57:in `open'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/runner.rb:36:in `block in run_file'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.4/lib/active_record/transactions.rb:208:in `transaction'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/runner.rb:35:in `run_file'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/runner.rb:26:in `block in run'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/runner.rb:25:in `each'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu/runner.rb:25:in `run'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/seed-fu-discourse-2.2.1/lib/seed-fu.rb:29:in `seed'
/vagrant/lib/tasks/db.rake:3:in `block in <top (required)>'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

EDIT: commit f5a94bf668e44987a9877ccddffac089be89050a


(Sam Saffron) #2

Oh my, we really need to get the vagrant setup on a recent version of Ruby.

Anyone else seeing this issue?


(Neil Lalonde) #3

Yes we’re seeing this too. Looking at it now.


(Sam Saffron) #4

Ok found the bug, seed file order is incorrect


(Jeff Atwood) #5