I used to run XIBo in a previous version on a standalone docker machine, but the project never really kicked off. Right now I need to run it within docker swarm but can’t solve the MYSQL connection.
CMS Version
4.03
All container services are up and running with this docker-compose.yml code.
I had to remove the links option, since it’s not supported for docker swarm and replaced with some kind of double kill nerworks-aliases as well as labels.
Anyhow service cms-web still keeps failing with an MYSQL connection error:
ERROR 2002 (HY000): Can't connect to MYSQL server 'cms-db' (115)
I don’t think you need to alias the networks - as long as all containers share the same network (which they should) then the container name should be accessible between containers.
You could remove the aliases and try again (probably after down to clear up)
Seems to work a little better, but not perfect yet
XIBO-WEB log:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.16.9. Set the 'ServerName' directive globally to suppress this message
I did set MYSQL_HOST=cms-db in the config.env file again, cleared the stack and redeployed it. The command docker-compose exec cms-web sh -c "echo $MYSQL_HOST" still outputs an empty value, but now cms-web logs ERROR 2002 (HY000): Can't connect to MySQL server on 'cms-db' (115) again.
I checked the cms-db log to see whether the connection is refused somewhere on db side, but doesn’t seem so.
2023-10-04T07:29:08.542146Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.34' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
2023-10-04T07:29:08.542288Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
```
So I’m feeling like going with an external MYSQL-DB since I can already connect to it…
Bad thing that I’m still stuck on the “upgrade in progress” screen.
I wasn’t able to find anything on the docs regarding the requirements of the MYSQL DB. Currently my DB has “utf8_general_ci” collation - is this correct?
Just ran a blank installation to see whether I missed out on something. I recognized one line in the xibo-web log:
== 20180130073838 InstallMigration: migrating
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes in /var/www/cms/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php:192
The phinx status is still shown as down on all migrations, even after starting migration manually by
docker-compose exec cms-web sh -c "cd /var/www/cms; php vendor/bin/phinx migrate"
Ah yes, if the first migration fails then all bets are off.
Is your external MySQL 5.6 by any chance?
767 bytes in MySQL version 5.6 (and prior versions), is the stated prefix limitation for InnoDB tables. This limit has been increased to 3072 bytes In MySQL version 5.7 (and upwards).
We could find and fix that key, but I think you’ll hit that multiple times as you progress through the migrations.
Ah, seeams like it’s the same problem with MariaDB.
I installed MYSQL 8.1 on the remote server and Xibo started right away!
Still can’t understand why Xibo won’t find the db when hosted in an own container on the same docker network - but anyhow it works now with the remote db.