[horde] A fatal error has occurred utf8 is not supported by MySQL

Larry Weldon lweldon at weldoncomputers.com
Sun Jun 5 11:53:51 UTC 2022


On 6/3/2022 12:15 PM, Louis-Philippe Allard wrote:
>  Quoting Larry Weldon <lweldon at weldoncomputers.com>:
>
>> Hi,
>>
>> This post is to document a problem and its' solution. Some months ago 
>> I installed Horde Groupware 5.2.22 on two separate Ubuntu 20.04 
>> servers. Mysql is the database used. Both installations worked great 
>> for about 6 months.
>>
>> Both servers began throwing the exception (subject above) at slightly 
>> different times. The error occurred in the initial access/login to 
>> the server. I didn't notice whether an update caused it or not.
>>
>> Sorting through many different clues from Google searches I found the 
>> following line in conf.php
>> #$conf['sql']['charset'] = 'utf-8';
>> $conf['sql']['charset'] = 'utf8mb4';
>>
>> Both servers are functioning well again.
>>
>> It would be nice to know if an update of mysql or horde was 
>> responsible. It happened on May 9th (2022) and took me awhile to fix.
>>
>> Thanks,
>>
>> Larry
>>
>> -- 
>> Horde mailing list
>> Frequently Asked Questions: http://horde.org/faq/To unsubscribe, 
>> mail: horde-unsubscribe at lists.horde.org
>
> It would be nice to have the full fatal error stack strace to see the 
> actual errors encountered by Horde...  For me, on Centos/RHEL/Rocky 
> Linux, I went thru MANY Myql/MariaDB upgrades in the last 10y or so, 
> and never had an issue with Mysql connections.
>
> My conf.php shows:
>
>  $conf['sql']['username'] = '************';
>  $conf['sql']['password'] = '*************';
>  $conf['sql']['hostspec'] = '************';
>  $conf['sql']['port'] = 3306;
>  $conf['sql']['protocol'] = 'tcp';
>  $conf['sql']['database'] = '************';
>  $conf['sql']['charset'] = 'utf-8';
>  $conf['sql']['ssl'] = false;
>  $conf['sql']['splitread'] = false;
>  $conf['sql']['logqueries'] = true;
>  $conf['sql']['phptype'] = 'mysqli';
>  $conf['nosql']['phptype'] = false;
>  $conf['auth']['driver'] = 'sql';
>
> I am running 2 Ubuntu based servers (one for a Unifi controller and 
> another for xwiki because it was MUCH easier to get it up and running 
> on ubuntu than Rocky Linux) and both machines are flaky after 
> updates... IMO and experience, the ubuntu ecosystem changes too fast 
> and this can create troubles like the one you described....  Food for 
> thought.
>  Louis-Philippe Allard
> lp.allard.1 at gmail.com
> Sent using Horde Groupware on GNU/Linux
Thanks for the reply Louis-Philippe. Setting the conf.php back to what 
it was in my post above reliably gives the error trace in the 
attachment. I also notice your conf.php has mysqli instead of my:
$conf['sql']['phptype'] = 'mysql';

I was quite surprised to see your charset variable as 'utf-8' working as 
the search results I found always pointed to a problem with utf-8 
arising many years ago in mysql in which the mysql people fixed the 
problem only by creating the 'utf8mb4' work around.

But I only wanted to document what fixed my problem. I will see what is 
the difference between mysqli and mysql.

Larry
-------------- next part --------------
A fatal error has occurred
utf8 is not supported by MySQL (armscii8, ascii, big5, binary, cp1250, cp1251, cp1256, cp1257, cp850, cp852, cp866, cp932, dec8, eucjpms, euckr, gb18030, gb2312, gbk, geostd8, greek, hebrew, hp8, keybcs2, koi8r, koi8u, latin1, latin2, latin5, latin7, macce, macroman, sjis, swe7, tis620, ucs2, ujis, utf16, utf16le, utf32, utf8mb3, utf8mb4)
in /usr/share/php/Horde/Db/Adapter/Mysql/Schema.php:579

 1. Horde_Registry::appInit() /var/www/welcoin.com/horde/services/portal/index.php:15
 2. Horde_Registry->pushApp() /usr/share/php/Horde/Registry.php:298
 3. Horde_Core_LoginTasks->runTasks() /usr/share/php/Horde/Registry.php:1650
 4. Horde_LoginTasks->runTasks() /usr/share/php/Horde/Core/LoginTasks.php:48
 5. Horde_LoginTasks_Task_AdminCheck->execute() /usr/share/php/Horde/LoginTasks.php:216
 6. Horde_Core_Db_Migration->getMigrator() /var/www/welcoin.com/horde/lib/LoginTasks/Task/AdminCheck.php:54
 7. Horde_Injector->getInstance() /usr/share/php/Horde/Core/Db/Migration.php:117
 8. Horde_Injector->createInstance() /usr/share/php/Horde/Injector.php:272
 9. Horde_Injector_Binder_Factory->create() /usr/share/php/Horde/Injector.php:238
10. Horde_Core_Factory_DbBase->create() /usr/share/php/Horde/Injector/Binder/Factory.php:119
11. Horde_Core_Factory_Db->create() /usr/share/php/Horde/Core/Factory/DbBase.php:17
12. Horde_Core_Factory_Db->_createDb() /usr/share/php/Horde/Core/Factory/Db.php:106
13. Horde_Db_Adapter_Base->__construct() /usr/share/php/Horde/Core/Factory/Db.php:189
14. Horde_Db_Adapter_Pdo_Mysql->connect() /usr/share/php/Horde/Db/Adapter/Base.php:157
15. Horde_Db_Adapter_Base->__call() /usr/share/php/Horde/Db/Adapter/Pdo/Mysql.php:69
16. Horde_Db_Adapter_Mysql_Schema->setCharset() /usr/share/php/Horde/Db/Adapter/Base.php:274
17. Horde_Db_Adapter_Mysql_Schema->_mysqlCharsetName() /usr/share/php/Horde/Db/Adapter/Mysql/Schema.php:561

Details
The full error message is logged in Horde's log file, and is shown below only to administrators. Non-administrative users will not see error details.

Horde_Db_Exception Object
(
    [details] => 
    [logged] => 1
    [_logLevel:protected] => 0
    [message:protected] => utf8 is not supported by MySQL (armscii8, ascii, big5, binary, cp1250, cp1251, cp1256, cp1257, cp850, cp852, cp866, cp932, dec8, eucjpms, euckr, gb18030, gb2312, gbk, geostd8, greek, hebrew, hp8, keybcs2, koi8r, koi8u, latin1, latin2, latin5, latin7, macce, macroman, sjis, swe7, tis620, ucs2, ujis, utf16, utf16le, utf32, utf8mb3, utf8mb4)
    [string:Exception:private] => 
    [code:protected] => 0
    [file:protected] => /usr/share/php/Horde/Db/Adapter/Mysql/Schema.php
    [line:protected] => 579
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /usr/share/php/Horde/Db/Adapter/Mysql/Schema.php
                    [line] => 561
                    [function] => _mysqlCharsetName
                    [class] => Horde_Db_Adapter_Mysql_Schema
                    [type] => ->
                )

            [1] => Array
                (
                    [file] => /usr/share/php/Horde/Db/Adapter/Base.php
                    [line] => 274
                    [function] => setCharset
                    [class] => Horde_Db_Adapter_Mysql_Schema
                    [type] => ->
                )

            [2] => Array
                (
                    [file] => /usr/share/php/Horde/Db/Adapter/Pdo/Mysql.php
                    [line] => 69
                    [function] => __call
                    [class] => Horde_Db_Adapter_Base
                    [type] => ->
                )

            [3] => Array
                (
                    [file] => /usr/share/php/Horde/Db/Adapter/Base.php
                    [line] => 157
                    [function] => connect
                    [class] => Horde_Db_Adapter_Pdo_Mysql
                    [type] => ->
                )

            [4] => Array
                (
                    [file] => /usr/share/php/Horde/Core/Factory/Db.php
                    [line] => 189
                    [function] => __construct
                    [class] => Horde_Db_Adapter_Base
                    [type] => ->
                )

            [5] => Array
                (
                    [file] => /usr/share/php/Horde/Core/Factory/Db.php
                    [line] => 106
                    [function] => _createDb
                    [class] => Horde_Core_Factory_Db
                    [type] => ->
                )

            [6] => Array
                (
                    [file] => /usr/share/php/Horde/Core/Factory/DbBase.php
                    [line] => 17
                    [function] => create
                    [class] => Horde_Core_Factory_Db
                    [type] => ->
                )

            [7] => Array
                (
                    [file] => /usr/share/php/Horde/Injector/Binder/Factory.php
                    [line] => 119
                    [function] => create
                    [class] => Horde_Core_Factory_DbBase
                    [type] => ->
                )

            [8] => Array
                (
                    [file] => /usr/share/php/Horde/Injector.php
                    [line] => 238
                    [function] => create
                    [class] => Horde_Injector_Binder_Factory
                    [type] => ->
                )

            [9] => Array
                (
                    [file] => /usr/share/php/Horde/Injector.php
                    [line] => 272
                    [function] => createInstance
                    [class] => Horde_Injector
                    [type] => ->
                )

            [10] => Array
                (
                    [file] => /usr/share/php/Horde/Core/Db/Migration.php
                    [line] => 117
                    [function] => getInstance
                    [class] => Horde_Injector
                    [type] => ->
                )

            [11] => Array
                (
                    [file] => /var/www/welcoin.com/horde/lib/LoginTasks/Task/AdminCheck.php
                    [line] => 54
                    [function] => getMigrator
                    [class] => Horde_Core_Db_Migration
                    [type] => ->
                )

            [12] => Array
                (
                    [file] => /usr/share/php/Horde/LoginTasks.php
                    [line] => 216
                    [function] => execute
                    [class] => Horde_LoginTasks_Task_AdminCheck
                    [type] => ->
                )

            [13] => Array
                (
                    [file] => /usr/share/php/Horde/Core/LoginTasks.php
                    [line] => 48
                    [function] => runTasks
                    [class] => Horde_LoginTasks
                    [type] => ->
                )

            [14] => Array
                (
                    [file] => /usr/share/php/Horde/Registry.php
                    [line] => 1650
                    [function] => runTasks
                    [class] => Horde_Core_LoginTasks
                    [type] => ->
                )

            [15] => Array
                (
                    [file] => /usr/share/php/Horde/Registry.php
                    [line] => 298
                    [function] => pushApp
                    [class] => Horde_Registry
                    [type] => ->
                )

            [16] => Array
                (
                    [file] => /var/www/welcoin.com/horde/services/portal/index.php
                    [line] => 15
                    [function] => appInit
                    [class] => Horde_Registry
                    [type] => ::
                )

        )

    [previous:Exception:private] => 
)


More information about the horde mailing list