# "getaddrinfo ENOTFOUND" when adding a data source

**URL:** <https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916>\
**Category:** Self-Host\
**Created:** [October 24, 2023, 10:34pm UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916 "2023-10-24T22:34:45Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![xmontero](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.nocodb.com/xmontero/32/381_2.png) [@xmontero](https://community.nocodb.com/u/xmontero)\
**Post date:** [October 24, 2023, 10:34pm UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916/1 "2023-10-24T22:34:45Z")

</div>

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”.

---

<div class="post-metadata">

**Author:** ![pranavxc](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@pranavxc](https://community.nocodb.com/u/pranavxc)\
**Post date:** [October 25, 2023, 5:52am UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916/2 "2023-10-25T05:52:45Z")

</div>

Can you confirm all the connection params are fine and there is no duplicate NocoDB container running. And if possible share the screenshots in our discord channel - [NocoDB | Discord](https://discord.gg/5RgZmkW) , you can DM me directly as well ( @pranavxc )

---

<div class="post-metadata">

**Author:** ![xmontero](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.nocodb.com/xmontero/32/381_2.png) [@xmontero](https://community.nocodb.com/u/xmontero)\
**Post date:** [October 25, 2023, 3:15pm UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916/3 "2023-10-25T15:15:12Z")

</div>

Yes, I confirm I double checked it and even triple-checked it.

About container duplication =\> No. Only one single container was running.

One of the ways I checked the conenction was to open firefox, and copy from the POST request the host/user/pwd into the CLI and it worked, so really the params were good.

I’ll try to reproduce a “mininum case” with an empty mysql container (will try also with the dot thing and without) and when tested the “minimum case” I’ll show you back the “how to reproduce”.

About the discord, I even don’t know if I have discord installed or not. Will check.

---

<div class="post-metadata">

**Author:** ![pranavxc](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@pranavxc](https://community.nocodb.com/u/pranavxc)\
**Post date:** [October 26, 2023, 2:02pm UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916/4 "2023-10-26T14:02:26Z")

</div>

Can you share a screenshot of the form which is filled with the connection values(ignore any confidential data)?

---

<div class="post-metadata">

**Author:** ![xmontero](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.nocodb.com/xmontero/32/381_2.png) [@xmontero](https://community.nocodb.com/u/xmontero)\
**Post date:** [October 28, 2023, 10:42am UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916/5 "2023-10-28T10:42:50Z")

</div>

Thanks! Seems I now can upload images.

`mysql-prod-5.7` is the mysql server container.

I’m going to upload the 3 images I pretended to upload in the first post.

# Step #1: Checking credentials are right from another container

This is another container in the same network validating the connection credentials:

 ![2023-10-25 00 29 15](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/845a2c7357e087b8de05fc14adbcdbc55826ae6c.png)

---

<div class="post-metadata">

**Author:** ![pranavxc](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@pranavxc](https://community.nocodb.com/u/pranavxc)\
**Post date:** [October 28, 2023, 10:46am UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916/6 "2023-10-28T10:46:59Z")

</div>

Thanks for sharing with annotation Nd error message, I will try to reproduce it locally with docker-compose and get back to you.

---

<div class="post-metadata">

**Author:** ![xmontero](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.nocodb.com/xmontero/32/381_2.png) [@xmontero](https://community.nocodb.com/u/xmontero)\
**Post date:** [October 28, 2023, 10:49am UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916/7 "2023-10-28T10:49:04Z")

</div>

# Step #2: Checking nocodb container has networking access to the mysql server

This is the verification that the nocodb container can see the mysql server container.

 ![2023-10-25 00 31 21](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/cb8b2d5c5d8bfb27b64b710d40b43c04242b4c5f.png)

---

<div class="post-metadata">

**Author:** ![xmontero](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.nocodb.com/xmontero/32/381_2.png) [@xmontero](https://community.nocodb.com/u/xmontero)\
**Post date:** [October 28, 2023, 10:49am UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916/8 "2023-10-28T10:49:38Z")

</div>

# Step #3 (failure) Trying to make nocodb to connect

This is the nocodb frontend:

 ![2023-10-25 00 19 18](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/3966cf91d1ddcb34d28ffca8c9ada2b48a95e6f2.png)

---

<div class="post-metadata">

**Author:** ![xmontero](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.nocodb.com/xmontero/32/381_2.png) [@xmontero](https://community.nocodb.com/u/xmontero)\
**Post date:** [October 28, 2023, 10:51am UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916/9 "2023-10-28T10:51:55Z")

</div>

Thanks! I edited my post and set more images to clarify. Unfortunately the forum does not allow me to post more than 1 image per post and I had to place more replies that went after your reply.

Looking forward!

---

<div class="post-metadata">

**Author:** ![pranavxc](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@pranavxc](https://community.nocodb.com/u/pranavxc)\
**Post date:** [October 30, 2023, 7:37am UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916/10 "2023-10-30T07:37:02Z")

</div>

Reproducible with following docker-compose

```yaml
version: "2.1"
services:
  nocodb:
    depends_on:
      mysql-prod-5.7:
        condition: service_healthy
    environment:
      NC_DB: "mysql2://mysql-prod-5.7:3306?u=noco&p=password&d=root_db"
    image: "nocodb/nocodb:0.202.5"
    ports:
      - "8080:8080"
    restart: always
    volumes:
      - "nc_data:/usr/app/data"
  mysql-prod-5.7:
    environment:
      MYSQL_DATABASE: root_db
      MYSQL_PASSWORD: password
      MYSQL_ROOT_PASSWORD: password
      MYSQL_USER: noco
    healthcheck:
      retries: 10
      test:
        - CMD
        - mysqladmin
        - ping
        - "-h"
        - localhost
      timeout: 20s
    image: "mysql:8.0.32"
    restart: always
    volumes:
      - "db_data2:/var/lib/mysql"
volumes:
  db_data2: {}
  nc_data: {}

```

---

<div class="post-metadata">

**Author:** ![pranavxc](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@pranavxc](https://community.nocodb.com/u/pranavxc)\
**Post date:** [October 30, 2023, 9:00am UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916/11 "2023-10-30T09:00:23Z")

</div>

It seems issue with knex or node-mysql2 client since connection is managed by these packages. I would suggest to remove the dot in container name.

> <https://github.com/docker/compose/issues/869>
>
> Do you plan to add support for dash and dots in container names?

---

<div class="post-metadata">

**Author:** ![xmontero](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.nocodb.com/xmontero/32/381_2.png) [@xmontero](https://community.nocodb.com/u/xmontero)\
**Post date:** [October 30, 2023, 9:29am UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916/12 "2023-10-30T09:29:42Z")

</div>

Thanks for investigating.

I can’t do that. It’s a server where too many running applications connect to. Changing that name could potentially break too many dependencies.

I think docker does not put a restriction on the container name. And no other software has failed because of that “dot” in the name of the container for several years.

Are you active with the coomunity of the libraries you use? Maybe opening an issue or a pull-request to them could facilitate things.

The most I can imagine now is to temporarily set an alias in the `/etc/hosts` of the nocoDB and check if it works. And if so, maybe make nocoDB accept the hack via an env-var or so, so the bootstraping of the container patches the `/etc/hosts`.

Let me know and thanks for the interest in the case!

---

<div class="post-metadata">

**Author:** ![xmontero](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.nocodb.com/xmontero/32/381_2.png) [@xmontero](https://community.nocodb.com/u/xmontero)\
**Post date:** [October 30, 2023, 10:15am UTC](https://community.nocodb.com/t/getaddrinfo-enotfound-when-adding-a-data-source/916/13 "2023-10-30T10:15:47Z")

</div>

If it helps…

In the very same docker engine and connecting to the very same mysql with the “dot” name, I have another container that does connect well, indeed.

IDK if the underlying technology/language is the same than you use in nocoDB, but maybe looking at that open-source, it could serve as potential inspiration about what connection libraries they use.

I’m talking about “budibase” and as you can see in the image, it properly connects to the `mysql-prod-5.7` (with the dot):

 ![imagen](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/e85595bcbfb070e60c73f650e7503a0efe5c75e5.png)
