Author Topic: DB Error after 1.60 upgrade  (Read 528 times)

Offline DSV12

  • Newbie
  • *
  • Posts: 2
DB Error after 1.60 upgrade
« on: August 01, 2022, 03:47:39 AM »
After upgrade roundcube from 1.5.3 -> 1.6.0 we got error with database connection:

Code: [Select]
DB Error: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: NO) in /xxx/roundcubemail/program/lib/Roundcube/rcube_db.php on line 200 (GET /webmail/)
All(?) necessary corrections have been made manually in config.inc.php:
Code: [Select]
renamed default_host to imap_host
renamed smtp_server to smtp_host

Environment:
Code: [Select]
# uname -r
4.18.0-372.16.1.0.1.el8_6.x86_64
# php -v
PHP 7.4.19 (cli) (built: May  4 2021 11:06:37) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.19, Copyright (c), by Zend Technologies
# mysql --version
mysql  Ver 15.1 Distrib 10.3.32-MariaDB, for Linux (x86_64) using readline 5.1

# httpd -v
Server version: Apache/2.4.37 (Oracle Linux)
Server built:   Jun 22 2022 14:35:49

I noticed that in the roundcubemail/program/lib/Roundcube/rcube_db.php module, the lines related to the connection with the database have been changed, for example (left - 1.5.3, right - 1.6.0)
Code: [Select]
<             $username = isset($dsn['username']) ? $dsn['username'] : null;
<             $password = isset($dsn['password']) ? $dsn['password'] : null;
---
>             $username = $dsn['username'] ?? null;
>             $password = $dsn['password'] ?? null;

But as I see the syntax in the config.inc.php.sample did not changed:
Code: [Select]
$config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
Why doesn't it work?
« Last Edit: August 01, 2022, 04:19:07 AM by DSV12 »

Offline DSV12

  • Newbie
  • *
  • Posts: 2
Re: DB Error after 1.60 upgrade
« Reply #1 on: August 01, 2022, 10:57:58 PM »
SOLVED!

I think I found the cause of the problem - in config.inc.php password for to communicate with the database contain special characters (exclamation point in my my case), something like:

Code: [Select]
$config['db_dsnw'] = 'mysql://roundcube:Megapassw%21ord@localhost/roundcube';
When I changed '!' (%21) to a regular character (digit) - version 1.6.0 started working fine. Miracle :)