Migrate From Trac - Undefinied Method "Reload"

Added by Josef S. over 9 years ago

Hello,

now I successfully installed Redmine on an windows server 2008 r2 x64 system.

But currently I want to migrate the data from trac to Redmine and get the following error:

undefined method `reload' for nil:NilClass

Here is the complete error log:

Unable to create a project with identifier 'myproject'!
rake aborted!
undefined method `reload' for nil:NilClass
c:/Program Files (x86)/Redmine/lib/tasks/migrate_from_trac.rake:685:in `target_project_identifier'
c:/Program Files (x86)/Redmine/lib/tasks/migrate_from_trac.rake:759
c:/Program Files (x86)/Redmine/lib/tasks/migrate_from_trac.rake:742:in `prompt'
c:/Program Files (x86)/Redmine/lib/tasks/migrate_from_trac.rake:759
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_cal
l_chain'
C:/Program Files (x86)/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_cal
l_chain'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_excep
tion_handling'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_excep
tion_handling'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
C:/Program Files (x86)/Ruby187/bin/rake:19:in `load'
C:/Program Files (x86)/Ruby187/bin/rake:19

Further information:

c:\Program Files (x86)\Redmine>gem list

*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
cgi_multipart_eof_fix (2.5.0)
gem_plugin (0.2.3)
i18n (0.4.2)
mongrel (1.1.5 x86-mingw32)
mongrel_service (0.3.4 i386-mswin32)
mysql (2.8.1 x86-mingw32)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rubygems-update (1.4.2)
sqlite3 (1.3.3 x86-mingw32)
sqlite3-ruby (1.3.3)
win32-service (0.5.2 mswin32)

c:\Program Files (x86)\Redmine>ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
c:\Program Files (x86)\Redmine>gem -v
1.4.2
Redmine version: 1.1.1

Can anyone help me with my problem?

Best regards, Beppo

Replies (9)

RE: Migrate From Trac - Undefinied Method "Reload" - Added by Etienne Massip over 9 years ago

Looks like a bug.

Could you fill in a defect for this, please ?

And try this workaround : replace "@target_project.reload" with "@target_project.reload if @target_project" in your file lib/tasks/migrate_from_trac.rake at line 685.

RE: Migrate From Trac - Undefinied Method "Reload" - Added by Josef S. over 9 years ago

Thank you very much for your answer.

I fixed the code row an now it works. I also have found a ticket, were the problem was described:

"The Target project identifier sould be given in lowercase":

Ticket: http://www.redmine.org/issues/5764

But now I have a new problem:

c:\Program Files (x86)\Redmine>rake redmine:migrate_from_trac
(in c:/Program Files (x86)/Redmine)

WARNING: a new project will be added to Redmine during this process.
Are you sure you want to continue ? [y/N] y

Trac directory []: D:\Trac
Trac database adapter (sqlite, sqlite3, mysql, postgresql) [sqlite]: sqlite3
Trac database encoding [UTF-8]: UTF-8
Target project identifier []: myprojekt

This project already exists in your Redmine database.
Are you sure you want to append data to this project ? [Y/n] y

Migrating components........
Migrating milestones..rake aborted!
bignum too big to convert into `long'

(See full trace by running task with --trace)

This problem was also described in the Ticket http://www.redmine.org/issues/5764.
I modified the RAKE-File "migrate_from_trac.rake" which the given solution, but the problem still exists.

I am using the trac version 0.12dev-r9347 with the sqlite version 3.5.9.
In Ruby I installed the sqlite version 3.7.3. Is it possible, that this is the problem?

Best regards, Beppo

RE: Migrate From Trac - Undefinied Method "Reload" - Added by Etienne Massip over 9 years ago

If you're sure you patched correctly your installation, could you please post the exception trace by running again rake... with --trace ?

RE: Migrate From Trac - Undefinied Method "Reload" - Added by Josef S. over 9 years ago

Here is the log, but I think where the problem is. Because I changed the file migrate_from_trac.rake in the directory C:\Program Files (x86)\Redmine\lib\tasks but this changes were not apply.

What I have to do, that the changes in the rake-file supply? Do I have to restart the server?

log:

c:\Program Files (x86)\Redmine>rake redmine:migrate_from_trac --trace
(in c:/Program Files (x86)/Redmine)
** Invoke redmine:migrate_from_trac (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:migrate_from_trac

WARNING: a new project will be added to Redmine during this process.
Are you sure you want to continue ? [y/N] y

Trac directory []: D:\Trac
Trac database adapter (sqlite, sqlite3, mysql, postgresql) [sqlite]: sqlite3
Trac database encoding [UTF-8]: UTF-8
Target project identifier []: myprojekt

This project already exists in your Redmine database.
Are you sure you want to append data to this project ? [Y/n] y

Migrating components........
Migrating milestones.......................
Migrating custom fields...
Migrating tickets.rake aborted!
bignum too big to convert into `long'
c:/Program Files (x86)/Redmine/lib/tasks/migrate_from_trac.rake:185:in `at'
c:/Program Files (x86)/Redmine/lib/tasks/migrate_from_trac.rake:185:in `time'
c:/Program Files (x86)/Redmine/lib/tasks/migrate_from_trac.rake:468:in `migrate'
c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/batches.rb:26:in `find_ea
ch'
c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/batches.rb:26:in `each'
c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/batches.rb:26:in `find_ea
ch'
c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/batches.rb:66:in `find_in
_batches'
c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/base.rb:2143:in `with_sco
pe'
c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/batches.rb:62:in `find_in
_batches'
c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/batches.rb:25:in `find_ea
ch'
c:/Program Files (x86)/Redmine/lib/tasks/migrate_from_trac.rake:461:in `migrate'
c:/Program Files (x86)/Redmine/lib/tasks/migrate_from_trac.rake:765
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_cal
l_chain'
C:/Program Files (x86)/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_cal
l_chain'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_excep
tion_handling'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_excep
tion_handling'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
C:/Program Files (x86)/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
C:/Program Files (x86)/Ruby187/bin/rake:19:in `load'
C:/Program Files (x86)/Ruby187/bin/rake:19

RE: Migrate From Trac - Undefinied Method "Reload" - Added by Etienne Massip over 9 years ago

I don't think it's necessary, what do you mean with "this changes were not apply" ?

RE: Migrate From Trac - Undefinied Method "Reload" - Added by Josef S. over 9 years ago

For example I changed the line print "Migrating milestones" in the migrate_from_trac.rake to print "Migrating milestones New Text ..."

But when I start the script over cmd (rake redmine:migrate_from_trac), the consol shows me "Migrating milestones" instead of "Migrating milestones New Text ...".
So I think that ruby doesn't use my changes I have made.

RE: Migrate From Trac - Undefinied Method "Reload" - Added by Etienne Massip over 9 years ago

Weird. I doubt that ruby use some cache or compilation mechanism between 2 executions of the same script, though.

RE: Migrate From Trac - Undefinied Method "Reload" - Added by Josef S. over 9 years ago

I don't know what was happening, but after a restart it works. Now all the changes were used by ruby.

Thank you very much for your help.

Best regards, Beppo

RE: Migrate From Trac - Undefinied Method "Reload" - Added by PFZ.nl PHP Community over 9 years ago

I run into the same problems.
- migrating the milestones fails, but I was able to fix that with the link in this topic (http://www.redmine.org/issues/5764)
- migrating the tickets fails, with the same message as Josep S posted => "bignum too big to convert into `long'", but on a different row

Trace:
Migrating components..................
Migrating milestones...............
Migrating custom fields......
Migrating tickets...........................................................................rake aborted!
bignum too big to convert into `long'

/s/usr-local/www/redmine/lib/tasks/migrate_from_trac.rake:125:in `at'
/s/usr-local/www/redmine/lib/tasks/migrate_from_trac.rake:125:in `time'
/s/usr-local/www/redmine/lib/tasks/migrate_from_trac.rake:518:in `migrate'
/s/usr-local/www/redmine/lib/tasks/migrate_from_trac.rake:142:in `open'
/s/usr-local/www/redmine/lib/tasks/migrate_from_trac.rake:140:in `open'
/s/usr-local/www/redmine/lib/tasks/migrate_from_trac.rake:517:in `migrate'
/s/usr-local/www/redmine/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:369:in `method_missing'
/s/usr-local/www/redmine/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `method_missing'
/s/usr-local/www/redmine/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `each'
/s/usr-local/www/redmine/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `send'
/s/usr-local/www/redmine/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `method_missing'
/s/usr-local/www/redmine/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:369:in `method_missing'
/s/usr-local/www/redmine/lib/tasks/migrate_from_trac.rake:515:in `migrate'
/s/usr-local/www/redmine/vendor/rails/activerecord/lib/active_record/batches.rb:26:in `find_each'
/s/usr-local/www/redmine/vendor/rails/activerecord/lib/active_record/batches.rb:26:in `each'
/s/usr-local/www/redmine/vendor/rails/activerecord/lib/active_record/batches.rb:26:in `find_each'
/s/usr-local/www/redmine/vendor/rails/activerecord/lib/active_record/batches.rb:66:in `find_in_batches'
/s/usr-local/www/redmine/vendor/rails/activerecord/lib/active_record/base.rb:2143:in `with_scope'
/s/usr-local/www/redmine/vendor/rails/activerecord/lib/active_record/batches.rb:62:in `find_in_batches'
/s/usr-local/www/redmine/vendor/rails/activerecord/lib/active_record/batches.rb:25:in `find_each'
/s/usr-local/www/redmine/lib/tasks/migrate_from_trac.rake:462:in `migrate'
/s/usr-local/www/redmine/lib/tasks/migrate_from_trac.rake:766
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597: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.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19

Used trac version: 0.12.2. Please let me know if you need more information.

(1-9/9)