Unknown database type: mysql

Hi there,
in the morning i made an update from seafile 7.0 → 7.1 Since then my services won’t start.
When i try to start ccnet manually it gives the following error:

$ ccnet-server -c /usr/local/www/haiwen/conf -t
[04/18/20 11:28:55] …/common/session.c(148): using config file /usr/local/www/haiwen/conf/ccnet.conf
[04/18/20 11:28:55] server-session.c(273): Unknown database type: mysql.
[04/18/20 11:28:55] server-session.c(78): Failed to load database config.

When i comment the “ENGINE = mysql” it starts, but produces the error with the seafile database. When i comment the entry there (type = mysql) it starts all, but trying to access a non existent sqlite database.

Any idea what could be wrong?
Thanks
Tom

WTF, I was wondering why after my compilation with stretch for raspberry pi I got the same error.

-- Unit seafile.service has begun starting up.
Apr 18 10:05:41 hiperborea seafile.sh[15150]: failed to run "ccnet-server -t"
Apr 18 10:05:41 hiperborea seafile.sh[15150]: [04/18/20 10:05:41] ../common/session.c(148): using config file /media/sda/seafile/conf/ccnet.conf
Apr 18 10:05:41 hiperborea seafile.sh[15150]: [04/18/20 10:05:41] server-session.c(273): Unknown database type: mysql.
Apr 18 10:05:41 hiperborea seafile.sh[15150]: [04/18/20 10:05:41] server-session.c(78): Failed to load database config.
Apr 18 10:05:41 hiperborea systemd[1]: seafile.service: Main process exited, code=exited, status=1/FAILURE
Apr 18 10:05:41 hiperborea systemd[1]: seafile.service: Failed with result 'exit-code'.
Apr 18 10:05:41 hiperborea systemd[1]: Failed to start Seafile Server.
-- Subject: Unit seafile.service has failed

Googling found nothing. In my case I realized that the mysql was not included while compiling ccnet:

   ####@thor ~/env_seafile/dev $ grep -i mysql compile_7.1.3.log
    checking for MYSQL... no
    HEAD is now at de5721d start mysql service (#328)
    checking for MYSQL... no
    seahub-6.0.1/tools/sqlite-to-mysql.sh
    seahub-6.0.1/sql/mysql.sql
    checking for MYSQL... no
    checking for MYSQL... no

and here:

found library uuid
checking for pthread_create in -lpthread... yes
found library pthread
checking for sqlite3_open in -lsqlite3... yes
found library sqlite3
checking for SHA1_Init in -lcrypto... yes
found library crypto
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for SSL... yes
checking for GLIB2... yes
checking for GOBJECT... yes
checking for SEARPC... yes
checking for LIBEVENT... yes
checking for MYSQL... no
checking for a Python interpreter with version >= 2.6... python
checking for python... /usr/bin/python
checking for python version... 3.7
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.7/site-packages
checking that generated files are newer than configure... done

That’s is strange, since I had the mysql-dev libraries earlier. Somehow I’m seeing movements in this way in the seafile-server git. I have to clarify myself what I have really installed and why could be caussed.

This has to be mentioned if you revert from 7.1.3 to 7.0.* again:

seafile@hiperborea:/media/sda/seafile/seafile-server-7.1.3/upgrade$ ./minor-upgrade.sh

-------------------------------------------------------------
This script would do the minor upgrade for you.
Press [ENTER] to contiune
-------------------------------------------------------------



renaming the gunicorn.conf to gunicorn.conf.py ...

Done

------------------------------
migrating avatars ...


DONE
------------------------------


Moving the elasticsearch's configuration file ...


updating seafile-server-latest symbolic link to /media/sda/seafile/seafile-server-7.1.3 ...

DONE

Check the renaming from gunicorn.conf to gunicorn.conf.py. You need to rename again to .conf if you use 7.0.5 again. Nothing serious, but needs to mention for unsuccesfully upgrade to 7.1.3

1 Like

Answering myself after digging in that: There were some changes between 7.0.5 and 7.1.3 for configure.ac.

The issue can be analyzed with:
####@thor ~/env_seafile/dev/ccnet-server $ git diff v7.0.5-server v7.1.3-server -- configure.ac

I had to made some changes on the configure.ac file in order to detect the mariadbclient instead of mysqlclient, since PKG_CONFIG resolves to a non existing existing mysqlclient package.

if test "x${MYSQL_CONFIG}" = "xdefault_mysql_config"; then
    PKG_CHECK_MODULES(MYSQL, [mysqlclient], [have_mysql="yes"], [have_mysql="no"])
    if test "x${have_mysql}" = "xyes"; then
        AC_SUBST(MYSQL_CFLAGS)
        AC_SUBST(MYSQL_LIBS)
        AC_DEFINE([HAVE_MYSQL], 1, [Define to 1 if MySQL support is enabled])
    fi

and trying again, bingo…

checking pkg-config is at least version 0.9.0... yes
checking for SSL... yes
checking for GLIB2... yes
checking for GOBJECT... yes
checking for SEARPC... yes
checking for LIBEVENT... yes
checking for a Python interpreter with version >= 2.6... python
checking for python... /usr/bin/python
checking for python version... 3.7
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.7/site-packages
checking for mysql in unix... yes
checking for mysql_config... /usr/bin/mysql_config
checking mysql.h usability... yes
checking mysql.h presence... yes
checking for mysql.h... yes
found mysql client library

another possibility is to declare the flag --with-mysql=/path/to/mysql_config and that was the option to append as well to the last build command ./build-server.py

this will ends like ./build-server.py --yes --version=7.1.3 ....--mysql_config=/usr/bin/mysql_config

Again, if the flag is not specifically declared, there is not mysql support, even ccnet-server, seafile-server and seahub had mysql enabled, during the ./configure

several impediment more has gone away :sweat:

edited after more tests 19.04.2020

@trupp some updates for you, hope it’ll help!

Thanks for the answers so far. I switched back to the old release. I’m on freebsd and don’t have a virt env, so i will install a testing server and make some tests there.

Tom