ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

uninitialized constant Journal::Journaled (Bug #467)


Added by Tom Rochette at 2011-06-11 03:26 am. Updated at 2011-07-08 09:17 pm.


Status:Closed Start date:2011-06-11
Priority:Normal Due date:
Assignee:Eric Davis % Done:

0%

Category:Journals / History
Target version:2.1.0
Remote issue URL: Affected version:2.0.0

Description

Trying to db:migrate my installation from a redmine 1.2.0, r6000 to chiliproject 2.0.0 (from current github).

rake db:migrate RAILS_ENV=production --trace
rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
==  GeneralizeJournals: migrating =============================================
-- change_table(:journals)
   -> 2.0073s
rake aborted!
An error has occurred, all later migrations canceled:

uninitialized constant Journal::Journaled
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:131:in `const_missing'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/base.rb:1:in `compute_type'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/base.rb:2234:in `compute_type'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/reflection.rb:156:in `send'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/reflection.rb:156:in `klass'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/associations/belongs_to_association.rb:51:in `find_target'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/associations/association_proxy.rb:236:in `load_target'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/associations/association_proxy.rb:113:in `reload'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/associations.rb:1256:in `journaled'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/associations.rb:1386:in `send'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/associations.rb:1386:in `belongs_to_touch_after_save_or_destroy_for_journaled'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:178:in `send'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:178:in `evaluate_method'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:166:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:93:in `run'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:92:in `each'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:92:in `send'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:92:in `run'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:276:in `run_callbacks'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:344:in `callback'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:251:in `create_or_update'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/base.rb:2577:in `save_without_validation'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/validations.rb:1090:in `save_without_dirty'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/dirty.rb:79:in `save_without_transactions'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/transactions.rb:229:in `send'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/transactions.rb:182:in `transaction'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/transactions.rb:196:in `save'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/transactions.rb:196:in `save'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/base.rb:2661:in `update_attribute'
./db/migrate//20100714111651_generalize_journals.rb:38:in `up_without_benchmarks'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/attribute_methods.rb:211:in `each_with_index'
./db/migrate//20100714111651_generalize_journals.rb:37:in `each'
./db/migrate//20100714111651_generalize_journals.rb:37:in `each_with_index'
./db/migrate//20100714111651_generalize_journals.rb:37:in `up_without_benchmarks'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each_pair'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each_pair'
./db/migrate//20100714111651_generalize_journals.rb:36:in `up_without_benchmarks'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `send'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `__send__'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `migrate'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:491:in `migrate'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `ddl_transaction'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:490:in `migrate'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `each'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `migrate'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:401:in `up'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:383:in `migrate'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-2.3.12/lib/tasks/databases.rake:112
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/bin/rake:32
/usr/local/rvm/gems/ruby-1.8.7-head/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.8.7-head/bin/rake:19
Tasks: TOP => db:migrate

0001-467-Fix-uninitialized-constant-Journal-Journaled-err.patch (1.6 kB) Eric Davis, 2011-06-16 05:47 pm


Associated revisions

Revision b52d2b22
Added by Eric Davis at 2011-06-17 06:13 pm

[#467] Fix uninitialized constant Journal::Journaled error

Was due to Journals touching the parent record but the Journal
not having it's STI class correct during the type update.

Revision 47c7e077
Added by Eric Davis at 2011-06-17 06:41 pm

[#467] Fix bug with Journal subclasses having caches columns

Revision 1fae552c
Added by Eric Davis at 2011-07-08 09:43 pm

[#467] Fix Journal#journaled to prevent uninitialized constant Journal::Journaled

History

Updated by Pedro Algarvio at 2011-06-15 05:31 pm

I've hit this too:

$ RAILS_ENV="production" script/about
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.12/lib/rails/gem_dependency.rb:21.
About your application's environment
Ruby version              1.8.7 (x86_64-linux)
RubyGems version          1.8.5
Rack version              1.1.2
Rails version             2.3.12
Active Record version     2.3.12
Active Resource version   2.3.12
Action Mailer version     2.3.12
Active Support version    2.3.12
Application root          /srv/chili
Environment               production
Database adapter          postgresql
Database schema version   20110511000000

And Trace:

$ rake db:migrate RAILS_ENV=production --trace
rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
==  GeneralizeJournals: migrating =============================================
-- change_table(:journals)
   -> 0.2588s
rake aborted!
An error has occurred, this and all later migrations canceled:

uninitialized constant Journal::Journaled
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:131:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:1:in `compute_type'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2234:in `compute_type'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/reflection.rb:156:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/reflection.rb:156:in `klass'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations/belongs_to_association.rb:51:in `find_target'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations/association_proxy.rb:236:in `load_target'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations/association_proxy.rb:113:in `reload'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations.rb:1256:in `journaled'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations.rb:1386:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations.rb:1386:in `belongs_to_touch_after_save_or_destroy_for_journaled'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:178:in `send'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:178:in `evaluate_method'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:166:in `call'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:93:in `run'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:92:in `each'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:92:in `send'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:92:in `run'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/callbacks.rb:276:in `run_callbacks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:344:in `callback'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:251:in `create_or_update'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2577:in `save_without_validation'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/validations.rb:1090:in `save_without_dirty'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/dirty.rb:79:in `save_without_transactions'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:229:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:182:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:196:in `save'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:196:in `save'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2661:in `update_attribute'
./db/migrate//20100714111651_generalize_journals.rb:38:in `up_without_benchmarks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/attribute_methods.rb:211:in `each_with_index'
./db/migrate//20100714111651_generalize_journals.rb:37:in `each'
./db/migrate//20100714111651_generalize_journals.rb:37:in `each_with_index'
./db/migrate//20100714111651_generalize_journals.rb:37:in `up_without_benchmarks'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each_pair'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each_pair'
./db/migrate//20100714111651_generalize_journals.rb:36:in `up_without_benchmarks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `__send__'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:491:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:565:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:565:in `ddl_transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:182:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:565:in `ddl_transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:490:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `each'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:401:in `up'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:383:in `migrate'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.12/lib/tasks/databases.rake:112
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Tasks: TOP => db:migrate

Updated by Pedro Algarvio at 2011-06-15 08:37 pm

Checkout

731de487e4ad35f738c9
do the upgrade again, it will fail but will go past the migration step here.

Then checkout

release-2.0.0
again and run the migration again.

I'm now stuck on:

$ RAILS_ENV=production rake db:migrate --trace
rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
==  MergeWikiVersionsWithJournals: migrating ==================================
rake aborted!
An error has occurred, this and all later migrations canceled:

PGError: ERROR:  null value in column "user_id" violates not-null constraint
: INSERT INTO "journals" ("created_at", "notes", "journaled_id", "user_id", "version", "type", "changes", "activity_type") VALUES('2011-06-15 21:33:27.983503', NULL, 5, NULL, 0, 'WikiContentJournal', NULL, 'wiki_edits') RETURNING "id" 
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/postgresql_adapter.rb:520:in `execute'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/postgresql_adapter.rb:1002:in `select_raw'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/postgresql_adapter.rb:989:in `select'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all_without_query_cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/query_cache.rb:62:in `select_all'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:13:in `select_one'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:19:in `select_value'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/postgresql_adapter.rb:460:in `insert'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2961:in `create_without_timestamps'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/timestamp.rb:53:in `create_without_callbacks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:266:in `create'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2927:in `create_or_update_without_callbacks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:250:in `create_or_update'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2594:in `save_without_validation!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/validations.rb:1100:in `save_without_dirty!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/dirty.rb:87:in `save_without_transactions!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:200:in `save!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:182:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:200:in `save!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:200:in `save!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/validations.rb:1071:in `create!'
./db/migrate//20100804112053_merge_wiki_versions_with_journals.rb:22:in `up_without_benchmarks'
./db/migrate//20100804112053_merge_wiki_versions_with_journals.rb:21:in `each'
./db/migrate//20100804112053_merge_wiki_versions_with_journals.rb:21:in `up_without_benchmarks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `__send__'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:491:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:565:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:565:in `ddl_transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:182:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:565:in `ddl_transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:490:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `each'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:401:in `up'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:383:in `migrate'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.12/lib/tasks/databases.rake:112
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Tasks: TOP => db:migrate

Updated by Pedro Algarvio at 2011-06-15 08:49 pm

After hard-coding the user_id to my own user_id in case of null, the migration was completed.

Updated by Tom Rochette at 2011-06-15 10:56 pm

@Pedro: Before saying that the migration was completed, have you checked that your issues history are present? It's not worth doing what you did if you lose information in the process...

Updated by Pedro Algarvio at 2011-06-16 07:11 am

Tom Rochette wrote:

@Pedro: Before saying that the migration was completed, have you checked that your issues history are present? It's not worth doing what you did if you lose information in the process...

Can't say that all history was kept, but most of it seems to be there.

Updated by Gregor Schmidt at 2011-06-16 10:10 am

The user_id thing might be related to the fact, that you deleted users in Redmine 1.2, which is not supported in ChiliProject. This seems to be a common issue when migrating from R 1.2 to Chili.

Updated by Pedro Algarvio at 2011-06-16 10:14 am

Gregor Schmidt wrote:

The user_id thing might be related to the fact, that you deleted users in Redmine 1.2, which is not supported in ChiliProject. This seems to be a common issue when migrating from R 1.2 to Chili.

I did delete some accounts, at first by mistake, then on purpose.

Accounts cannot be deleted? Any specific reason why?

Updated by Eric Davis at 2011-06-16 04:45 pm

Pedro Algarvio wrote:

I did delete some accounts, at first by mistake, then on purpose.

Accounts cannot be deleted? Any specific reason why?

The way Redmine deletes users is by nulling out all of the records in the database, which means that all code that uses a user now can fail with a null. Like in this example. Full discussion here: https://www.chiliproject.org/boards/2/topics/70

Tom Rochette:

I just got the uninitialized constant Journal::Journaled error while upgrading a client. Debugging now.

  • Assignee set to Eric Davis

Updated by Eric Davis at 2011-06-16 05:47 pm

Believe I've fixed this. I'm in the middle of a client merge so I can't test in an isolated environment (and this client has too much data to test with). I'll check and commit tomorrow.

The bug was due to Journals touching the parent record (#441) but the Journal not having it's STI class correct during the type update.

  • (deleted custom field) set to unstable
  • Status changed from Open to Ready for review
  • File 0001-467-Fix-uninitialized-constant-Journal-Journaled-err.patch added

Updated by Tom Rochette at 2011-06-17 12:05 am

I've applied your patch. Still fails, but a bit later :) It seems that I have some journalized_type that are empty, is that normal?

rake db:migrate RAILS_ENV=production --trace
rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
==  GeneralizeJournals: migrating =============================================
-- change_table(:journals)
   -> 2.8210s
rake aborted!
An error has occurred, all later migrations canceled:

undefined method `activity_provider_options' for Object:Class
./db/migrate//20100714111651_generalize_journals.rb:44:in `up_without_benchmarks'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/attribute_methods.rb:211:in `each_with_index'
./db/migrate//20100714111651_generalize_journals.rb:37:in `each'
./db/migrate//20100714111651_generalize_journals.rb:37:in `each_with_index'
./db/migrate//20100714111651_generalize_journals.rb:37:in `up_without_benchmarks'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each_pair'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each_pair'
./db/migrate//20100714111651_generalize_journals.rb:36:in `up_without_benchmarks'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `send'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `__send__'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `migrate'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:491:in `migrate'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `ddl_transaction'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:490:in `migrate'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `each'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `migrate'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:401:in `up'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:383:in `migrate'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-2.3.12/lib/tasks/databases.rake:112
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/bin/rake:32
/usr/local/rvm/gems/ruby-1.8.7-head/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.8.7-head/bin/rake:19
Tasks: TOP => db:migrate

Updated by Eric Davis at 2011-06-17 03:27 pm

Tom Rochette:

It seems that I have some journalized_type that are empty, is that normal?

No, that doesn't seem right at all. Let me commit this patch and a few more bug fixes I made yesterday and have you re-run the migrations. You will need to restore your database from a backup, these bugs might have put the data into an odd state.

Updated by Eric Davis at 2011-06-17 04:43 pm

Applied my patch and another one that fixes a bug where IssueJournal still had a journalized_type field which caused the inserts to fail.

Tom Rochette: I have a few more commits to add so don't worry about testing yet.

  • Status changed from Ready for review to Closed

Updated by Artem Naluzhnyy at 2011-06-19 04:52 am

Migration to 2.0.0RC3:

# rake db:migrate RAILS_ENV=production --trace
(in /storage/www/chiliproject)
NOTE: Gem::SourceIndex#all_gems is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::SourceIndex#all_gems called from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/rubygems_integration.rb:256
.
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
==  PrepareJournalsForActsAsJournalized: migrating ============================
-- change_table(:journals)
   -> 0.3056s
==  PrepareJournalsForActsAsJournalized: migrated (0.3062s) ===================

==  UpdateJournalsForActsAsJournalized: migrating =============================
-- Updating existing Journals...
rake aborted!
An error has occurred, all later migrations canceled:

uninitialized constant Journal::Journaled
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:131:in `const_missing'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:1:in `compute_type'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2234:in `compute_type'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/reflection.rb:156:in `send'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/reflection.rb:156:in `klass'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations/belongs_to_association.rb:51:in `find_target'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations/association_proxy.rb:236:in `load_target'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations/association_proxy.rb:113:in `reload'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations.rb:1256:in `journaled'
/storage/www/chiliproject/app/models/journal.rb:99:in `method_missing'
./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:12:in `up_without_benchmarks'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/attribute_methods.rb:211:in `each_with_index'
./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:10:in `each'
./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:10:in `each_with_index'
./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:10:in `up_without_benchmarks'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each_pair'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each_pair'
./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:9:in `up_without_benchmarks'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:328:in `say_with_time'
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:328:in `say_with_time'
./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:8:in `up_without_benchmarks'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `send'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `migrate'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:491:in `migrate'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `call'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `ddl_transaction'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:490:in `migrate'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `each'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `migrate'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:401:in `up'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:383:in `migrate'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.12/lib/tasks/databases.rake:112
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19
Tasks: TOP => db:migrate
  • Status changed from Closed to Open

Updated by Tom Rochette at 2011-06-25 01:06 am

Eric Davis wrote:

Tom Rochette: I have a few more commits to add so don't worry about testing yet.

Any ETA on that? I've tried the RC3 with still no success (not related to this bug though).

What I got was errors with TimeEntryJournal not existing. A quick test showed that for some reason TimeEntry (and associated TimeEntryJournal) are not loaded when applying the db migration (by printing out Module.constants).

Updated by Eric Davis at 2011-06-27 10:10 pm

Artem Naluzhnyy wrote:

Migration to 2.0.0RC3:

Thanks, I'll take a look at this.

Tom Rochette wrote:

Any ETA on that? I've tried the RC3 with still no success (not related to this bug though).

If it's not related to this bug, could you open another issue for it? Having separate issues will make it easier to track them all down.

Updated by Eric Davis at 2011-06-27 11:16 pm

Artem Naluzhnyy:

Can you switch to this branch and try running the migrations again? I put some debugging statements to hopefully track down why you are still getting this error on your data. The migration will fail, but it should print some output to the console before it fails.

https://github.com/edavis10/chiliproject/tree/ticket%2Frelease-v2.0.0%2F467-debug

Thanks

  • Status changed from Open to Needs more information

Updated by Eric Davis at 2011-07-01 10:16 pm

Moving out of 2.0.0 until Artem Naluzhnyy and I can debug the source of the error.

  • Target version deleted (2.0.0)

Updated by Winti Winti at 2011-07-02 04:43 pm

i have this problem as well...

mysql> drop database chiliproject;
Query OK, 82 rows affected (0.10 sec)

mysql> create database chiliproject character set utf8;
Query OK, 1 row affected (0.00 sec)

mysql> quit;
Bye
root@wstubuntu:/opt/test/chiliproject# mysql -u root -p chiliproject < /opt/chiliproject/chiliprod.dmp 
Enter password: 
root@wstubuntu:/opt/test/chiliproject# RAILS_ENV=production rake db:migrate --trace 
(in /opt/test/chiliproject)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
==  PrepareJournalsForActsAsJournalized: migrating ============================
-- change_table(:journals)
   -> 0.3607s
==  PrepareJournalsForActsAsJournalized: migrated (0.3610s) ===================

==  UpdateJournalsForActsAsJournalized: migrating =============================
-- Updating existing Journals...
Error saving: IssueJournal#3 - Validation failed: Project can't be blank
   -> 49.5505s
-- change_table(:journals)
   -> 0.0508s
==  UpdateJournalsForActsAsJournalized: migrated (49.6015s) ===================

==  BuildInitialJournalsForActsAsJournalized: migrating =======================
-- Building initial journals for Message
   -> 0.2039s
-- Building initial journals for Attachment
   -> 2.5800s
-- Building initial journals for Document
ERROR: errors creating the initial journal for Document#1:
  Validation failed: Project can't be blank
   -> 0.3498s
-- Building initial journals for Changeset
   -> 1.1175s
-- Building initial journals for WikiContent
   -> 0.5453s
-- Building initial journals for Issue
ERROR: errors creating the initial journal for Issue#7:
  Validation failed: Project can't be blank
   -> 56.7281s
-- Building initial journals for TimeEntry
   -> 2.9257s
-- Building initial journals for News
   -> 0.1810s
==  BuildInitialJournalsForActsAsJournalized: migrated (64.6407s) =============

==  AddChangesFromJournalDetailsForActsAsJournalized: migrating ===============
-- Adding changes from JournalDetails
rake aborted!
An error has occurred, all later migrations canceled:

uninitialized constant Journal::Journaled
/var/lib/gems/1.8/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:131:in `const_missing'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:1:in `compute_type'
/var/lib/gems/1.8/gems/activesupport-2.3.12/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2234:in `compute_type'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/reflection.rb:156:in `send'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/reflection.rb:156:in `klass'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations/belongs_to_association.rb:51:in `find_target'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations/association_proxy.rb:236:in `load_target'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations/association_proxy.rb:113:in `reload'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/associations.rb:1256:in `journaled'
/opt/test/chiliproject/app/models/journal.rb:99:in `method_missing'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2660:in `send'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2660:in `update_attribute'
./db/migrate//20100714111654_add_changes_from_journal_details_for_acts_as_journalized.rb:20:in `up_without_benchmarks'
./db/migrate//20100714111654_add_changes_from_journal_details_for_acts_as_journalized.rb:9:in `each'
./db/migrate//20100714111654_add_changes_from_journal_details_for_acts_as_journalized.rb:9:in `up_without_benchmarks'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:328:in `say_with_time'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:328:in `say_with_time'
./db/migrate//20100714111654_add_changes_from_journal_details_for_acts_as_journalized.rb:8:in `up_without_benchmarks'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `send'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `__send__'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `migrate'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:491:in `migrate'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `call'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `ddl_transaction'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:490:in `migrate'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `each'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `migrate'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:401:in `up'
/var/lib/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:383:in `migrate'
/var/lib/gems/1.8/gems/rails-2.3.12/lib/tasks/databases.rake:112
/usr/lib/ruby/1.8/rake.rb:636:in `call'
/usr/lib/ruby/1.8/rake.rb:636:in `execute'
/usr/lib/ruby/1.8/rake.rb:631:in `each'
/usr/lib/ruby/1.8/rake.rb:631:in `execute'
/usr/lib/ruby/1.8/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/rake.rb:583:in `invoke'
/usr/lib/ruby/1.8/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2029:in `each'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:2023:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2001:in `run'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:28

Updated by Winti Winti at 2011-07-08 06:43 pm

I still could not solve this issue. Until now, i was not able find the source of the problem. Maybe it's related with some plugins i installed.
Is there anything i can do for help solving this issue.

Below a list of the entries in the plugin dir of a system running chiliproject 1.4 i would like to migrate to v2:

acts_as_activity_provider
acts_as_attachable
acts_as_customizable
acts_as_event
acts_as_list
acts_as_searchable
acts_as_tree
acts_as_versioned
acts_as_watchable
awesome_nested_set
classic_pagination
engines
gravatar
nested_layouts
open_flash_chart
open_id_authentication
prepend_engine_views
projects_tree_view
redmine_attach_screenshot
redmine_better_gantt_chart
redmine_charts
redmine_cmis
redmine_custom_field_users
redmine_ics_export
redmine_issue_control_panel
redmine_knowledgebase
redmine_lightbox
redmine_roadmaps
redmine_scm_extensions
redmine_ultraviolet
redmine_xapian
redmine_xls_export
rfpdf
ruby-net-ldap-0.0.4
sidebar
timesheet_plugin

Updated by Eric Davis at 2011-07-08 07:15 pm

Winti Winti:

I think I found the root of the problem. I'm running the test suite on it right now to make sure the change doesn't affect anything else.

  • Status changed from Needs more information to Open

Updated by Eric Davis at 2011-07-08 07:49 pm

I've fix the uninitialized constant bug in 1fae552c8f5f1 in the master branch. Can you try updating and let me know if it fixed the error.

Technical details

After digging I found that when acts_as_journalized is applied to a class it will create the Journal subclass and add a belongs_to :journaled association that has :class_name set to the journaled object (Issue, WikiPage). This works fine but when a plain Journal is used, the belongs_to doesn't have a class_name set so it assumes the class name is Journaled, which doesn't exist.

  • Target version set to 2.1.0
  • (deleted custom field) changed from unstable to 2.0.0
  • Status changed from Open to Closed

Updated by John Daily Jr at 2011-07-08 08:35 pm

I just tried to run db:migrate with the new fix with no luck.

root@dev:/var/www/chiliproject# git checkout  1fae552c8f5f1
HEAD is now at 1fae552... [#467] Fix Journal#journaled to prevent uninitialized constant Journal::Journaled
root@dev:/var/www/chiliproject# rake db:migrate RAILS_ENV=production --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
==  UpdateJournalsForActsAsJournalized: migrating =============================
-- Updating existing Journals...
rake aborted!
An error has occurred, all later migrations canceled:

undefined method `journalized_type' for #<IssueJournal:0x7f80c1ecc2e8>
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/attribute_methods.rb:260:in `method_missing'
/var/www/chiliproject/app/models/journal.rb:106:in `method_missing'
./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:27:in `up_without_benchmarks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/attribute_methods.rb:211:in `each_with_index'
./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:25:in `each'
./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:25:in `each_with_index'
./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:25:in `up_without_benchmarks'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each_pair'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each_pair'
./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:24:in `up_without_benchmarks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:328:in `say_with_time'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:328:in `say_with_time'
./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:23:in `up_without_benchmarks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `__send__'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:491:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `ddl_transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:490:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `each'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:401:in `up'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:383:in `migrate'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.12/lib/tasks/databases.rake:112
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Tasks: TOP => db:migrate

  • Status changed from Closed to Open

Updated by John Daily Jr at 2011-07-08 09:17 pm

In my case i was going from RC1 to RC3+ which cause db:migrate to run different migrations. As per Eric, running the 3 sql statements at the bottom of #479 corrected the issue.

Thanks,
John

  • Status changed from Open to Closed

Also available in: Atom PDF