Unable to log in

Added by Matt Bullock over 9 years ago

I've had redmine working for 6 or 8 months now, and after upgrading redmine, apache22, php and mysql using FreeBSD ports I cant log in. I dont have much experience with it, just got it running for a friend. How do I start troubleshooting this? I ran "rake test" and there were 0 failures and 0 errors.

Thanks,

matt

Replies (13)

RE: Unable to log in - Added by Felix Schäfer over 9 years ago

"rake test" will only run the tests on the code, so that's not an indication at where your problem lies :-) You get up to the login screen? What error do you get there? Have a look at the redmine_dir/log/production.log while you try to log in and see if there is an error trace. What version were you upgrading from? Was there any error in the upgrading process, e.g. in the migration or stuff like that?

RE: Unable to log in - Added by Matt Bullock over 9 years ago

Hi Felix,

Yes I get the login screen but I dont see any errors, it just says "Invalid user or password" on the red colored bar at the top. I'm not sure what version I was running, I just ran a portupgrade on the FreeBSD server, then followed the instructions from the redmine site to upgrade the db:

rake db:migrate RAILS_ENV=production
rake tmp:cache:clear
rake tmp:sessions:clear

Here's the trace from the production.log:

Processing AccountController#login (for 172.17.1.103 at 2010-05-22 23:56:12) [POST]
Parameters: {"back_url"=>"http%3A%2F%2Fredmine.domain.com%2F", "action"=>"login", "authenticity_token"=>"*************", "username"=>"username", "controller"=>"account", "password"=>"[FILTERED]", "login"=>"Login \302\273"}
Rendering template within layouts/base
Rendering account/login
Completed in 215ms (View: 174, DB: 9) | 200 OK [http://redmine.domain.com/login]

-matt

RE: Unable to log in - Added by Felix Schäfer over 9 years ago

Well, it seems your login is incorrect because "Login \302\273" is not a valid login in redmine (spaces are not allowed in redmine usernames).

RE: Unable to log in - Added by Matt Bullock over 9 years ago

The database and users are still intact, is there a way to determine what redmine is using to authenticate users? Maybe the method was somehow changed to use a different location?

This is from trying to login with the "admin" account:

Processing AccountController#login (for 172.17.1.103 at 2010-05-23 12:47:15) [POST]
Parameters: {"back_url"=>"http%3A%2F%2Fredmine.domain.com%2F", "action"=>"login", "authenticity_token"=>"******************", "username"=>"admin", "controller"=>"account", "password"=>"[FILTERED]", "login"=>"Login \302\273"}
Rendering template within layouts/base
Rendering account/login
Completed in 20ms (View: 15, DB: 1) | 200 OK [http://redmine.domain.com/login]

RE: Unable to log in - Added by Matt Bullock over 9 years ago

The database and users are still intact, is there a way to determine what redmine is using to authenticate users? Maybe the method was somehow changed to use a different location?

This is from trying to login with the "admin" account:

Processing AccountController#login (for 172.17.1.103 at 2010-05-23 12:47:15) [POST]
Parameters: {"back_url"=>"http%3A%2F%2Fredmine.domain.com%2F", "action"=>"login", "authenticity_token"=>"******************", "username"=>"admin", "controller"=>"account", "password"=>"[FILTERED]", "login"=>"Login \302\273"}
Rendering template within layouts/base
Rendering account/login
Completed in 20ms (View: 15, DB: 1) | 200 OK [http://redmine.domain.com/login]

RE: Unable to log in - Added by Felix Schäfer over 9 years ago

Ah, sorry, I confused the login and username fields in the query. Do you have any plugin installed that might get in the way? Anyway, the users are defined in the "users" table in the db, and the default password for the admin user hashes to d033e22ae348aeb5660fc2140aec35850c4da997, so if you are comfortable enough to go and meddle with the DB, put the above hash in the hashed_password field for the user admin and you should be able to login again. If not, I'd suspect some collation/charset issue, but for that shouldn't be an issue here.

RE: Unable to log in - Added by Matt Bullock over 9 years ago

I put that hash in but still cant login using admin/admin

RE: Unable to log in - Added by Felix Schäfer over 9 years ago

I'm really sorry but without any hint at where the error is, we won't be able to do anything. Do you have any way to find out what queries the database receives? Another idea would be to put your redmine into development mode so you have a more verbose log output (especially the database queries). For that you will need to to duplicate your database config in config/database.yml from the production to a development section and restart your app in development mode (RailsEnv development for passenger, not sure how it works with the other environments) (you could also alternatively to change the configuration of your rails server just start script/server -e development in your redmine dir which will start a standalone rails server on port 3000).

(And for the obligatory reminder: have backups, don't hold me responsible, your dog may die, and so on ;-) )

RE: Unable to log in - Added by Matt Bullock over 9 years ago

Heres the query from the db:

100523 14:49:11 14 Statistics
14 Query SELECT max(`settings`.updated_on) AS max_updated_on FROM `settings`
14 Query SELECT * FROM `users` WHERE ( (`users`.`type` = 'AnonymousUser' ) ) LIMIT 1
14 Query SELECT * FROM `users` WHERE (login='admin') AND ( (`users`.`type` = 'User' OR `users`.`type` = 'AnonymousUser' ) ) LIMIT 1
14 Query SELECT `projects`.* FROM `projects` INNER JOIN `members` ON `projects`.id = `members`.project_id WHERE ((`members`.user_id = 2) AND ((projects.status=1)))

RE: Unable to log in - Added by Matt Bullock over 9 years ago

I copied the db to a dev database, changed RailsEnv to development and restarted the app. It doesnt seem to be logging to the development.log file though

RE: Unable to log in - Added by Matt Bullock over 9 years ago

Felix,

When I ran the "rake db:migrate" it was actually updating the dev db, so I ran "rake db:migrate RAILS_ENV=production" and now I'm able to log in again.

Thank you for all your help, it got me looking in the right direction.

-matt

RE: Unable to log in - Added by Felix Schäfer over 9 years ago

Glad you figured it out :-) Doesn't the upgrade docs specify to run the migration in production mode? If not, could you please update the docs? Thanks.

RE: Unable to log in - Added by Matt Bullock over 9 years ago

It looks like the docs are correct already, I must have mistyped.

Thanks!

-matt

(1-13/13)