[horde] Gollem: MySQL access denied due to empty password
Jan Schneider
jan at horde.org
Mon Apr 13 11:02:06 UTC 2015
Zitat von Daniel Kraus <krada at gmx.net>:
> Hello,
>
> I have a cron job executing `horde-alarms` and my syslog fills up with
>
>> HORDE: [gollem] PHP ERROR: mysqli::mysqli(): (28000/1045): Access
>> denied for user 'horde'@'localhost' (using password: NO) [pid 14499
>> on line 135 of "/usr/share/php/Horde/Db/Adapter/Mysqli.php"]
>
> This is on Horde Webmail Edition 5.2.5 which works very well on my
> system, including sending alarm e-mails.
>
> To debug, I added this line to `/usr/share/php/Horde/Db/Adapter/Mysqli.php`:
>
>> error_log("Host: >${config['host']}< -- Username:
>> >${config['username']}< -- Password: >${config['password']}<\n");
>
> And the output from `horde-alarms` was:
>
>> Host: >< -- Username: >horde< -- Password: >***REDACTED***<
>>
>> Host: >127.0.0.1< -- Username: >horde< -- Password: ><
>
> Evidently, the DB connection is made twice, the first time around the
> appropriate credentials are used, while the second time around the
> config does not appear to be set correctly as the `$config['password']`
> is empty.
>
> I then added `debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);` to
> Mysqli.php and got this:
>
> Appropriate credentials:
>
>> #0 Horde_Db_Adapter_Mysqli->connect() called at
>> [/usr/share/php/Horde/Db/Adapter/Base.php:150]
>> #1 Horde_Db_Adapter_Base->__construct() called at
>> [/usr/share/php/Horde/Core/Factory/Db.php:180]
>> #2 Horde_Core_Factory_Db->_createDb() called at
>> [/usr/share/php/Horde/Core/Factory/Db.php:99]
>> #3 Horde_Core_Factory_Db->create() called at
>> [/usr/share/php/Horde/Core/Factory/Perms.php:31]
>> #4 Horde_Core_Factory_Perms->create() called at
>> [/usr/share/php/Horde/Injector/Binder/Factory.php:119]
>> #5 Horde_Injector_Binder_Factory->create() called at
>> [/usr/share/php/Horde/Injector.php:238]
>> #6 Horde_Injector->createInstance() called at
>> [/usr/share/php/Horde/Injector.php:272]
>> #7 Horde_Injector->getInstance() called at
>> [/usr/share/php/Horde/Registry.php:1737]
>> #8 Horde_Registry->hasPermission() called at
>> [/usr/share/php/Horde/Registry.php:884]
>> #9 Horde_Registry->listApps() called at
>> [/usr/share/php/Horde/Core/Notification/Handler.php:69]
>> #10 Horde_Core_Notification_Handler->attachAllAppHandlers() called
>> at [/usr/share/php/Horde/Registry.php:570]
>> #11 Horde_Registry->__construct() called at
>> [/usr/share/php/Horde/Registry.php:287]
>> #12 Horde_Registry::appInit() called at [/usr/bin/horde-alarms:25]
>
> Empty password:
>
>> #0 Horde_Db_Adapter_Mysqli->connect() called at
>> [/usr/share/php/Horde/Db/Adapter/Base.php:150]
>> #1 Horde_Db_Adapter_Base->__construct() called at
>> [/usr/share/php/Horde/Core/Factory/Db.php:180]
>> #2 Horde_Core_Factory_Db->_createDb() called at
>> [/usr/share/php/Horde/Core/Factory/Db.php:99]
>> #3 Horde_Core_Factory_Db->create() called at
>> [/var/horde/gollem/lib/Factory/Vfs.php:56]
>> #4 Gollem_Factory_Vfs->create() called at
>> [/var/horde/gollem/lib/Auth.php:82]
>> #5 Gollem_Auth::authenticate() called at
>> [/var/horde/gollem/lib/Auth.php:187]
>> #6 Gollem_Auth::transparent() called at
>> [/var/horde/gollem/lib/Application.php:184]
>> #7 Gollem_Application->authTransparent()
>> #8 call_user_func_array() called at
>> [/usr/share/php/Horde/Registry.php:1191]
>> #9 Horde_Registry->callAppMethod() called at
>> [/usr/share/php/Horde/Core/Auth/Application.php:370]
>> #10 Horde_Core_Auth_Application->transparent() called at
>> [/usr/share/php/Horde/Registry.php:2183]
>> #11 Horde_Registry->isAuthenticated() called at
>> [/usr/share/php/Horde/Registry.php:1728]
>> #12 Horde_Registry->hasPermission() called at
>> [/usr/share/php/Horde/Registry.php:884]
>> #13 Horde_Registry->listApps() called at
>> [/usr/share/php/Horde/Core/Factory/Alarm.php:140]
>> #14 Horde_Core_Factory_Alarm->load()
>> #15 call_user_func() called at [/usr/share/php/Horde/Alarm.php:113]
>> #16 Horde_Alarm->listAlarms() called at [/usr/share/php/Horde/Alarm.php:431]
>> #17 Horde_Alarm->notify() called at [/usr/bin/horde-alarms:28]
>
> And this is where I get stuck.
>
> I should reiterate that I do receive alarm e-mails from Horde. So it's
> not a fatal issue. Everything works! But I would like to keep my syslog
> clean.
>
> Does anybody know what the problem is?
Yes. To load alarms from all available applications, Horde needs to
check the applications' permissions. For Gollem, transparent
authentication is enabled, so it tries to authenticate with the
current user name and password. Since the cron script is run as an
administrator, but without a password, you get that message. This not
easily solvable, but I'm pretty sure there is some open bug ticket to
track this issue.
--
Jan Schneider
The Horde Project
http://www.horde.org/
https://www.facebook.com/hordeproject
More information about the horde
mailing list