Project

General

Profile

Actions

Defect #869

closed

Crash on migrate_from_trac

Added by John Goerzen almost 17 years ago. Updated over 16 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Importers
Target version:
Start date:
2008-03-15
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

This script has been working on most of my Trac instances. However, I am getting the below crash while it processes the tickets from one of them:

Migrating components..
Migrating milestones....
Migrating custom fields
Migrating tickets...rake aborted!
undefined method `regexp' for nil:NilClass
/home/redmine/redmine/app/models/custom_value.rb:33:in `validate'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/validations.rb:963:in `valid_without_callbacks?'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:273:in `valid?'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/associations.rb:1072:in `validate_associated_records_for_custom_values'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/associations/association_proxy.rb:125:in `each'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/associations/association_proxy.rb:125:in `send'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/associations/association_proxy.rb:125:in `method_missing'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/associations/association_collection.rb:162:in `method_missing'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/associations.rb:1067:in `validate_associated_records_for_custom_values'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/validations.rb:1000:in `send'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/validations.rb:1000:in `run_validations'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/validations.rb:998:in `each'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/validations.rb:998:in `run_validations'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/validations.rb:962:in `valid_without_callbacks?'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:273:in `valid?'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/validations.rb:933:in `save_without_transactions'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/transactions.rb:108:in `save'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in `transaction'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/transactions.rb:100:in `transaction'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/transactions.rb:108:in `save'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/transactions.rb:120:in `rollback_active_record_state!'
/home/redmine/gems/gems/activerecord-2.0.2/lib/active_record/transactions.rb:108:in `save'
/home/redmine/redmine/lib/tasks/migrate_from_trac.rake:347:in `migrate'
/home/redmine/redmine/lib/tasks/migrate_from_trac.rake:332:in `each'
/home/redmine/redmine/lib/tasks/migrate_from_trac.rake:332:in `migrate'
/home/redmine/redmine/lib/tasks/migrate_from_trac.rake:619
/usr/lib/ruby/1.8/rake.rb:387:in `call'
/usr/lib/ruby/1.8/rake.rb:387:in `execute'
/usr/lib/ruby/1.8/rake.rb:387:in `each'
/usr/lib/ruby/1.8/rake.rb:387:in `execute'
/usr/lib/ruby/1.8/rake.rb:357:in `invoke'
/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
/usr/lib/ruby/1.8/rake.rb:350:in `invoke'
/usr/lib/ruby/1.8/rake.rb:1906:in `run'
/usr/lib/ruby/1.8/rake.rb:1906:in `each'
/usr/lib/ruby/1.8/rake.rb:1906:in `run'
/usr/bin/rake:4
Actions #1

Updated by John Goerzen almost 17 years ago

It seems that all tickets that trigger this are marked closed in trac.

Actions #2

Updated by John Goerzen almost 17 years ago

Found the problem, but not sure how to fix.

I have a global custom field set up named "Resolution". It appears that migrate_from_trac is finding this, but crashes when a Trac ticket has a resolution that does not occur in my global custom field in Redmine.

My workaround was to add trac names to my Redmine custom field.

Actions #3

Updated by Jean-Philippe Lang almost 17 years ago

  • Category set to Importers
  • Target version set to 0.7
  • Resolution set to Fixed

I could reproduce this problem. I guess it occured because you had a custom field named Resolution with a default value not in %w(fixed invalid wontfix duplicate worksforme).

Fix applied in r1286.

Actions #4

Updated by Jean-Philippe Lang over 16 years ago

  • Status changed from New to Resolved
Actions #5

Updated by Jean-Philippe Lang over 16 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF