6.0.0-beta1
9/2/25

[#13459] Query displayed after critical error during login
Summary Query displayed after critical error during login
Queue Horde Base
Queue Version 5.2.1
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester daniel (at) poradnik-webmastera (dot) com
Created 08/21/2014 (4030 days ago)
Due
Updated 07/20/2015 (3697 days ago)
Assigned 08/21/2014 (4030 days ago)
Resolved 07/20/2015 (3697 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
07/20/2015 02:24:51 PM Michael Rubinsky State ⇒ Not A Bug
 
08/21/2014 08:56:22 PM daniel (at) poradnik-webmastera (dot) com Comment #11 Reply to this comment
Thanks. I changed my auth configuration. As I checked, the same error 
is displayed after invalid login. In logs I see one more exception - 
WARN: HORDE [imp] [login] Authentication failed.

Here is HTML code which is sent to browser. Maybe it will be helpful 
for you too:
<html>
<head><!--a75c305b1c0a6022--><title>Horde :: Fatal Error</title></head>
<body style="background:#fff; color:#000"><h1>Critical 
Error</h1><h3>QUERY FAILED: Table 'mydb.horde_histories_modseq' 
doesn't exist

INSERT INTO horde_histories_modseq (history_modseqempty) 
VALUES(0)</h3><h3>Details have been logged for admin</h3></body></html>

BTW, have you checked upgrade scripts why this table was not created 
during upgrade?
08/21/2014 05:31:13 PM Michael Slusarz Comment #10 Reply to this comment
I read this file again and found note about having to login twice 
(Horde first, then IMP). Because of this I set 
$servers['advanced']['hordeauth'] to 'full' in IMP config file. This 
may be way around, but it works :). This worked for my old Horde 3 
install, so I configured  Horde 5 in similar way. Am I missing 
something here?
This requires 2 separate connections to the IMAP server.  If using 
auth => application (with imp) it only requires 1.
08/21/2014 05:25:44 PM daniel (at) poradnik-webmastera (dot) com Comment #9 Reply to this comment
I read this file again and found note about having to login twice 
(Horde first, then IMP). Because of this I set 
$servers['advanced']['hordeauth'] to 'full' in IMP config file. This 
may be way around, but it works :). This worked for my old Horde 3 
install, so I configured  Horde 5 in similar way. Am I missing 
something here?
08/21/2014 04:37:24 PM Michael Slusarz Comment #8 Reply to this comment
$conf['auth']['driver'] = 'imap';
If using IMP, you *really* don't want to be using 'imap' 
authentication. Read imp/docs/INSTALL.
08/21/2014 11:57:28 AM daniel (at) poradnik-webmastera (dot) com Comment #7 Reply to this comment
I removed imp/config/backends.local.php (without it Horde shows portal 
page after login) and still get the same error. So this is something 
in Horde, not IMP.

I restored that config file, enabled logging and tried to reproduce 
this again. Below is callstack for this error. I hope it will be 
helpful for you.

2014-08-21T13:45:52+02:00 DEBUG: HORDE  1. 
Horde_Core_Auth_Application->authenticate() /path/horde/login.php:155
  2. Horde_Auth_Base->authenticate() 
/path/pear/PEAR/Horde/Core/Auth/Application.php:126
  3. Horde_Auth_Base->_badLogin() /path/pear/PEAR/Horde/Auth/Base.php:172
  4. Horde_Core_Auth_Application->authenticate() /path/horde/login.php:155
  5. Horde_Auth_Base->authenticate() 
/path/pear/PEAR/Horde/Core/Auth/Application.php:126
  6. Horde_Auth_Base->_badLogin() /path/pear/PEAR/Horde/Auth/Base.php:172
  7. Horde_Core_History->log() /path/pear/PEAR/Horde/Auth/Base.php:352
  8. Horde_History->log() /path/pear/PEAR/Horde/Core/History.php:76
  9. Horde_History_Sql->_log() /path/pear/PEAR/Horde/History.php:124
10. Horde_History_Sql->_nextModSeq() /path/pear/PEAR/Horde/History/Sql.php:141
11. Horde_Core_Auth_Application->authenticate() /path/horde/login.php:155
12. Horde_Auth_Base->authenticate() 
/path/pear/PEAR/Horde/Core/Auth/Application.php:126
13. Horde_Auth_Base->_badLogin() /path/pear/PEAR/Horde/Auth/Base.php:172
14. Horde_Core_History->log() /path/pear/PEAR/Horde/Auth/Base.php:352
15. Horde_History->log() /path/pear/PEAR/Horde/Core/History.php:76
16. Horde_History_Sql->_log() /path/pear/PEAR/Horde/History.php:124
17. Horde_History_Sql->_nextModSeq() /path/pear/PEAR/Horde/History/Sql.php:141
18. Horde_Db_Adapter_Mysqli->insert() 
/path/pear/PEAR/Horde/History/Sql.php:351
19. Horde_Db_Adapter_Mysqli->execute() 
/path/pear/PEAR/Horde/Db/Adapter/Mysqli.php:341

08/21/2014 10:54:16 AM Jan Schneider Comment #6 Reply to this comment
Still cannot reproduce. So my suspicion keeps the same: logging in to 
Horde worked, but failed for IMP. If this is true, the behavior is 
perfectly correct.
08/21/2014 10:34:48 AM daniel (at) poradnik-webmastera (dot) com Comment #5 Reply to this comment
$conf['auth']['checkip'] = false;
$conf['auth']['checkbrowser'] = true;
$conf['auth']['resetpassword'] = false;
$conf['auth']['alternate_login'] = false;
$conf['auth']['redirect_on_logout'] = false;
$conf['auth']['list_users'] = 'list';
$conf['auth']['params']['hostspec'] = 'localhost';
$conf['auth']['params']['port'] = 143;
$conf['auth']['params']['secure'] = 'tls';
$conf['auth']['driver'] = 'imap';
$conf['auth']['params']['count_bad_logins'] = true;
$conf['auth']['params']['login_block'] = true;
$conf['auth']['params']['login_block_count'] = 5;
$conf['auth']['params']['login_block_time'] = 5;
08/21/2014 10:30:06 AM Jan Schneider Comment #4 Reply to this comment
Yes, that authentication configuration in Horde.
08/21/2014 10:16:52 AM daniel (at) poradnik-webmastera (dot) com Comment #3 Reply to this comment
My user name is added to $conf[auth][admins].

I use following code in imp/config/backends.local.php:

$servers['imap']['disabled'] = true;
$servers['advanced'] = array(
     'disabled' => false,
     'name' => 'Advanced IMAP Server',
     'hostspec' => 'localhost',
     'hordeauth' => 'full',
     'protocol' => 'imap',
     'port' => 143,
     'secure' => 'tls',
     'maildomain' => 'mydomain.com'
);

Let me know if you need any other config data.
08/21/2014 10:03:41 AM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Cannot reproduce. I get the error message if the table is missing, but 
no query - only in the logs.
I can only imagine that you haven't set up to let IMP do the 
authentication for Horde, but use 'hordeauth' in IMP instead. Then for 
some reason you have logged in to Horde as an admin, but failed to 
login to IMP.
08/21/2014 09:23:02 AM daniel (at) poradnik-webmastera (dot) com Comment #1
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Base
Summary ⇒ Query displayed after critical error during login
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
I tried to log in to my horde install today and entered wrong 
password. But instead of normal "invalid credential" message, I got 
white screen with following error (I am translating from Polish):

Critical Error
QUERY FAILED: Table 'mydb.horde_histories_modseq' doesn't exist INSERT 
INTO horde_histories_modseq (history_modseqempty) VALUES(0)
Details have been logged for admin.

Please fix this - if you have to display such error, please do not 
display failed query. This is a security issue.

My Horde install was upgraded recently from last Horde 3.x. I suspect 
there was something wrong with upgrade and this table was not created. 
So please take a look on upgrade scripts too.

I am also using IMP, have enabled single sign-on and IMP is displayed 
by default after login - this also may be important here.

Saved Queries