Author Topic: Authentication not working for certain users  (Read 4730 times)

Offline Termina

  • Newbie
  • *
  • Posts: 3
Authentication not working for certain users
« on: March 13, 2014, 03:05:06 PM »
Hello,

I'm running Debian 7's most recent version of RoundCube.

Using Courier IMAP + LDAP. This setup has been working fine for over a year, but all of a sudden certain users cannot log into webmail. (Well, one user confirmed so far. Dozens of other users have no problem)

Using another client (like Outlook) let's them use IMAP just fine, so this is not a courier problem.

In the debug logs for authentication for this user, I see:

Mar 13 14:05:37 myhost authdaemond: Authenticated: clearpasswd=<SNIP>, passwd={CRYPT}$1$<SNIP>

Enabled IMAP debugging in roundcube and get:

Code: [Select]
Mar 13 14:10:13 myhost imapd: Connection, ip=[::ffff:127.0.0.1]
Mar 13 14:10:13 myhost authdaemond: received auth request, service=imap, authtype=login
Mar 13 14:10:13 myhost authdaemond: authldap: trying this module
Mar 13 14:10:13 myhost authdaemond: using search filter: (uid=myuser)
Mar 13 14:10:13 myhost slapd[3805]: <= bdb_equality_candidates: (uid) not indexed
Mar 13 14:10:13 myhost authdaemond: one entry returned, DN: cn=myuser T,ou=People,dc=myhost,dc=us
Mar 13 14:10:13 myhost authdaemond: authldaplib: sysusername=<null>, sysuserid=2111, sysgroupid=100, homedir=/home/myuser, address=myuser, fullname=myuser T, maildir=<null>, quota=<null>, options=<null>
Mar 13 14:10:13 myhost authdaemond: password matches successfully
Mar 13 14:10:13 myhost authdaemond: Authenticated: sysusername=<null>, sysuserid=2111, sysgroupid=100, homedir=/home/myuser, address=myuser, fullname=myuser T, maildir=<null>, quota=<null>, options=<null>
Mar 13 14:10:13 myhost imapd: LOGIN, user=myuser, ip=[::ffff:127.0.0.1], port=[58016], protocol=IMAP
Mar 13 14:10:13 myhost imapd: LOGOUT, user=myuser, ip=[::ffff:127.0.0.1], headers=0, body=0, rcvd=31, sent=187, time=0

No changes to the system (AFAIK).

Any help would be appreciated

Thanks
« Last Edit: March 17, 2014, 01:48:40 PM by Termina »

Offline Termina

  • Newbie
  • *
  • Posts: 3
Re: Authentication not working for certain users
« Reply #1 on: March 17, 2014, 01:34:55 PM »
Issue turned out to be with MySQL DB; the upgrade must have failed for some tables.

I attempted to manually upgrade the schemas in /usr/share/dbconfig-common/data/roundcube/upgrade without much luck

I'm getting the errors below

Code: [Select]
[17-Mar-2014 17:31:00 UTC] PHP Deprecated:  Deprecated: MDB2_Driver_mysql::isError() is deprecated, use MDB2::isError() in /usr/share/roundcube/program/include/rcube_mdb2.php on line 288 in /usr/share/php/MDB2.php on line 2001
[17-Mar-2014 12:31:00 -0500]: DB Error: _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE mdb2_statement_mysql_50c924e7c9cec5f7221c14d7ef47a8e459c768c79 FROM 'INSERT INTO users (created, last_login, username, mail_host, alias, language) VALUES (now(), now(), ?, ?, ?, ?)']
[Native code: 1054]
[Native message: Unknown column 'alias' in 'field list']
 in /usr/share/roundcube/program/include/rcube_mdb2.php on line 293 (POST /?_task=login&_action=login)
[17-Mar-2014 17:31:00 UTC] PHP Deprecated:  Deprecated: MDB2_Driver_mysql::isError() is deprecated, use MDB2::isError() in /usr/share/roundcube/program/include/rcube_mdb2.php on line 369 in /usr/share/php/MDB2.php on line 2001
[17-Mar-2014 12:31:00 -0500]: PHP Error: Failed to create new user in /usr/share/roundcube/program/include/rcube_user.php on line 510 (POST /?_task=login&_action=login)
[17-Mar-2014 12:31:00 -0500]: PHP Error: Failed to create a user record. Maybe aborted by a plugin? in /usr/share/roundcube/program/include/rcmail.php on line 860 (POST /?_task=login&_action=login)
[17-Mar-2014 17:31:00 UTC] PHP Deprecated:  Deprecated: MDB2_Driver_mysql::isError() is deprecated, use MDB2::isError() in /usr/share/roundcube/program/include/rcube_mdb2.php on line 288 in /usr/share/php/MDB2.php on line 2001
[17-Mar-2014 17:31:00 UTC] PHP Deprecated:  Deprecated: MDB2_Driver_mysql::isError() is deprecated, use MDB2::isError() in /usr/share/roundcube/program/include/rcube_mdb2.php on line 288 in /usr/share/php/MDB2.php on line 2001

My "users" table looks like the following; any tips?

Code: [Select]
mysql> describe users;
+-------------+------------------+------+-----+---------------------+----------------+
| Field       | Type             | Null | Key | Default             | Extra          |
+-------------+------------------+------+-----+---------------------+----------------+
| user_id     | int(10) unsigned | NO   | PRI | NULL                | auto_increment |
| username    | varchar(128)     | NO   | MUL | NULL                |                |
| mail_host   | varchar(128)     | NO   |     | NULL                |                |
| created     | datetime         | NO   |     | 1000-01-01 00:00:00 |                |
| last_login  | datetime         | YES  |     | NULL                |                |
| language    | varchar(5)       | YES  |     | NULL                |                |
| preferences | text             | YES  |     | NULL                |                |
+-------------+------------------+------+-----+---------------------+----------------+
7 rows in set (0.01 sec)


For now, I've modified the PHP code not to insert the "alias" field but this doesn't seem like a great solution. :P
« Last Edit: March 17, 2014, 01:48:23 PM by Termina »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: Authentication not working for certain users
« Reply #2 on: March 17, 2014, 03:59:18 PM »
Do you know which version you where upgrading from?

Offline Termina

  • Newbie
  • *
  • Posts: 3
Re: Authentication not working for certain users
« Reply #3 on: March 18, 2014, 12:25:15 AM »
I was running 0.7.1 and upgraded to the latest Debian wheezy version (0.9.4 I want to say)

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: Authentication not working for certain users
« Reply #4 on: March 19, 2014, 01:43:05 PM »
The you'll need to run 2011121400.sql and newer SQL files in <RC root>/SQL/mysql to update the database.