I installed Seafile 12.0 with docker containers within a Proxmox VM.
This VM has also a mariadb database installed with the same tables and credentials as in the seafile-mysql container.
Seafile starts fine if the seafile-mysql container is connected.
But it fails if the external database is addressed following the instructions under “Deploy with an existing MySQL server.” The repeated error message is “waiting for mysql server to be ready: mysql is not ready”.
How can I debug what is going on? Obviously there is no mariadb-client installed in the seafile container. How is this container suppposed to connect to the database?
I have Passbolt installed in another container in the same VM. Since Passbolt needs a mysql database as well, it would be silly to run Mariadb twice on the same machine.
Any help appreciated!
Ralph
I know this can work, since I have set mine up the same way, with seafile in a container but connecting to the mysql server running not in a container.
The first thing you need to do is change the docker .env file to tell seafile where it can find the mysql server. For the DB_HOST you would put the IP of the VM (192.168.69.5 in my case) the mysql server is running on, and for SEAFILE_MYSQL_DB_PASSWORD put in the password the seafile user will use to log into the database.
SEAFILE_MYSQL_DB_HOST=192.168.69.5
SEAFILE_MYSQL_DB_USER=seafile
SEAFILE_MYSQL_DB_PASSWORD=Password
There is also a line for the password for the root user to the mysql server, but you only need that if you are doing a new setup and want to let seafile make the databases for itself.
I also had to make some changes to the mysql server configs. First is to tell it to listen for remote connections over the network because to mysql it looks like the container is a different machine. I’m actually using mariadb, which is a fork of mysql. In the /etc/mysql/mariadb.conf.d/50-server.cnf file, I added:
bind-address = 192.168.69.5
port = 3306
I was switching from running seafile without docker, to running with docker, so I had to change the seafile user in the database. The original steps I followed for creating the seafile user created the user to only work when logging in locally. Also I had to grant the seafile user with a remove connection access to the seafile databases.
GRANT ALL PRIVILEGES ON *.* TO 'seafile'@'%' IDENTIFIED BY 'seafile_user_password' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `ccnet_db`.* to 'seafile'@'%';
GRANT ALL PRIVILEGES ON `seafile_db`.* to 'seafile'@'%';
GRANT ALL PRIVILEGES ON `seahub_db`.* to 'seafile'@'%';
It works now. My mistake was that I had not replaced “db” by the ip address in the conf files. The hint is missing in the docs of 12.0.
Which IP did you use? I can’t get this to work and am having the same issue.
If I understand your question correctly, you need to set DB_HOST in the .env file to the IP that you configured your mysql or mariadb server to listen on.
Well, you have to bind mariadb or mysql to the network ip address of the host. And you must set this ip as db_host in the .env file.
Plus you must replace “db” in all seagate conf files by the same host ip. Good luck!