Redmineのインストールを3.0.3から3.3.3にアップグレードする処理中です。新しい「Redmine」インスタンスにmysqlダンプをインポートするときに「tokens.update_on」という列が不明です
新しいマシンに新しいRedmineをインストールし、現在のものからsqldumpをインストールし、重要なもの(files/config.yml/database.yml、plugins)をコピーしてから必要なすべての手順を実行します。これは一般的に過去にはうまくいきました。
現時点では、sqldumpをインポートした後、Redmineが起動していないため、エラーが発生しました。わかりません。私はmyredmine.comに移動すると
bundle exec rake redmine:plugins:migrate RAILS_ENV=production
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake tmp:sessions:clear
bundle exec rake tmp:cache:clear
sudo service httpd restart
私は「内部取得:
mysql -u 'user' -p'mypassword' redmine < /home/redmine20170608.sql
は、その後、私はエラーなしですべての実行は、通常の手順を実行します。
mysqlのインポートが動作するように表示されますエラーメッセージ。ログとアウトプットをチェックです:
ActiveRecord::StatementInvalid (Mysql2::Error: Unknown column 'tokens.updated_on' in 'field list': UPDATE `tokens` SET `tokens`.`updated_on` = '2017-06-09 07:10:56.515511' WHERE `tokens`.`user_id` = 1 AND `tokens`.`value` = '5a229e24fe73e8a43768c46af2275a8b4a60c9b3' AND `tokens`.`action` = 'session'):
app/models/user.rb:425:in `verify_session_token'
app/controllers/application_controller.rb:77:in `session_expired?'
app/controllers/application_controller.rb:67:in `session_expiration'
Migrating to CreateRolesManagedRoles (20150528092912)
Started GET "/" for 72.155.92.149 at 2017-06-09 07:16:14 +0000
Processing by WelcomeController#index as HTML
Completed 500 Internal Server Error in 25ms (ActiveRecord: 1.8ms)
ActiveRecord::StatementInvalid (Mysql2::Error: Unknown column 'tokens.updated_on' in 'field list': UPDATE `tokens` SET `tokens`.`updated_on` = '2017-06-09 07:16:14.896744' WHERE `tokens`.`user_id` = 1 AND `tokens`.`value` = '5a229e24fe73e8a43768c46af2275a8b4a60c9b3' AND `tokens`.`action` = 'session'):
app/models/user.rb:425:in `verify_session_token'
app/controllers/application_controller.rb:77:in `session_expired?'
app/controllers/application_controller.rb:67:in `session_expiration'
これは、そのファイルの行425からのコードです:私は通常見つける
# Returns true if token is a valid session token for the user whose id is user_id
def self.verify_session_token(user_id, token)
return false if user_id.blank? || token.blank?
scope = Token.where(:user_id => user_id, :value => token.to_s, :action => 'session')
if Setting.session_lifetime?
scope = scope.where("created_on > ?", Setting.session_lifetime.to_i.minutes.ago)
end
if Setting.session_timeout?
scope = scope.where("updated_on > ?", Setting.session_timeout.to_i.minutes.ago)
end
scope.update_all(:updated_on => Time.now) == 1
end
:
scope.update_all(:updated_on => Time.now) == 1
このセクションの内側にありますこれらのエラー出力は比較的自明であるが、私はこれをどのように解釈するのか分からない。
すべてのプラグインを削除して互換性の問題ではないことを確認していますが、同じ問題が発生しています。
現在のRedmineは、Ruby 1.9.3-p551、Rails 4.2.1、AWS Linux AMI 2010.03で動作しています(私は離れて行くことをお勧めします)。
新しいRedmineのは、Rubyの2.2.5-P319上で実行して、3.3.3で、大歓迎任意のヘルプ4.2.7.1およびCentOSの7
をレール。
425番のコードは何ですか?アプリケーションコントローラ –
のメソッドをスコープと共有しますか? –
再度スコープを含むように更新されました。 – shaneoh