# ERROR Failed to get a response

**URL:** <https://forum.communityhealthtoolkit.org/t/error-failed-to-get-a-response/2294>\
**Category:** Technical Support\
**Created:** [November 10, 2022, 6:26pm UTC](https://forum.communityhealthtoolkit.org/t/error-failed-to-get-a-response/2294 "2022-11-10T18:26:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![oyierphil](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/oyierphil/32/946_2.png) [@oyierphil](https://forum.communityhealthtoolkit.org/u/oyierphil)\
**Post date:** [November 10, 2022, 6:26pm UTC](https://forum.communityhealthtoolkit.org/t/error-failed-to-get-a-response/2294/1 "2022-11-10T18:26:22Z")

</div>

@derick  
Trying to replace the app folder and setup an old VM which was working, and getting the old error, “_**ERROR Failed to get a response from [https://medic:\*\*\*\*@41.xxx.xxx.xxx/medic/](https://medic:****@41.xxx.xxx.xxx/medic/). Maybe you entered the wrong URL, wrong port or the instance is not started. Please check and try again.**_”

I have confirmed the containers are up and running, trying to figure out the source of error

---

<div class="post-metadata">

**Author:** ![mrjones](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mrjones/32/681_2.png) [@mrjones](https://forum.communityhealthtoolkit.org/u/mrjones)\
**Post date:** [November 11, 2022, 10:00pm UTC](https://forum.communityhealthtoolkit.org/t/error-failed-to-get-a-response/2294/2 "2022-11-11T22:00:47Z")

</div>

@oyierphil - moving this to it’s own topic so we can more directly answer it and help others find it in the future if they have the same problem.

From a prior post, you shared the IP address already - While I can ping it, both `http` and `https` ports seem to be closed. Has the IP changed maybe?

```auto
➜ ~ ping 41.204.187.172
PING 41.204.187.172 (41.204.187.172) 56(84) bytes of data.
64 bytes from 41.204.187.172: icmp_seq=1 ttl=47 time=381 ms
64 bytes from 41.204.187.172: icmp_seq=2 ttl=47 time=402 ms
^C
--- 41.204.187.172 ping statistics ---
3 packets transmitted, 2 received, 33.3333% packet loss, time 2001ms
rtt min/avg/max/mdev = 380.697/391.479/402.262/10.782 ms
➜ ~ nmap -p 80,443 41.204.187.172
Starting Nmap 7.80 ( https://nmap.org ) at 2022-11-11 13:52 PST
Nmap scan report for 41.204.187.172
Host is up (0.36s latency).

PORT STATE SERVICE
80/tcp closed http
443/tcp closed https

Nmap done: 1 IP address (1 host up) scanned in 1.65 seconds

```

---

<div class="post-metadata">

**Author:** ![oyierphil](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/oyierphil/32/946_2.png) [@oyierphil](https://forum.communityhealthtoolkit.org/u/oyierphil)\
**Post date:** [November 12, 2022, 7:02am UTC](https://forum.communityhealthtoolkit.org/t/error-failed-to-get-a-response/2294/3 "2022-11-12T07:02:11Z")

</div>

@mrjones  
The IP and subdomains didn’t change, preparing this VM for production of our current project, community testing.

I had noted interference between the VMS while doing my test configurations with configurable hierarchy, you would do config in one VM and see the results in another, thus had configured firewall with UFW. I later disabled when cloning over SSH became a long process 😊

Did run some tests and noted the nginx service, couch2pg is not running.  
Further noted the following error: curl: (6) Could not resolve host: https, and finally noted the port 443 not open

 ![CHT Instance Error](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/e/e4fde906d8fe21adfb2b71a83aa3fc48ab5d377e.png)

---

<div class="post-metadata">

**Author:** ![oyierphil](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/oyierphil/32/946_2.png) [@oyierphil](https://forum.communityhealthtoolkit.org/u/oyierphil)\
**Post date:** [November 13, 2022, 8:48am UTC](https://forum.communityhealthtoolkit.org/t/error-failed-to-get-a-response/2294/4 "2022-11-13T08:48:24Z")

</div>

@mrjones  
Getting the same response from another VM, our test VM currently receiving data. Interesting, I see app behavior from another VM, a puzzle to me, need to remove the app files and load the correct ones, stuck

_ERROR Failed to get a response from [https://medic:\*\*\*\*@41.204.187.164/medic](https://medic: **** @41.204.187.164/medic). Maybe you entered the wrong URL, wrong port or the instance is not started? Please check and try again._

The app doesn’t load contact form for registration as was working previously, only allows registration of places, base\_settings and forms intact

_Running nmap 41.204.187.164, gives the error 8080/tcp closed http-proxy_

_ **I have removed all UFW rules and disabled the same, still stuck, since I cant get a response from the VMs, cant do any config work, now stuck until I sort out source of the error, anyone with an idea?** _

---

<div class="post-metadata">

**Author:** ![mrjones](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mrjones/32/681_2.png) [@mrjones](https://forum.communityhealthtoolkit.org/u/mrjones)\
**Post date:** [November 14, 2022, 11:03pm UTC](https://forum.communityhealthtoolkit.org/t/error-failed-to-get-a-response/2294/5 "2022-11-14T23:03:58Z")

</div>

@oyierphil - thanks so much for the call earlier today trying to debug this issue. The error you were seeing `ERROR Failed to get a response` was from when you were running [CHT Conf](https://github.com/medic/cht-conf/).

After you and I were looking around, I was able to find this error in your `nginx` logs located in `/srv/storage/medic-core/nginx/logs/startup.log` in the `medic-os` container:

```auto
==> /srv/storage/medic-core/nginx/logs/startup.log <==
nginx: [emerg] invalid number of arguments in "server_name" directive in /srv/software/medic-core/v2.1.1/x64/etc/nginx/nginx.conf:29
nginx: [emerg] invalid number of arguments in "server_name" directive in /srv/software/medic-core/v2.1.1/x64/etc/nginx/nginx.conf:29
nginx: [emerg] invalid number of arguments in "server_name" directive in /srv/software/medic-core/v2.1.1/x64/etc/nginx/nginx.conf:29
nginx: [emerg] invalid number of arguments in "server_name" directive in /srv/software/medic-core/v2.1.1/x64/etc/nginx/nginx.conf:29

```

Looking at the `nginx` config file `/srv/software/medic-core/v2.1.1/x64/etc/nginx/nginx.conf`, on line 29 it looked like this where `server_name` has no argument:

```auto
    server {
        listen 80;
        server_name ;
        error_log /srv/storage/medic-core/nginx/logs/error.log;
        location / {
            return 301 https://$host$request_uri;
        }
    }

```

It was missing the `_` which is used as a [catch all](https://nginx.org/en/docs/http/server_names.html#miscellaneous_names). The fix was to add it back so it looks like this:

```auto
    server {
        listen 80;
        server_name _;
        error_log /srv/storage/medic-core/nginx/logs/error.log;
        location / {
            return 301 https://$host$request_uri;
        }
    }

```

I then rebooted `nginx` inside the container with `/boot/svc-restart medic-core nginx`.

---

<div class="post-metadata">

**Author:** ![mrjones](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mrjones/32/681_2.png) [@mrjones](https://forum.communityhealthtoolkit.org/u/mrjones)\
**Post date:** [November 15, 2022, 4:54am UTC](https://forum.communityhealthtoolkit.org/t/error-failed-to-get-a-response/2294/6 "2022-11-15T04:54:06Z")

</div>

A post was split to a new topic: [Can’t access top level hierarchy place](https://forum.communityhealthtoolkit.org/t/can-t-access-top-level-hierarchy-place/2298)
