I am trying nocodb in docker.
I have a mysql server for which I have setup a specific username nocodb with a password. This user has all permissions on the object nocodb_test_1 database. The mysql server runs with container name mysql-prod-5.7
.
I have launched a nocodb server also in docker. I have added it to the network with docker network connect mysql nocodb
.
The nocodb server runs on the docker network mysql
with container name nocodb
.
Both machines are connected via the docker network. To test, I do docker exec -it nocodb sh
and then inside ping mysql-prod-5.7
and the mysql responds.
(I prepared an image to set here but the forum does not allow me to upload images)
The mysql server is properly configured because if I enter from a client machine, like with docker run --rm -it --network mysql mysql bash
and then inside I connect with mysql -h mysql-prod-5.7 -u nocodb -p
and after hitting enter I paste the password, I may enter the MySQL machine. Then show databases;
I see the nocodb_test_1
. Then I use nocodb_test_1
and it works.
(I prepared a second image to set here but the forum does not allow me to upload images)
So conclusion:
- MySQL properly setup, with a database and a user/pwd able to connect to that DB.
- NocoDB container able to speak to the mysql container.
Then I in the frontend, I create a new connection and set all the parameters and then TEST the connection I get the “getaddrinfo ENOTFOUND”:
(I prepared a final image to set here but the forum does not allow me to upload images)
In the firefox debugger I truly see the frontend sending a POST request to the backend with the connection data.
How is it possible that the backend does not know how to resolve the host mysql-prod-5.7
when a ping actually works?
The only thing I may think if is that nocodb is using a non-mature library to resolve networking and as the name contains a dot, the library gets confused.
Any help on how to debug (and correct) this will be welcome!
PD: Solution cannot be “try a docker container with a name without a dot”.