# Enketo says Could not connect to server

**URL:** <https://forum.getodk.org/t/enketo-says-could-not-connect-to-server/33706>\
**Category:** Support\
**Tags:** enketo, odk-central\
**Created:** [May 26, 2021, 8:07pm UTC](https://forum.getodk.org/t/enketo-says-could-not-connect-to-server/33706 "2021-05-26T20:07:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hartmut\_Noack](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/hartmut_noack/32/6638_2.png) [@Hartmut\_Noack](https://forum.getodk.org/u/Hartmut_Noack)\
**Post date:** [May 26, 2021, 8:07pm UTC](https://forum.getodk.org/t/enketo-says-could-not-connect-to-server/33706/1 "2021-05-26T20:07:49Z")

</div>

**1. What is the problem? Be very detailed.**

Setup recent Central on Debian server(OVH) Apache servs as reverse Proxy in order to allow Geoserver and our LAMP frontend to run on the same machine, Web frontend works as expected.

root@ns3849011:/home/debian/central# docker-compose ps  
Name Command State Ports

central\_postgres\_1 docker-entrypoint.sh postgres Up 5432/tcp  
enketo docker-entrypoint.sh /bin/ ... Up 8005/tcp  
enketo\_redis\_cache docker-entrypoint.sh redis ... Up 6379/tcp  
enketo\_redis\_main docker-entrypoint.sh redis ... Up 6379/tcp  
mail /bin/entrypoint.sh exim -b ... Up 25/tcp  
nginx /bin/bash /scripts/odk-set ... Up (healthy) 0.0.0.0:4443-\>443/tcp,:::4443-\>443/tcp, 0.0.0.0:4480-\>80/tcp,:::4480-\>80/tcp  
pyxform waitress-serve --port=80 - ... Up  
secrets docker-entrypoint.sh ./gen ... Exit 0  
service docker-entrypoint.sh ./wai ... Up 8383/tcp

Testing or downloading any uploaded form fails with the mentioned "Could not connect" message in the tab for Enketo.

**2. What app or server are you using and on what device and operating system? Include version numbers.**

Central 1.2, Debian 10, Docker version 20.10.6, build 370c289

**3. What you have you tried to fix the problem?**

Restart docker, use different forms(incl. old ones, that did work on Aggregate)

**4. What steps can we take to reproduce the problem?**

Get a generic Debian server, no cloudservice but a dedicated machine, have a LAMP parallel on it, and try run Central with docker and see, if Enketo does work.

**5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.**

nginx log after trying to do stuff with a form:

nginx | 80.187.115.137 - - [26/May/2021:19:54:26 +0000] "GET /v1/test/aeqqVuqex0cHoP70XMcu$w3mqKctnRW8XmxR1fOtp!0fwwvEJi!IhEtt9xeb6sRH/projects/3/forms/acsi\_firstpayment/draft/formList HTTP/1.1" 200 485 "-" "org.odk.collect.android/v1.30.1 Dalvik/2.1.0 (Linux; U; Android 11; SM-A405FN Build/RP1A.200720.012)"  
nginx | 93.227.214.145 - - [26/May/2021:19:55:02 +0000] "GET /v1/projects HTTP/1.1" 200 709 "[https://odk.ourdomain:4443/](https://odk.ourdomain:4443/)" "Mozilla/5.0 (X11; Ubuntu; Linux x86\_64; rv:88.0) Gecko/20100101 Firefox/88.0"  
nginx | 93.227.214.145 - - [26/May/2021:19:55:02 +0000] "GET /v1/users HTTP/1.1" 200 579 "[https://odk.ourdomain:4443/](https://odk.ourdomain:4443/)" "Mozilla/5.0 (X11; Ubuntu; Linux x86\_64; rv:88.0) Gecko/20100101 Firefox/88.0"

---

<div class="post-metadata">

**Author:** ![Hartmut\_Noack](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/hartmut_noack/32/6638_2.png) [@Hartmut\_Noack](https://forum.getodk.org/u/Hartmut_Noack)\
**Post date:** [May 26, 2021, 10:39pm UTC](https://forum.getodk.org/t/enketo-says-could-not-connect-to-server/33706/2 "2021-05-26T22:39:25Z")

</div>

Thanks a lot for the tipps.  
I have set up that nameserver config for docker as you described

But alas, my env is:  
SSL\_TYPE=letsencrypt  
DOMAIN=ourdomain  
[SYSADMIN\_EMAIL=zettberlin@linuxuse.de](mailto:SYSADMIN_EMAIL=zettberlin@linuxuse.de)

Everything works fine https-connections are accepted without any warnings from the browser but Enketo still yields the above message.

---

<div class="post-metadata">

**Author:** ![Hartmut\_Noack](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/hartmut_noack/32/6638_2.png) [@Hartmut\_Noack](https://forum.getodk.org/u/Hartmut_Noack)\
**Post date:** [May 27, 2021, 7:03pm UTC](https://forum.getodk.org/t/enketo-says-could-not-connect-to-server/33706/3 "2021-05-27T19:03:29Z")

</div>

Sorry for the hussle, found the solution in docker docs:

docker exec -it enketo bash

I can get the index.html from our central server with wget via https just fine....

---

<div class="post-metadata">

**Author:** ![Hartmut\_Noack](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/hartmut_noack/32/6638_2.png) [@Hartmut\_Noack](https://forum.getodk.org/u/Hartmut_Noack)\
**Post date:** [June 9, 2021, 7:25am UTC](https://forum.getodk.org/t/enketo-says-could-not-connect-to-server/33706/4 "2021-06-09T07:25:22Z")

</div>

Hello @jary and @yanokwa ,

I got a very similar setup:

Central 1.2 from git  
Debian 10.9 (OVH dedicated server)  
docker 20.10.6  
docker-compose ps shows:

```
central_enketo_1 docker-entrypoint.sh /bin/ ... Up 8005/tcp                                                                    
central_enketo_redis_cache_1 docker-entrypoint.sh redis ... Up 6379/tcp                                                                    
central_enketo_redis_main_1 docker-entrypoint.sh redis ... Up 6379/tcp                                                                    
central_mail_1 /bin/entrypoint.sh exim -b ... Up 25/tcp                                                                      
central_nginx_1 /bin/bash /scripts/odk-set ... Up (healthy) 0.0.0.0:4443->443/tcp,:::4443->443/tcp, 0.0.0.0:4480->80/tcp,:::4480->80/tcp
central_postgres_1 docker-entrypoint.sh postgres Up 5432/tcp                                                                    
central_pyxform_1 gunicorn --bind 0.0.0.0:80 ... Up                                                                                         
central_secrets_1 docker-entrypoint.sh ./gen ... Exit 0                                                                                     
central_service_1 docker-entrypoint.sh ./wai ... Up 8383/tcp    

```

Centrals nginx is delivered by Apache and there are no problems reported regarding ssl.

In short: for me it works OK, I can login to Central(quite fast) create Projects and upload forms

**But alas:** preview of forms gives me:  
Exceeded maxRedirects. Probably stuck in a redirect loop [https://odk.swap-amhara.org/v1/test](https://odk.swap-amhara.org/v1/test)...

The Log shows:

```
enketo_1 | 2021-06-09T10:03:36.870845319Z 10:03:36 0|enketo | (node:58) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 pipe listeners added to [Request]. Use emitter.setMaxListeners() to increase limit

```

I had trouble with Enketo in that setup before, so I reinstalled Central and set all SSL to custom with certs copied from /etc/letsencrypt/live that would be the only main difference to the situation before, when Enketo simply notified me, that the server could not be reached.

How can I find out, what could be wrong with that redirect loop?

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [June 9, 2021, 12:39pm UTC](https://forum.getodk.org/t/enketo-says-could-not-connect-to-server/33706/5 "2021-06-09T12:39:49Z")

</div>

Does it work without the reverse proxy? What does your proxy config file look like?
