Migrate From Trac - SQLite3 BusyException Timeout
Added by Josef S. over 13 years ago
Hello,
I have another problem in migrating trac to redmine. Now I get a SQLite3: BusyException:
SQLite3::BusyException: database is locked: SELECT DISTINCT attachment.* FROM attachment WHERE attachment.type = 'ticket' AND attachment.id = '154'
Here is the full 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 []: saeprojekt2 Migrating components........ Migrating milestones....................... Migrating custom fields... Migrating tickets....................................................................................................... ........................................................................................................................ ........................................................................................................................ ....................................................................rake aborted! SQLite3::BusyException: database is locked: SELECT * FROM "ticket_change" WHERE ("ticket_change".ticket = 411) c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:219:i n `log' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `execute' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:417:in `catch_schema_changes' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `execute' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:320:in `select' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_stateme nts.rb:7:in `select_all_without_query_cache' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:6 2:in `select_all' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/base.rb:661:in `find_by_sql' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/base.rb:1548:in `find_every' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/base.rb:615:in `find' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:60:in `find' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:400:in `find_target' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:354:in `load_target' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:212:in `met hod_missing' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:369:in `method_missing' c:/Program Files (x86)/Redmine/lib/tasks/migrate_from_trac.rake:487:in `migrate' c:/Program Files (x86)/Redmine/vendor/rails/activerecord/lib/active_record/batches.rb:26:in `find_each' 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_each' 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_scope' 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_each' c:/Program Files (x86)/Redmine/lib/tasks/migrate_from_trac.rake:462:in `migrate' c:/Program Files (x86)/Redmine/lib/tasks/migrate_from_trac.rake:766 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_call_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_call_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_exception_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_exception_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
Here are some information about the configuration:
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) edavis10-object_daddy (0.4.3) gem_plugin (0.2.3) i18n (0.4.2) mocha (0.9.12) 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) shoulda (2.10.3) 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
It's a very crazy error, because the error occurs on different positions. Once at attachment.id = '154' at another time at attachment.id = '114' ...
Can anyone help me with my problem?
Best regards, Beppo
Replies (3)
RE: Migrate From Trac - SQLite3 BusyException Timeout - Added by Etienne Massip over 13 years ago
Guess you should deny redmine access while importing your data, even take instance down ?
RE: Migrate From Trac - SQLite3 BusyException Timeout - Added by Felix Schäfer over 13 years ago
SQLite doesn't support write concurrency, i.e. only one process can have a write lock on the whole DB at a time. Make sure nothing else accesses the DB when importing things.
RE: Migrate From Trac - SQLite3 BusyException Timeout - Added by Josef S. over 13 years ago
Thanks for the answers.
I made a very stupid error. The only thing I had to do was to determine the trac-daemon and the python-service.
Best regards, Beppo