Enketo previews not working on new install

1. What is the issue? Please be detailed.
When I try to open a preview I get the getaddrinfo ENOTFOUND error.

I successfully installed odk-central on a Synology NAS with DSM 7.2.1. following this approach: https://forum.getodk.org/t/how-to-install-odk-central-on-synology-nas-with-docker/33251

I used a FQDN and I provided a custom ssl certificate which is valid.

I can login to odk-central and create a new draft, however, as soon as I click the preview button I get the getaddrinfo ENOTFOUND error.

The server is only and should only be accessible inside the local network. I therefor added the hostname to my host file, assuming that it will reroute all traffic accessing the domain to my local server.

Since enketo seems to work with the other services via REST-API and all of these requests are running through the browser, I cannot understand why the main app can load perfectly fine but the fetch-calls response with that error.

2. What steps can we take to reproduce this issue?

The best way would be to use the same setup. If that NAS is not available, I'm assuming any setup that remains inside local network will face the same problems.

3. What have you tried to fix the issue?

I tried:

  • reverse proxy settings, which didn't work
  • different customssl settings
  • different selfsign settings
  • editing enketo config adding localhost as server url like explained here
  • chasing the error through the code hoping for some more information.
  • different test formulars hoping that it is just a layout error on the forms, it's not.

4. Upload any forms or screenshots you can share publicly below.

It looks like backend of enketo-express is unable to resolve the domain name. Can you please ssh into enketo container and make a curl request to the Central?

Here's a one liner that should help. It grabs your domain from .env, runs curl in the Enketo containers, and checks the result for

docker exec -it central-enketo-1 curl https://$(grep "^DOMAIN=" ~/central/.env | cut -d = -f 2) | grep -c getodk.org

If the one-liner returns 1, then everything should be working. If it returns 0, then something's broken in your routing.

One thing you can try is adding the FQDN/IP mapping to your Enketo container using the extra_hosts flag in docker-compose.yml as shown below. The IP should be whatever external IP your host is listening on, but it might also work with an internal IP.

  enketo:
    volumes:
      - secrets:/etc/secrets
    build:
      context: .
      dockerfile: enketo.dockerfile
    restart: always
    depends_on:
      - secrets
      - enketo_redis_main
      - enketo_redis_cache
    environment:
      - DOMAIN=${DOMAIN}
      - SUPPORT_EMAIL=${SYSADMIN_EMAIL}
      - HTTPS_PORT=${HTTPS_PORT:-443}
    extra_hosts:
      - 'YOUR_FQDN:1.2.3.4'

Then rebuild with docker compose build && docker compose stop && docker compose up -d and see if previews work.