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

NoMethodError: undefined method `indexes' for nil:NilClass #6

Open
fabiokr opened this issue May 3, 2017 · 0 comments
Open

NoMethodError: undefined method `indexes' for nil:NilClass #6

fabiokr opened this issue May 3, 2017 · 0 comments

Comments

@fabiokr
Copy link

fabiokr commented May 3, 2017

Hello, I'm getting that error when schema_validations run for a model. It is triggered when updating a record on a Sidekiq Worker. Restarting Sidekiq seems to fix it, but it will eventually happen again. Maybe a database connection reload issue?

  • Rails 5.0.2
  • Sidekiq 4.2.9
  • schema_validations 2.2.1
  • schema_plus_columns 0.1.3

Stack trace is below:

[GEM_ROOT]/gems/schema_plus_columns-0.1.3/lib/schema_plus/columns/active_record/connection_adapters/column.rb:16 :in `indexes`
 [GEM_ROOT]/gems/schema_plus_columns-0.1.3/lib/schema_plus/columns/active_record/connection_adapters/column.rb:31 :in `unique?`
 [GEM_ROOT]/gems/schema_validations-2.2.1/lib/schema_validations/active_record/validations.rb:166 :in `block in load_association_validations`
 [GEM_ROOT]/gems/schema_validations-2.2.1/lib/schema_validations/active_record/validations.rb:156 :in `each`
 [GEM_ROOT]/gems/schema_validations-2.2.1/lib/schema_validations/active_record/validations.rb:156 :in `load_association_validations`
 [GEM_ROOT]/gems/schema_validations-2.2.1/lib/schema_validations/active_record/validations.rb:89 :in `load_schema_validations`
 [GEM_ROOT]/gems/schema_validations-2.2.1/lib/schema_validations/active_record/validations.rb:6 :in `load_schema_validations`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:382 :in `block in make_lambda`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:169 :in `block (2 levels) in halting`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:770 :in `block (2 levels) in deprecated_false_terminator`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:769 :in `catch`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:769 :in `block in deprecated_false_terminator`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:170 :in `block in halting`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:454 :in `block in call`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:454 :in `each`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:454 :in `call`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:448 :in `block (2 levels) in around`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:286 :in `block (2 levels) in halting`
 [GEM_ROOT]/gems/state_machines-activemodel-0.4.0/lib/state_machines/integrations/active_model.rb:400 :in `block in around_validation`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:150 :in `block in run_actions`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:170 :in `catch_exceptions`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:148 :in `run_actions`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:133 :in `run_callbacks`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:212 :in `run_callbacks`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:63 :in `block (2 levels) in perform`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:63 :in `catch`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:63 :in `block in perform`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:186 :in `within_transaction`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:62 :in `perform`
 [GEM_ROOT]/gems/state_machines-activemodel-0.4.0/lib/state_machines/integrations/active_model.rb:400 :in `around_validation`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:405 :in `public_send`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:405 :in `block in make_lambda`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:285 :in `block in halting`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:447 :in `block in around`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:455 :in `call`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:101 :in `__run_callbacks__`
 [GEM_ROOT]/gems/activesupport-5.0.2/lib/active_support/callbacks.rb:750 :in `_run_validation_callbacks`
 [GEM_ROOT]/gems/activemodel-5.0.2/lib/active_model/validations/callbacks.rb:113 :in `run_validations!`
 [GEM_ROOT]/gems/activemodel-5.0.2/lib/active_model/validations.rb:338 :in `valid?`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/validations.rb:65 :in `valid?`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/validations.rb:82 :in `perform_validations`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/validations.rb:50 :in `save!`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/attribute_methods/dirty.rb:30 :in `save!`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/transactions.rb:324 :in `block in save!`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/transactions.rb:395 :in `block in with_transaction_returning_status`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:230 :in `transaction`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/transactions.rb:211 :in `transaction`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/transactions.rb:392 :in `with_transaction_returning_status`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/transactions.rb:324 :in `save!`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/suppressor.rb:45 :in `save!`
 [GEM_ROOT]/gems/state_machines-activerecord-0.4.0/lib/state_machines/integrations/active_record.rb:505 :in `block in save!`
 [GEM_ROOT]/gems/state_machines-activerecord-0.4.0/lib/state_machines/integrations/active_record.rb:520 :in `block in around_save`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:150 :in `block in run_actions`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:170 :in `catch_exceptions`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:148 :in `run_actions`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:133 :in `run_callbacks`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:212 :in `run_callbacks`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:63 :in `block (2 levels) in perform`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:63 :in `catch`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:63 :in `block in perform`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:186 :in `within_transaction`
 [GEM_ROOT]/gems/state_machines-0.4.0/lib/state_machines/transition_collection.rb:62 :in `perform`
 [GEM_ROOT]/gems/state_machines-activerecord-0.4.0/lib/state_machines/integrations/active_record.rb:520 :in `around_save`
 [GEM_ROOT]/gems/state_machines-activerecord-0.4.0/lib/state_machines/integrations/active_record.rb:505 :in `save!`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/persistence.rb:280 :in `block in update!`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/transactions.rb:395 :in `block in with_transaction_returning_status`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:232 :in `block in transaction`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/transaction.rb:189 :in `within_new_transaction`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:232 :in `transaction`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/transactions.rb:211 :in `transaction`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/transactions.rb:392 :in `with_transaction_returning_status`
 [GEM_ROOT]/gems/activerecord-5.0.2/lib/active_record/persistence.rb:278 :in `update!`
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

1 participant