500 internal error after restore on login page
Added by Leydson Vieira about 8 years ago
Hello there!
I'm trying to migrate my redmine data to a new installation in another server (Debian 8 Jessie)
I have backuped mysql base with msqldump and copied my 'files' directory from redmine.
I restored all data and files in my new installation and then tried it.
I can access the page normaly, but, after login page it returns '500 internal error'
Follow production.log:
Started POST "/redmine/login" for 192.168.40.1 at 2016-06-16 11:33:56 -0300
Processing by AccountController#login as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"KvaV4AmL21cZiBH5Eer2yEixJ81Z8q9N2ah0Ze+EWSdcnaYbOxS0Y0/Y8QVNotyCsVLEwAMCnrLLRKafhA2gHQ==", "back_url"=>"http://172.17.0.240/redmine/", "username"=>"leydson", "password"=>"[FILTERED]", "login"=>"Entrar »"}
(0.2ms) SELECT MAX FROM `settings`
AnonymousUser Load (0.3ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('AnonymousUser') ORDER BY `users`.`id` ASC LIMIT 1
Current user: anonymous
User Load (0.2ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`login` = 'leydson'
SQL (1.5ms) UPDATE `users` SET `users`.`last_login_on` = '2016-06-16 11:33:56' WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`id` = 48
Successful authentication for 'leydson' from 192.168.40.1 at 2016-06-16 14:33:56 UTC
(0.1ms) BEGIN
Token Exists (0.1ms) SELECT 1 AS one FROM `tokens` WHERE `tokens`.`value` = BINARY '' LIMIT 1
User Load (0.2ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`id` = 48 LIMIT 1
(0.3ms) SELECT `tokens`.`id` FROM `tokens` WHERE `tokens`.`user_id` = 48 AND `tokens`.`action` = 'session' ORDER BY `tokens`.`updated_on` DESC LIMIT 18446744073709551615 OFFSET 9
(0.1ms) ROLLBACK
Completed 500 Internal Server Error in 9ms (ActiveRecord: 2.9ms)
ActiveRecord::StatementInvalid (Mysql2::Error: Unknown column 'tokens.updated_on' in 'order clause': SELECT `tokens`.`id` FROM `tokens` WHERE `tokens`.`user_id` = 48 AND `tokens`.`action` = 'session' ORDER BY `tokens`.`updated_on` DESC LIMIT 18446744073709551615 OFFSET 9):
app/models/token.rb:84:in `delete_previous_tokens'
app/models/user.rb:399:in `generate_session_token'
app/controllers/application_controller.rb:82:in `start_user_session'
app/controllers/application_controller.rb:160:in `logged_user='
app/controllers/account_controller.rb:257:in `successful_authentication'
app/controllers/account_controller.rb:203:in `password_authentication'
app/controllers/account_controller.rb:189:in `authenticate_user'
app/controllers/account_controller.rb:40:in `login'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Can anybody help me, please??
Debian 8, with passenger
Regards
Replies (3)
RE: 500 internal error after restore on login page
-
Added by Toshi MARUYAMA about 8 years ago
Did you run "rake db:migrate"?
RE: 500 internal error after restore on login page
-
Added by Leydson Vieira about 8 years ago
Yes I did, but I had the following message:
Mysql2::Error: Table 'queries_roles' already exists: CREATE TABLE `queries_roles` (`query_id` int(11) NOT NULL, `role_id` int(11) NOT NULL) ENGINE=InnoDB
and then it did not migrate
RE: 500 internal error after restore on login page
-
Added by Vítor Damasceno over 7 years ago
I had the same problem.
Had performed a test with dump_old restoring in the bank, did the rake db: migrate worked perfectly.
When trying to perform the procedure with dump_new in the same DB without deleting it, and using the db: migrate command, the problem happened.
I made a drop database, then created it again, restored dump_new and performed rake db: migrate. (Bundle exec rake db: migrate RAILS_ENV = production).
Good luck!