View Issue Details

IDProjectCategoryView StatusLast Update
0003318SOGoActiveSyncpublic2015-08-25 10:25
Reporterangeloxx Assigned To 
PrioritynormalSeverityminorReproducibilityrandom
Status closedResolutionfixed 
Platform[Server] LinuxOSDebianOS Version8 (Jessie)
Product Version2.3.1 
Summary0003318: Random failure of MySQL password retrival
Description

Randomly the SOGo Activesync server says that a user entered a wrong password, even if the password is saved on the client and the client retry with the same credentials after a while with success. The Log:

<code>
2015-08-21 16:27:02.613 sogod[9085] <MySQL4Channel[0x0x7f5eb9518e70] connection=0x0x7f5eb999b5e0> SQL: SELECT c_password FROM users_sogo WHERE c_uid = 'a.conforti@youus.it';
2015-08-21 16:27:02.613 sogod[9085] <MySQL4Channel[0x0x7f5eb9518e70] connection=0x0x7f5eb999b5e0> query has results, entering fetch-mode.
Aug 21 16:27:02 sogod [9085]: <0x0x7f5eb97e6510[SOGoDAVAuthenticator]> tried wrong password for user 'a.conforti@youus.it'!
Aug 21 16:27:02 sogod [9085]: 213.3.43.167 "POST /SOGo/Microsoft-Server-ActiveSync?jQAJBBBOaW5lMDk2QTM3MTU4NjNFBAAAAAAHQW5kcm9pZAcBAA== HTTP/1.1" 401 12/172 0.011 - - 332K
2015-08-21 16:27:03.577 sogod[9085] <MySQL4Channel[0x0x7f5eb9518e70] connection=0x0x7f5eb999b5e0> SQL: SELECT c_password FROM users_sogo WHERE c_uid = 'a.conforti@youus.it';
2015-08-21 16:27:03.577 sogod[9085] <MySQL4Channel[0x0x7f5eb9518e70] connection=0x0x7f5eb999b5e0> query has results, entering fetch-mode.
2015-08-21 16:27:03.581 sogod[9085] <MySQL4Channel[0x0x7f5eb9518e70] connection=0x0x7f5eb999b5e0> SQL: SELECT * FROM users_sogo WHERE (c_uid = 'a.conforti@youus.it') OR (mail = 'a.conforti@youus.it');
</code>

SOGo uses a MySQL backend for the users:

<code>
SOGoUserSources =
(
{
type = sql;
id = directory;
LoginFieldNames = ( c_uid );
viewURL = "mysql://****:****@****:3306/****/users_sogo";
canAuthenticate = YES;
isAddressBook = NO;
userPasswordAlgorithm = md5-crypt;
}
);
}
</code>

Can I increase the debug level to check what the "SELECT c_password" query returns?

TagsNo tags attached.

Activities

angeloxx

angeloxx

2015-08-22 20:26

reporter   ~0008847

Trying to debug the problem I printed out the result of SQL query and the log says that the MySQL connection is not dropped and respond correctly the same value:

2015-08-22 21:43:17.624 sogod[18296] MySQL4 channel 0x0x7f463c9285f0 opened (connection=0x0x7f463c8ec630,range_mail)
2015-08-22 21:43:17.624 sogod[18296] <MySQL4Channel[0x0x7f463c9285f0] connection=0x0x7f463c8ec630> SQL: SELECT c_password FROM users_sogo WHERE c_uid = 'a.conforti@youus.it';
2015-08-22 21:43:17.624 sogod[18296] <MySQL4Channel[0x0x7f463c9285f0] connection=0x0x7f463c8ec630> query has results, entering fetch-mode.
Aug 22 21:43:17 sogod [18296]: [INFO] <0x0x7f463c50cbf0[SQLSource]> ANGELOXX: readed password is: $1$caKETllGn0
Aug 22 21:43:17 sogod [18296]: <0x0x7f463c86cd90[SOGoDAVAuthenticator]> tried wrong password for user 'a.conforti@youus.it'!
Aug 22 21:43:17 sogod [18296]: 213.3.43.167 "POST /SOGo/Microsoft-Server-ActiveSync?jQAJBBBOaW5lMDk2QTM3MTU4NjNFBAAAAAAHQW5kcm9pZAcBAA== HTTP/1.1" 401 12/172 0.010 - - 456K
2015-08-22 21:43:19.287 sogod[18296] <MySQL4Channel[0x0x7f463c9285f0] connection=0x0x7f463c8ec630> SQL: SELECT c_password FROM users_sogo WHERE c_uid = 'a.conforti@youus.it';
2015-08-22 21:43:19.288 sogod[18296] <MySQL4Channel[0x0x7f463c9285f0] connection=0x0x7f463c8ec630> query has results, entering fetch-mode.
Aug 22 21:43:19 sogod [18296]: [INFO] <0x0x7f463c50cbf0[SQLSource]> ANGELOXX: readed password is: $1$caKE
TllGn0
2015-08-22 21:43:19.291 sogod[18296] <MySQL4Channel[0x0x7f463c9285f0] connection=0x0x7f463c8ec630> SQL: SELECT * FROM users_sogo WHERE (c_uid = 'a.conforti@youus.it') OR (mail = 'a.conforti@youus.it');

So the problem is not in MySQL connection or result.

angeloxx

angeloxx

2015-08-24 08:11

reporter   ~0008849

Probably this is not a issue. After changing userPasswordAlgorithm from "md5-crypt" to "crypt" (the correct password algorithm) the issue does not occur anymore.

The question is why md5-crypt works in some circumstances; probably it fails when the database source is in use and userPasswordAlgorithm is enforced, while in the next tentative the memcached data is used...

I'll wait another day of test before close the ticket.

angeloxx

angeloxx

2015-08-25 08:00

reporter   ~0008852

Case closed.

Issue History

Date Modified Username Field Change
2015-08-21 15:01 angeloxx New Issue
2015-08-22 20:26 angeloxx Note Added: 0008847
2015-08-24 08:11 angeloxx Note Added: 0008849
2015-08-25 08:00 angeloxx Note Added: 0008852
2015-08-25 10:25 francis Status new => closed
2015-08-25 10:25 francis Resolution open => fixed