Xibo CMS unable accessing mysql docker instance

Hello everybody,
I’m trying to install a Xibo CMS on a Windows 10 Pro 64bit PC. I tried both Xibo xibo-docker-2.3.9 and xibo-docker-2.3.10.

Installation on my PC, and home network (without proxy and so on) worked fine.

Now, while installing it on a company network, I’m facing some issue.
The MySql instance starts fine (I can see the image on the docker panel

and also the following “docker compose up” logs seems fine)

cms-db_1          | 2021-05-13 12:39:01 1 [Note] mysqld: ready for connections.
cms-db_1          | Version: '5.6.51'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)

However, when “docker compose up” command tries to setup cms-web, I get the following output:

cms-web_1         | In MysqlAdapter.php line 115:
cms-web_1         |
cms-web_1         |   There was a problem connecting to the database: SQLSTATE[HY000] [2002] php_
cms-web_1         |   network_getaddresses: getaddrinfo failed: Try again
cms-web_1         |
cms-web_1         |
cms-web_1         | migrate [-c|--configuration CONFIGURATION] [-p|--parser PARSER] [-e|--environment ENVIRONMENT] [-t|--target TARGET] [-d|--date DATE] [-x|--dry-run]
cms-web_1         |
cms-web_1         | Configuring Database Settings
cms-web_1         | ERROR 2005 (HY000): Unknown MySQL server host 'mysql' (-3)
cms-web_1         | ERROR 2005 (HY000): Unknown MySQL server host 'mysql' (-3)

Therefore I tried modifying the DNS setup on the Docker Settings Page, forcing the entry “Bypass proxy settings for these hosts & domains” to the value

mysql, 127.0.0.0/8

In order to be sure that cms-web wont be searching for mysql asking to the DNS, but nothing happened.

I tried accessing the xibo-cms web page through the docker menu “Open in browser” (please look at tooltip in the following image


)

But the web page states:

Fatal Error - sorry this shouldn't happen. SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again

Is there anyone facing a similar issue in a production environment? I think may be I should modify the MYSQL_HOST environment variable on xibo-cms, but I’m not an expert in this field.

I provide also the full log generated by
“docker compose up”
as a pdf file.

fullLog.pdf (41.0 KB)

Thank to anyone will be able to help me, best regards
Giovanni

Some additional detail:

from the command line of the docker xibo-docker-239_cms-web_1, I tried the following commands:

mysql -u cms -p -h mysql
Enter password:

ERROR 2005 (HY000): Unknown MySQL server host 'mysql' (-3)

So the issue can be reproduced inside both

  • xibo-docker-239_cms-web_1
  • xibo-docker-2310_cms-web_1

However, performing command:
mysql -u cms -p -h 127.0.0.1

inside the xibo-docker-239_cms-db_1, connection is successful, so the mysql instance inside that apps is working fine.

Finally, performing command:
docker inspect xibo-docker-239_cms-db_1

I found the IPAddress associated with the mysql apps container (172.18.0.3).
Therefore, in the command line of docker xibo-docker-239_cms-web_1, I performed following command:

mysql -u cms -p -h 172.18.0.3

and it works fine.

So it really seems that the name “mysql” is not visible to the xibo-docker-239_cms-web_1 instance.

If anyone is able to provide some hint about how to fix the “by name” connection to mysql apps, it could be really useful.

If I have any update I will post additional info, in order to share interesting details to other customers.

Best regards

1 Like

Hello everybody.
It seems I understood what happens.
As stated in https://docs.docker.com/network/links/ link in docker are legacy features.

Installing last version, it seems that this support has been broken, because the CMS container is unable to connect to the mysql container by name.
I’m able to connect only by using IP address, editing yml file.

Therefore, I gave a try to previous version (3.1) and it seems to work.

However docker community adopted a force update policy, so after few minutes, the docker SW updates to last version, and everything is broken.

I fixed my issue acting in this way:

Now everything works fine.
Please note: may be this is a wrong approach, but this is the best one I can find, and it fixes my issues. If anyone can suggest a better approach, please let me know.

1 Like

Thanks for posting and for the excellent explanation of both the problem and the workaround.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.