General developer forum

Weird login error

 
Raymond
Weird login error
 

I keep getting the error message below when I try to login as an admin. The first message is from Site Administration -> report -> logs ***

Login failed for the username 'admin' for the reason with id '3'.

This one is from the logs table in the DB:

eventname: \core\event\user_login_failed
other: a:2:{s:8:"username";s:5:"admin";s:6:"reason";i:3;}
 
Average of ratings: -
Picture of Nitesh Kumar
Re: Weird login error
 

Hi Raymond,

Below are the reason ids.  Reason id 3 means "Can not login, most probably password did not match. ". 

/** Login attempt successful. */
define('AUTH_LOGIN_OK', 0);
/** Can not login because user does not exist. */
define('AUTH_LOGIN_NOUSER', 1);
/** Can not login because user is suspended. */
define('AUTH_LOGIN_SUSPENDED', 2);
/** Can not login, most probably password did not match. */
define('AUTH_LOGIN_FAILED', 3);
/** Can not login because user is locked out. */
define('AUTH_LOGIN_LOCKOUT', 4);
/** Can not login becauser user is not authorised. */
define('AUTH_LOGIN_UNAUTHORISED', 5);

 
Average of ratings: -
Raymond
Re: Weird login error
 
Hi Nitesh,


I have reset the password countless times now, including from the database using an sql query. it still doesnt work.

I have a suspicion that whatever the problem is, its related to my logins into the moodle mobile app that I was customizing. I normally login into the app using the admin username and password. But now, I cant use those login details anymore - even if I reset them -  yet other credentials work.



 
Average of ratings: -
Raymond
Re: Weird login error
 

Hi,

Is there anyone who can assist with this? I know I'm putting the right username and password, and I keep getting the same error message.

Funny thing is, this is only happening in my dev environment, not in production. In production, same username and password work perfectly, but in dev, they dont work.

Even after importing the same database from production to dev!


 
Average of ratings: -