Project

General

Profile

Bug #4536

fix cache Rake task: undefined method `[]=' for #<Class:0x000000071ff110>

Added by Dominic Cleal over 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Urgent
Assignee:
Category:
DB migrations
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

When running foreman-rake db:migrate on a clean install (EL6, PostgreSQL), it runs all through the migrations and throws an error from the fix_cache rake task:

undefined method `[]=' for #<Class:0x00000007951e90>
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/dynamic_matchers.rb:55:in `method_missing'
/usr/share/foreman/app/services/cache_manager.rb:21:in `recache!'
/usr/share/foreman/lib/tasks/fix_cache.rake:4:in `block in <top (required)>'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `call'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `block in execute'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `each'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `execute'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:158:in `block in invoke_with_call_chain'
/opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in `invoke_with_call_chain'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:144:in `invoke'
/usr/share/foreman/db/migrate/20140219183345_add_taxonomy_searches_to_filter.rb:14:in `block in up'

Also when re-running `foreman-rake fix_db_cache`, I'm getting:

Validation failed: Default is not included in the list
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:56:in `save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in `block in save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:in `transaction'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in `save!'
/usr/share/foreman/app/models/setting.rb:64:in `[]='
/usr/share/foreman/app/services/cache_manager.rb:21:in `recache!'
/usr/share/foreman/lib/tasks/fix_cache.rake:4:in `block in <top (required)>'

Associated revisions

Revision 1d1dc485 (diff)
Added by Marek Hulán over 5 years ago

Fixes #4536 - store fix_db_cache setting values correctly as YAML

History

#1 Updated by Dominic Cleal over 5 years ago

  • Status changed from Assigned to Ready For Testing
  • Legacy Backlogs Release (now unused) set to 4

#2 Updated by Marek Hulán over 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF