Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations broken in 4-0-stable branch #12360

Closed
moonglum opened this issue Sep 25, 2013 · 5 comments
Closed

Migrations broken in 4-0-stable branch #12360

moonglum opened this issue Sep 25, 2013 · 5 comments

Comments

@moonglum
Copy link

The most current version of the 4-0-stable branch is broken when migrating. For a full test run see our Travis Build. Switched back to the 4.0.0 release from Ruby Gems for now, it's working again.

rake aborted!
An error has occurred, all later migrations canceled:

undefined method `[]' for nil:NilClass/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/attribute_methods/read.rb:86:in `block in read_attribute'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/attribute_methods/read.rb:84:in `fetch'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/attribute_methods/read.rb:84:in `read_attribute'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/attribute_methods.rb:243:in `block in attributes'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/attribute_methods.rb:242:in `each'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/attribute_methods.rb:242:in `each_with_object'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/attribute_methods.rb:242:in `attributes'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/attribute_methods/dirty.rb:84:in `keys_for_partial_write'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/attribute_methods/dirty.rb:78:in `create_record'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/callbacks.rb:303:in `block in create_record'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activesupport/lib/active_support/callbacks.rb:373:in `_run__2376870849983964261__create__callbacks'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activesupport/lib/active_support/callbacks.rb:80:in `run_callbacks'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/callbacks.rb:303:in `create_record'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/timestamp.rb:57:in `create_record'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/persistence.rb:467:in `create_or_update'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/callbacks.rb:299:in `block in create_or_update'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activesupport/lib/active_support/callbacks.rb:373:in `_run__2376870849983964261__save__callbacks'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activesupport/lib/active_support/callbacks.rb:80:in `run_callbacks'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/callbacks.rb:299:in `create_or_update'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/persistence.rb:128:in `save!'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/validations.rb:57:in `save!'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/attribute_methods/dirty.rb:41:in `save!'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/transactions.rb:275:in `block in save!'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/transactions.rb:326:in `block in with_transaction_returning_status'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `block in transaction'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in `within_new_transaction'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `transaction'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/transactions.rb:209:in `transaction'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/transactions.rb:323:in `with_transaction_returning_status'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/transactions.rb:275:in `save!'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/protected_attributes-1.0.3/lib/active_record/mass_assignment_security/validations.rb:17:in `create!'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/migration.rb:990:in `record_version_state_after_migrating'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/migration.rb:960:in `block in execute_migration_in_transaction'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/migration.rb:1007:in `ddl_transaction'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/migration.rb:958:in `execute_migration_in_transaction'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/migration.rb:920:in `block in migrate'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/migration.rb:916:in `each'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/migration.rb:916:in `migrate'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/migration.rb:764:in `up'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/migration.rb:742:in `migrate'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-bea5e32955f6/activerecord/lib/active_record/railties/databases.rake:42:in `block (2 levels) in <top (required)>'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/Users/moonglum/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bin/rake:23:in `load'
/Users/moonglum/.rvm/gems/ruby-2.0.0-p247/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate
@moonglum
Copy link
Author

Just out of curiosity: What exactly is the difference between the 4-0-stable and the master branch? They are at the same commit. Is everything pushed there as well?

@rafaelfranca
Copy link
Member

Master is 4.1, 4-0-stable is 4.0

@moonglum
Copy link
Author

Here's the Travis output for the same code, except that it's using 4.0.0 instead of 4-0-stable. It works.
(But it throws some warnings, this is why I switched to 4-0-stable)

@rafaelfranca
Copy link
Member

Make sure you are using protected_attributes master too. The released protected_attributes has a bug with current 4-0-stable.

@moonglum
Copy link
Author

Thanks 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants