Unofficial Redmine Cooking - QA #782 yaml_db を使った DB のマイグレーションで失敗する 2018/03/26 10:04 - Tamura Shinji ステータス : 新規開始日 : 2018/03/26 優先度 : 通常期日 : 担当者 : 進捗率 : 0% カテゴリ : 予定工数 : 0.00 時間 対象バージョン : 作業時間 : 0.00 時間 説明 環境は Environment: Redmine version 3.4.4.stable.17197 Ruby version 2.4.3-p205 (2017-12-14) [x86_6 Rails version 4.2.8 Environment production で MariaDB(10) から Postgresql(9.6) へデータ移行させようとしています RAILS_ENV=production bundle exec rake db:data:dump でデータダンプしたのち RAILS_ENV=production bundle exec rake db:migrate RAILS_ENV=production bundle exec rake redmine:plugins:migrate RAILS_ENV=production bundle exec rake tmp:cache:clear tmp:sessi RAILS_ENV=production bundle exec rake db:data:load を実行すると RAILS_ENV=production bundle exec rake db:data:load rake aborted! ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction: ERR of transaction block : DELETE FROM "projects" sql/database_statements.rb:155:in `async_exec' sql/database_statements.rb:155:in `block in execute' _adapter.rb:484:in `block in log' rb:20:in `instrument' _adapter.rb:478:in `log' sql/database_statements.rb:154:in `execute' n truncate_table' _table' 2019/01/20 1/9
e' ments' load' /database_statements.rb:213:in `block in transaction' /transaction.rb:184:in `within_new_transaction' /database_statements.rb:213:in `transaction' ) in <top (required)>' /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/gems/rake- PG::InFailedSqlTransaction: ERROR: current transaction is abor sql/database_statements.rb:155:in `async_exec' sql/database_statements.rb:155:in `block in execute' _adapter.rb:484:in `block in log' rb:20:in `instrument' _adapter.rb:478:in `log' sql/database_statements.rb:154:in `execute' n truncate_table' _table' e' ments' load' /database_statements.rb:213:in `block in transaction' /transaction.rb:184:in `within_new_transaction' /database_statements.rb:213:in `transaction' ) in <top (required)>' /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/gems/rake- ActiveRecord::StatementInvalid: PG::FeatureNotSupported: ERROR: 2019/01/20 2/9
DETAIL: Table "easy_settings" references "projects". HINT: Truncate table "easy_settings" at the same time, or use : TRUNCATE "projects" sql/database_statements.rb:155:in `async_exec' sql/database_statements.rb:155:in `block in execute' _adapter.rb:484:in `block in log' rb:20:in `instrument' _adapter.rb:478:in `log' sql/database_statements.rb:154:in `execute' _table' e' ments' load' /database_statements.rb:213:in `block in transaction' /transaction.rb:184:in `within_new_transaction' /database_statements.rb:213:in `transaction' ) in <top (required)>' /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/gems/rake- PG::FeatureNotSupported: ERROR: cannot truncate a table refere DETAIL: Table "easy_settings" references "projects". HINT: Truncate table "easy_settings" at the same time, or use sql/database_statements.rb:155:in `async_exec' sql/database_statements.rb:155:in `block in execute' _adapter.rb:484:in `block in log' rb:20:in `instrument' _adapter.rb:478:in `log' sql/database_statements.rb:154:in `execute' _table' e' ments' 2019/01/20 3/9
load' /database_statements.rb:213:in `block in transaction' /transaction.rb:184:in `within_new_transaction' /database_statements.rb:213:in `transaction' ) in <top (required)>' /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/gems/rake- Tasks: TOP => db:data:load (See full trace by running task with --trace) となってしまいます Postgresql の 9.6 ではうまくいかないんでしょうか??? CentOS7 の 9.3 ではまだ試していないです 履歴 #1-2018/03/26 10:14 - Tamura Shinji trace オプションを付けた結果は以下になります ** Invoke db:data:load (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:data:load rake aborted! ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction: ERROR: cur lock : DELETE FROM "projects" erecordtements.rb:155:in `async_exec' erecordtements.rb:155:in `block in execute' erecordin `block in log' esupport ment' erecordin `log' erecordtements.rb:154:in `execute' db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 /usr/local/lib/ruby/2.4.0/psych/deprecated.rb:32:in `each' /usr/local/lib/ruby/2.4.0/psych/deprecated.rb:32:in `load_documents' db-0.6.0 db-0.6.0 erecordments.rb:213:in `block in transaction' erecord- 184:in `within_new_transaction' erecordments.rb:213:in `transaction' db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 2019/01/20 4/9
ed)>' /usr/local/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize' /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/e /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/bin/rake:23:in `lo /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/bin/rake:23:in `<t /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:4 /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:2 /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:1 /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/bundle:30:in `bl /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/friendly /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/bundle:22:in `<t PG::InFailedSqlTransaction: ERROR: current transaction is aborted, com erecordtements.rb:155:in `async_exec' erecordtements.rb:155:in `block in execute' erecordin `block in log' esupport ment' erecordin `log' erecordtements.rb:154:in `execute' db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 /usr/local/lib/ruby/2.4.0/psych/deprecated.rb:32:in `each' /usr/local/lib/ruby/2.4.0/psych/deprecated.rb:32:in `load_documents' db-0.6.0 db-0.6.0 erecordments.rb:213:in `block in transaction' erecord- 184:in `within_new_transaction' erecordments.rb:213:in `transaction' db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 ed)>' 2019/01/20 5/9
/usr/local/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize' /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/e /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/bin/rake:23:in `lo /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/bin/rake:23:in `<t /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:4 /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:2 /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:1 /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/bundle:30:in `bl /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/friendly /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/bundle:22:in `<t ActiveRecord::StatementInvalid: PG::FeatureNotSupported: ERROR: cannot DETAIL: Table "easy_settings" references "projects". HINT: Truncate table "easy_settings" at the same time, or use TRUNCATE : TRUNCATE "projects" erecordtements.rb:155:in `async_exec' erecordtements.rb:155:in `block in execute' erecordin `block in log' esupport ment' erecordin `log' erecordtements.rb:154:in `execute' db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 /usr/local/lib/ruby/2.4.0/psych/deprecated.rb:32:in `each' /usr/local/lib/ruby/2.4.0/psych/deprecated.rb:32:in `load_documents' db-0.6.0 db-0.6.0 erecordments.rb:213:in `block in transaction' erecord- 184:in `within_new_transaction' erecordments.rb:213:in `transaction' db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 ed)>' /usr/local/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize' 2019/01/20 6/9
/var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/e /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/bin/rake:23:in `lo /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/bin/rake:23:in `<t /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:4 /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:2 /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:1 /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/bundle:30:in `bl /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/friendly /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/bundle:22:in `<t PG::FeatureNotSupported: ERROR: cannot truncate a table referenced in DETAIL: Table "easy_settings" references "projects". HINT: Truncate table "easy_settings" at the same time, or use TRUNCATE erecordtements.rb:155:in `async_exec' erecordtements.rb:155:in `block in execute' erecordin `block in log' esupport ment' erecordin `log' erecordtements.rb:154:in `execute' db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 /usr/local/lib/ruby/2.4.0/psych/deprecated.rb:32:in `each' /usr/local/lib/ruby/2.4.0/psych/deprecated.rb:32:in `load_documents' db-0.6.0 db-0.6.0 erecordments.rb:213:in `block in transaction' erecord- 184:in `within_new_transaction' erecordments.rb:213:in `transaction' db-0.6.0 db-0.6.0 db-0.6.0 db-0.6.0 ed)>' /usr/local/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize' 2019/01/20 7/9
/var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/e /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/bin/rake:23:in `lo /var/www/redmine/site/rtest/vendor/bundle/ruby/2.4.0/bin/rake:23:in `<t /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:4 /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:2 /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:1 /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/bundle:30:in `bl /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/friendly /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/bundle:22:in `<t Tasks: TOP => db:data:load #2-2018/03/26 13:38 - Tamura Shinji ちなみに mariadb -> mariadb はちゃんと動いてくれています #3-2018/03/26 21:42 - 奈良裕記 Plugin の無い plain な環境でも再現しますか? 後半のエラーは easyredmine 関連ですね #4-2018/03/27 12:06 - Tamura Shinji まだ plain な状態では試せてないんです データ減らしながら試してみようかと思っています とはいえ mariadb -> mariadb がうまくいっているので postgres 側の何かあるのかなぁと 2019/01/20 8/9
Powered by TCPDF (www.tcpdf.org) #5-2018/04/24 23:39 - 奈良裕記 taps で MySQL から PostgreSQL に移行した後に起きたトラブル事例 https://blog.n-z.jp/blog/2014-01-12-taps-trouble.html mysql->postgresql DB の default の違いも随分とあるんですね > 別途クリーンな環境を用意して生成した db/schema.rb と比較するなどのチェックも必要でした #6-2018/04/25 08:45 - Tamura Shinji あぅ メインの仕事が忙しくて手が付けられてないです migrate するファイルを見る限りは違いはないんですが 一度入れてしまってからだとデフォルトの違いはあるようですねぇ 2019/01/20 9/9