# Docker app not able to connect to db

**URL:** <https://forum.metasfresh.org/t/docker-app-not-able-to-connect-to-db/253>\
**Category:** Setup\
**Created:** [February 23, 2017, 9:42am UTC](https://forum.metasfresh.org/t/docker-app-not-able-to-connect-to-db/253 "2017-02-23T09:42:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![leandrof](https://forum.metasfresh.org/letter_avatar_proxy/v4/letter/l/e495f1/32.png) [@leandrof](https://forum.metasfresh.org/u/leandrof)\
**Post date:** [February 23, 2017, 9:42am UTC](https://forum.metasfresh.org/t/docker-app-not-able-to-connect-to-db/253/1 "2017-02-23T09:42:39Z")

</div>

Hi.  
I downloaded in Kinematic the four Metasfresh dockers. I am able to connect to the database using, for example, ODBC but the docker app (metasfresh-app) keeps saying “db: forward host lookup failed: No address associated with name”.  
Please help.

---

<div class="post-metadata">

**Author:** ![metasnw](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/metasnw/32/23_2.png) [@metasnw](https://forum.metasfresh.org/u/metasnw)\
**Post date:** [February 23, 2017, 3:52pm UTC](https://forum.metasfresh.org/t/docker-app-not-able-to-connect-to-db/253/2 "2017-02-23T15:52:06Z")

</div>

hi Leandro,

thanks for your post.

I am sorry but I do not have experience with Kinematic but I do know for sure that it works on docker compose.  
Do you have the chance to install it on docker compose ?

My stack is:  
ubuntu 16.04 LTS  
docker & docker compose just like described here:  
[http://docs.metasfresh.org/howto\_collection/EN/How\_do\_I\_setup\_the\_metasfresh\_stack\_using\_Docker.html](http://docs.metasfresh.org/howto_collection/EN/How_do_I_setup_the_metasfresh_stack_using_Docker.html)

cheers,  
Norbert

---

<div class="post-metadata">

**Author:** ![leandrof](https://forum.metasfresh.org/letter_avatar_proxy/v4/letter/l/e495f1/32.png) [@leandrof](https://forum.metasfresh.org/u/leandrof)\
**Post date:** [February 24, 2017, 10:31am UTC](https://forum.metasfresh.org/t/docker-app-not-able-to-connect-to-db/253/3 "2017-02-24T10:31:32Z")

</div>

Thanks.  
I left Kitematic and tried the way described in your link.  
I made everything and at the very end I obtained the message “Successfully built” but when I try [http://172.17.0.1:80](http://172.17.0.1:80) in Firefox I receive a “page not found” message.  
In config.js I set 172.17.0.1 as MYDOCKERHOST and 80 as PORT. 172.17.0.1 is the IP address of my Ubuntu VM in the “docker0” network interface.

---

<div class="post-metadata">

**Author:** ![metasnw](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/metasnw/32/23_2.png) [@metasnw](https://forum.metasfresh.org/u/metasnw)\
**Post date:** [February 24, 2017, 10:44am UTC](https://forum.metasfresh.org/t/docker-app-not-able-to-connect-to-db/253/4 "2017-02-24T10:44:59Z")

</div>

hi Leandro,

Might port 80 used by another application on your server?

regards,  
Norbert

---

<div class="post-metadata">

**Author:** ![metasnw](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/metasnw/32/23_2.png) [@metasnw](https://forum.metasfresh.org/u/metasnw)\
**Post date:** [February 24, 2017, 10:46am UTC](https://forum.metasfresh.org/t/docker-app-not-able-to-connect-to-db/253/5 "2017-02-24T10:46:07Z")

</div>

Also I am not sure if it is a good thing to use an IP Address instead of a DNS Name as the apache is setup for reacting to a hostname.

@julian.bischof can you clarify, please?

cheers,  
Norbert

---

<div class="post-metadata">

**Author:** ![julian.bischof](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/julian.bischof/32/36_2.png) [@julian.bischof](https://forum.metasfresh.org/u/julian.bischof)\
**Post date:** [February 24, 2017, 1:52pm UTC](https://forum.metasfresh.org/t/docker-app-not-able-to-connect-to-db/253/6 "2017-02-24T13:52:12Z")

</div>

Hi

No, it shouldn’t be an issue if you’re using an IP in the config.js since the proxy config does not filter for a specific hostname.  
Sound to me, like the containers didn’t start properly or a connection issue from the VM to the client (due to firewall settings maybe).

@leandrof  
You can check if the containers are running properly by running `sudo docker ps`.  
In the list, all necessary containers should be listed as well as their startup time. If one or more of the four containers is not having the same startup time as the others, you can identify which container tries to restart/fails.

Also, as Norbert said, if there’s already a service running on port 80 ( check `netstat -tunap` ) you might want to either stop that service or configure your `docker-compose.yml` file to use a different port.  
In this case, change:

```auto
...
  ports:
    - "80:80"
...

```

to

```auto
...
  ports:
    - "8585:80"
...

```

(don’t forget to update your `config.js` from port “80” to “8585”, restarting the containers with `docker-compose up -d` and using that port in the browser address bar “[http://myserver:8585](http://myserver:8585)”)

Greetings,  
Julian

---

<div class="post-metadata">

**Author:** ![leandrof](https://forum.metasfresh.org/letter_avatar_proxy/v4/letter/l/e495f1/32.png) [@leandrof](https://forum.metasfresh.org/u/leandrof)\
**Post date:** [February 25, 2017, 1:14am UTC](https://forum.metasfresh.org/t/docker-app-not-able-to-connect-to-db/253/7 "2017-02-25T01:14:51Z")

</div>

I used “sudo docker ps” and I saw no metasfresh containers running. I type “docker-compose up -d” and they started and now I am able to login.  
Sorry for having to ask you so basic info but I am a beginner with docker.  
Thank you very much.

---

<div class="post-metadata">

**Author:** ![julian.bischof](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/julian.bischof/32/36_2.png) [@julian.bischof](https://forum.metasfresh.org/u/julian.bischof)\
**Post date:** [February 27, 2017, 8:00am UTC](https://forum.metasfresh.org/t/docker-app-not-able-to-connect-to-db/253/8 "2017-02-27T08:00:37Z")

</div>

Glad to be of help 🙂

And don’t hesitate to ask, if you have any questions.

Enjoy,  
Julian
