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

Validation failed: Tracker is not included in the list #21

Open
mithrandir1 opened this issue Aug 31, 2014 · 0 comments
Open

Validation failed: Tracker is not included in the list #21

mithrandir1 opened this issue Aug 31, 2014 · 0 comments

Comments

@mithrandir1
Copy link

Hello!

Both bugzilla and redmine are using mysql databases, the script aborts at the issue migration:

Migrating profiles
...................................................
Migrating products....................................
Migrating relationship product/profile
Migrating issues
rake aborted!
Validation failed: Tracker is not included in the list
/var/lib/gems/2.1.0/gems/activerecord-3.2.19/lib/active_record/validations.rb:56:in save!' /var/lib/gems/2.1.0/gems/activerecord-3.2.19/lib/active_record/attribute_methods/dirty.rb:33:insave!'
/var/lib/gems/2.1.0/gems/activerecord-3.2.19/lib/active_record/transactions.rb:264:in block in save!' /var/lib/gems/2.1.0/gems/activerecord-3.2.19/lib/active_record/transactions.rb:313:inblock in with_transaction_returning_status'
/var/lib/gems/2.1.0/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in transaction' /var/lib/gems/2.1.0/gems/activerecord-3.2.19/lib/active_record/transactions.rb:208:intransaction'
/var/lib/gems/2.1.0/gems/activerecord-3.2.19/lib/active_record/transactions.rb:311:in with_transaction_returning_status' /var/lib/gems/2.1.0/gems/activerecord-3.2.19/lib/active_record/transactions.rb:264:insave!'
/opt/redmine/lib/tasks/migrate_from_bugzilla.rake:403:in block in migrate_issues' /opt/redmine/lib/tasks/migrate_from_bugzilla.rake:371:ineach'
/opt/redmine/lib/tasks/migrate_from_bugzilla.rake:371:in migrate_issues' /opt/redmine/lib/tasks/migrate_from_bugzilla.rake:574:inmodule:BugzillaMigrate'
/opt/redmine/lib/tasks/migrate_from_bugzilla.rake:46:in block (2 levels) in <top (required)>' /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:236:incall'
/var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:236:in block in execute' /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:231:ineach'
/var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:231:in execute' /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:175:inblock in invoke_with_call_chain'
/usr/lib/ruby/2.1.0/monitor.rb:211:in mon_synchronize' /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:168:ininvoke_with_call_chain'
/var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:161:in invoke' /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:149:ininvoke_task'
/var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:106:in block (2 levels) in top_level' /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:106:ineach'
/var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:106:in block in top_level' /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:115:inrun_with_threads'
/var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:100:in top_level' /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:78:inblock in run'
/var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:165:in standard_exception_handling' /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:75:inrun'
/var/lib/gems/2.1.0/gems/rake-10.1.1/bin/rake:33:in <top (required)>' /usr/local/bin/rake:23:inload'
/usr/local/bin/rake:23:in `

'
Tasks: TOP => redmine:migrate_from_bugzilla

After some research I found the cause of the problem. You have to assign the tracker "Bug" to the newly created project, so I added the line 316:

    BugzillaProduct.find_each do |product|
      project = Project.new
      project.name = product.name
      project.description = product.description
      project.identifier = "#{product.name.downcase.gsub(/[^a-z0-9]+/, '-')[0..10]}-#{product.id}"
      project.is_public = false
      project.trackers << TRACKER_BUG unless project.trackers.include?(TRACKER_BUG)
      project.save!

Then the migration worked like a charm.

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