sabre-io / Baikal

Baïkal is a Calendar+Contacts server
https://sabre.io/baikal/
GNU General Public License v3.0
2.51k stars 291 forks source link

connection problem when migrating database from MariaDB(5.x) to MariaDB10 #917

Closed mark-sugus closed 4 years ago

mark-sugus commented 4 years ago

Baikal version: 0.2.6

Problem: On my Synology NAS I have migrated my Baikal database from MariaDB5 to MariaDB10. I can connecting with myphpAdmin to the MariaDB10 database and see all the tables belonging to Baikal. However if want to access the Baikal admin page a get the message:

exception 'Exception' with message 'Fatal error: no connection to a database is available.' in /volume1/web/baikal.app/Core/Frameworks/Baikal/Core/Tools.php:66
Stack trace:
#0 /volume1/web/baikal.app/Core/Frameworks/Baikal/Framework.php(79): Baikal\Core\Tools::assertBaikalIsOk()
#1 /volume1/web/baikal.app/Core/Frameworks/BaikalAdmin/Framework.php(34): Baikal\Framework::bootstrap()
#2 /volume1/web/baikal.app/admin/index.php(54): BaikalAdmin\Framework::bootstrap()
#3 {main}

I already changed the default Synology port number (3307) for MariaDB10 to the default MariaDB port number 3305 and my process information is showing this:

root     14184  0.0  0.0  11992  2944 ?        S    18:34   0:00 /bin/sh /usr/local/mariadb10/bin/mysqld_safe --datadir=/var/packages/MariaDB10/target/mysql --pid-file=/run/mysqld/mysqld10.pid
mysql    14486  0.0  0.5 1470748 54820 ?       Sl   18:34   0:00 /usr/local/mariadb10/bin/mysqld --basedir=/usr/local/mariadb10 --datadir=/var/packages/MariaDB10/target/mysql --plugin-dir=/usr/local/mariadb10/lib/mysql/plugin --user=mysql --log-error=/var/packages/MariaDB10/target/mysql/sugus.err --pid-file=/run/mysqld/mysqld10.pid --socket=/run/mysqld/mysqld10.sock --port=3306
root     21133  0.0  0.0  23148  2336 pts/19   S+   18:48   0:00 grep --color=auto mysql

I don't know how to resolve the issue. Any idea is very appreciated.

The main reason to migrate to MariaDB10 is that I would like to upgrade to the newer Baikal 0.6.x version. But before that my actual version should run with MariaDB10. Thanks to all who are doing a great job in continuosly developing Baikal.

Mark

ByteHamster commented 4 years ago

In that (ancient) version of Baikal, the check for the database connection is commented out for whatever reason. Maybe you can add something like echo $e->getMessage(); there to learn more details about why it fails.

https://github.com/sabre-io/Baikal/blob/d223f2fa309e81df54d69c48bfb1962a0deb970a/Core/Frameworks/Flake/Framework.php#L279-L291

mark-sugus commented 4 years ago

Thank you for the quick reply. With your answer I decided to first upgrade my baikal version before trying to fix the db connection issue. In my previous trials more than a year ago I didn’t succeed to upgrade to 0.4.6 But today I managed to upgrade to 0.5.3 successfully with mariaDB5 as DB server. I transferred the db to mariaDB10. For correct connection to mariaDB10 I had to change the PROJECT_DB_MYSQL_HOST in config.system.php from localhost to 127.0.0.1. From a short check and use with different clients it seems that everything is working like a charm now. Thank again.

Cheers Mark

Am 02.05.2020 um 23:39 schrieb H. Lehmann notifications@github.com:

In that (ancient) version of Baikal, the check for the database connection is commented out for whatever reason. Maybe you can add something like echo $e->getMessage(); there to learn more details about why it fails.

https://github.com/sabre-io/Baikal/blob/d223f2fa309e81df54d69c48bfb1962a0deb970a/Core/Frameworks/Flake/Framework.php#L279-L291 https://github.com/sabre-io/Baikal/blob/d223f2fa309e81df54d69c48bfb1962a0deb970a/Core/Frameworks/Flake/Framework.php#L279-L291 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sabre-io/Baikal/issues/917#issuecomment-623016692, or unsubscribe https://github.com/notifications/unsubscribe-auth/APNIZVTHNBDCSJYJEF6T4HDRPSHHVANCNFSM4MXHCPZA.