Central install failing due to domain name issues

I am unable to access an odk installation after following the <a https://docs.getodk.org/central-install-digital-ocean>guide.
I got a freeDNS domain name and waited for more than three days - still no access after setting it up as described.
I tried different combinations of settings, even got a new subdomain name and retried but I still have the same problem.
So looking at the running docker images on my Debian VM with

docker ps -a

It returns:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d5ff1f7389e4 central-nginx "/bin/bash /scripts/…" 11 days ago Up 4 days (healthy) 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp central-nginx-1
1baa90bbbabb central-service "docker-entrypoint.s…" 11 days ago Up 4 days 8383/tcp central-service-1
ed505cf1263e central-enketo "docker-entrypoint.s…" 11 days ago Up 4 days 8005/tcp central-enketo-1
34eafdbc47a1 central-secrets "docker-entrypoint.s…" 11 days ago Exited (0) 11 days ago central-secrets-1
b019b4b00500 ghcr.io/getodk/pyxform-http:v2.0.3 "gunicorn --bind 0.0…" 11 days ago Up 4 days central-pyxform-1
83c180df34ab redis:7.2 "docker-entrypoint.s…" 11 days ago Up 4 days 6379/tcp central-enketo_redis_cache-1
07f59149352d redis:7.2 "docker-entrypoint.s…" 11 days ago Up 4 days 6379/tcp central-enketo_redis_main-1
b02000ac590a central-postgres14 "start-postgres.sh" 11 days ago Up 4 days 5432/tcp central-postgres14-1
d94b5a69bb6d central-postgres "/bin/sh -c upgrade-…" 11 days ago Exited (0) 11 days ago central-postgres-1
376c0576d493 ixdotai/smtp:v0.5.2 "/bin/entrypoint.sh …" 11 days ago Up 4 days 25/tcp central-mail-1
5471b0eaa17d hello-world "/hello" 11 days ago Exited (0) 11 days ago brave_poincare

It seems central-secrets-1 and central-postgres were exited just after installation?
I got no error messages after installation and assumed everything installed fine and was up and running.

Could this be the reason I can't access central? Please help!

The ps command looks fine to me. Here's what I'd expect.

CONTAINER ID   IMAGE                                COMMAND                  CREATED       STATUS                 PORTS                                                                      NAMES
12f1d0733273   central-nginx                        "/bin/bash /scripts/…"   2 weeks ago   Up 2 weeks (healthy)   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   central-nginx-1
104f83988e5e   central-service                      "docker-entrypoint.s…"   2 weeks ago   Up 2 weeks             8383/tcp                                                                   central-service-1
d7bb9a07fa7d   central-enketo                       "docker-entrypoint.s…"   2 weeks ago   Up 2 weeks             8005/tcp                                                                   central-enketo-1
6a0beab7bb0e   redis:7.2                            "docker-entrypoint.s…"   2 weeks ago   Up 2 weeks             6379/tcp                                                                   central-enketo_redis_main-1
eb35a1562a13   ghcr.io/getodk/pyxform-http:v2.0.3   "gunicorn --bind 0.0…"   2 weeks ago   Up 2 weeks                                                                                        central-pyxform-1
f3213b34e285   central-postgres14                   "start-postgres.sh"      2 weeks ago   Up 2 weeks             5432/tcp                                                                   central-postgres14-1
a8b1c07120c5   ixdotai/smtp:v0.5.2                  "/bin/entrypoint.sh …"   2 weeks ago   Up 2 weeks             25/tcp                                                                     central-mail-1
fbf5879a1dc0   redis:7.2                            "docker-entrypoint.s…"   2 weeks ago   Up 2 weeks             6379/tcp                                                                   central-enketo_redis_cache-1

Start by doing a DNS check to see if the domain name is pointing to your IP. https://dnschecker.org is a good place to do that check.

Thanks for the pointer - Yes, they all point to the IP given for my droplet. What to check next?

On the VM run:

  1. curl ifconfig.io. Does it return the same IP that is in the DNS record?
  2. hostname -I. Do you see the same IP included in the list?

Yes and yes ! Its there.

That's all good news. So what happens when you go to your domain name? Does anything load?

Nothing loads, still says unable to connect to the website.... :expressionless:

Most certainly some networking or firewall issue on your end. Do the nginx logs show the connection attempt? What about the service logs?

Ok, nginx error.logs keeps repeating:

2024/05/15 18:10:39 [emerg] 800249#800249: bind() to 0.0.0.0:80 failed (98: Address already in use)
2024/05/15 18:10:39 [emerg] 800249#800249: bind() to [::]:80 failed (98: Address already in use)

I have no firewalls up - ufw not even installed.

It says address already in use... which address? Subdomain name?

What could be an issue is that I installed an RStudio and Rshiny servers on the same droplet (not as docker images) while waiting/troubleshooting this issue with ODK. Both working fine. Could this be an issue?

Thanks for your continued assistance.

The docker service logs gives me this (last few lines):

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-05-12T06_47_52_029Z-debug-0.log
wait-for-it: waiting 15 seconds for postgres14:5432
wait-for-it: postgres14:5432 is available after 0 seconds
generating local service configuration..
running migrations..
checking migration success..
starting cron..
cat: /sys/fs/cgroup/memory/memory.limit_in_bytes: No such file or directory
/usr/odk/start-odk.sh: line 34: [: : integer expression expected
using 1 worker(s) based on available memory ()..
starting server.
2024-05-16T18:23:37: PM2 log: Launching in no daemon mode
2024-05-16T18:23:37: PM2 log: App [service:0] starting in -cluster mode-
2024-05-16T18:23:37: PM2 log: App [service:0] online
{"sent":false,"message":"Config not set"}
"Forms purged: 0"
{"sent":false,"message":"Config not set"}
"Forms purged: 0"
{"sent":false,"message":"Config not set"}
"Forms purged: 0"

npm error ?
Can't find the file referred to here - neither does the directory /root/.npm/ exists...

This is the docker nginx logs (last few lines):

118.193.47.212 - - [19/May/2024:09:53:34 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0" "-"
118.193.47.212 - - [19/May/2024:09:53:53 +0000] "GET /favicon.ico HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11" "-"
118.193.47.212 - - [19/May/2024:09:53:54 +0000] "GET /robots.txt HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11" "-"
118.193.47.212 - - [19/May/2024:09:53:55 +0000] "GET /sitemap.xml HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11" "-"
80.66.83.49 - - [19/May/2024:10:29:47 +0000] "\x04\x01\x00PPBS1\x00" 400 157 "-" "-" "-"
80.66.83.49 - - [19/May/2024:10:29:47 +0000] "\x05\x01\x00" 400 157 "-" "-" "-"
80.66.83.49 - - [19/May/2024:10:29:47 +0000] "CONNECT 80.66.83.49:80 HTTP/1.1" 400 157 "-" "-" "-"
34.77.126.178 - - [19/May/2024:10:35:47 +0000] "GET / HTTP/1.1" 301 169 "-" "python-requests/2.31.0" "-"
94.156.67.234 - - [19/May/2024:10:53:47 +0000] "GET /.aws/credentials HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.80 Safari/537.36" "-"
185.191.126.213 - - [19/May/2024:11:08:56 +0000] "GET / HTTP/1.1" 301 169 "-" "-" "-"

This is the problem. One of those servers (or some other service) is listening on port 80 or 443 and Central needs to listen to those ports.

I am not sure if it is the problem, though.

Both these other services listen on other ports (not 80 or 443).
Checking both port 80 and port 443 with lsof -i it shows both ports being used by docker processes. The only docker processes running on my VM that I am aware of is ODK central.

What does netstat -tulpn | grep :80 return? It should return this:

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1660470/docker-prox
tcp6       0      0 :::80                   :::*                    LISTEN      1660475/docker-prox

Try a reboot, then delete the nginx container and rebuild.

docker compose stop;
docker compose rm nginx --volumes;
docker compose build;
docker compose up --detach;

Any chance you have multiple versions of Docker installed? Try whereis docker to check. It should return this:
docker: /usr/bin/docker /etc/docker /usr/libexec/docker /usr/share/man/man1/docker.1.gz