1

Redmineの公式 Web サイト(Luciano Pacheco、2011 年 6 月 7 日 06:28 バージョン) で提供されているスクリプトを使用して JIRA から Redmine にデータを移行しているときに、以下の例外が発生します。

-bash-4.1$ rake --trace jira_migration:do_all_migrations RAILS_ENV="production"
rake aborted!
ActiveRecord::ConnectionNotEstablished
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/model_schema.rb:223:in `table_exists?'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/attribute_methods/primary_key.rb:75:in `get_primary_key'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/attribute_methods/primary_key.rb:60:in `reset_primary_key'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/attribute_methods/primary_key.rb:49:in `primary_key'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/attribute_assignment.rb:13:in `attributes_protected_by_default'
/usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:216:in `block in protected_attributes_configs'
/usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:188:in `yield'
/usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:188:in `default'
/usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:188:in `protected_attributes'
/usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:118:in `block in attr_protected'
/usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:117:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:117:in `attr_protected'
/opt/redmine/redmine/app/models/tracker.rb:38:in `<class:Tracker>'
/opt/redmine/redmine/app/models/tracker.rb:18:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/opt/redmine/redmine-2.3.3/lib/tasks/migrate_jira.rake:5:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:425:in `block in load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:425:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:425:in `load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:145:in `load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
/opt/redmine/redmine-2.3.3/Rakefile:7:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:94:in `block in load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:93:in `load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:77:in `block in run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
-bash-4.1$ 

私のdatabase.ymlは次のようになります (postgres production セクションのみがアクティブです):

# Default setup is given for MySQL with ruby1.9. If you're running Redmine
# with MySQL and ruby1.8, replace the adapter name with `mysql`.
# Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end.
# Line indentation must be 2 spaces (no tabs).

#production:
#  adapter: mysql2
#  database: redmine
#  host: localhost
#  port: 3306
#  username: root
#  password: ""
#  encoding: utf8

#development:
#  adapter: mysql2
#  database: redmine_development
#  host: localhost
#  username: root
#  password: ""
#  encoding: utf8

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
#test:
#  adapter: mysql2
#  database: redmine_test
#  host: localhost
#  username: root
#  password: ""
#  encoding: utf8

# PostgreSQL configuration example
production:
  adapter: postgresql
  database: redmine
  host: localhost
  port: 5432
  username: redmine
  password: "canBeCrackedPrettyFast"

# SQLite3 configuration example
#production:
#  adapter: sqlite3
#  database: db/redmine.sqlite3

# SQL Server configuration example
#production:
#  adapter: sqlserver
#  database: redmine
#  host: localhost
#  username: jenkins
#  password: jenkins

今、私のpostgres.confで私はオンにしました

log_connections = on
log_disconnections = on

オプションを使用して、セッションがいつ開始および終了するかを正確に確認できます。psql クライアントを使用して redmine データベースにアクセスすると、予想されるログ エントリがすぐに表示されます (redmine ユーザーがログインしてログアウトしたことを示すだけです。英語以外のメッセージについてはお詫びします)。

2013-10-10 16:18:53 CESTLOG:  Verbindung empfangen: Host=172.30.5.77 Port=48393
2013-10-10 16:18:53 CESTLOG:  Verbindung authorisiert: Benutzer=redmine Datenbank=redmine
2013-10-10 16:18:57 CESTLOG:  Verbindungsende: Sitzungszeit: 0:00:06.710 Benutzer=redmine Datenbank=redmine Host=172.30.5.77 port=48393

ただし、上記のスクリプトを実行しても何もログに記録されないため、ActiveRecord が database.yml からデータをロードしていないか、正しくロードしていないと思われます。私の質問は: オーバーライドする必要がある標準の ActiveRecord 設定はありますか? そうでない場合、ここからどのように進めればよいですか?この時点でアイデアがありません。

4

0 に答える 0