NGINX Bad Gateway on ODK Aggregate server in Digital Ocean

1. What is the problem? Be very detailed.
I setup an ODK aggregate server on a Digital Ocean droplet, following the steps detailed in the official documentation. The server was working perfectly for over 2 months, accepting and exporting form submissions. The server was setup on a domain name with https.

However, 2 days back, suddenly, when I tried to go over to the domain, I got a "502 Bad Gateway" by Nginx. The other services on the DO droplet are working fine and are accesible. I SSHd into the server, and tried to "curl localhost:8080", and got "curl: (7) Failed to connect to localhost port 8080: Connection refused".

2. What app or server are you using and on what device and operating system? Include version numbers.
Digital Ocean droplet with:

aggregate-cli -v

ODK Aggregate CLI v1.0.5

uname -r

4.15.0-72-generic
OS: Ubuntu 18.04.3 LTS

There is sufficient memory as well as storage space reported by DO.

3. What you have you tried to fix the problem?
Since curl from within the machine reported connection refused, I thought that the ODK Aggregate server must have stopped running for some reason. While looking for ways to rerun the server, I came across the aggregate-cli utility, which has an install option. However, out of fear that it might replace my existing installation, I have refrained from running it.

4. What steps can we take to reproduce the problem?
Not very sure. I had just followed the official documentation to setup a Digital Ocean droplet, and this happened suddenly.

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
As a priority, I would like to export the submissions to some forms I had floated. Kindly guide me on how to export the form submissions. A CLI based solution which could just help me export all the submissions as JSON would be very helpful. Getting the server up and running again would be nice.

What, if anything changed in the last 2 months. Did you run any updates on the server? Have you tried a reboot to see if that fixes the problem?

Thank you very much for your response.

What, if anything changed in the last 2 months.

I started running 2 different services on the same server. However, these had been running for over a month, and are still running without issues, so I think that is not the case.

Did you run any updates on the server?

No.

Have you tried a reboot to see if that fixes the problem?

Thank you so so much for this. This never occurred to me. I just performed a reboot and now the server is up and running.

As an afterstep, could you help me understand what could have caused this? How do I look for an answer to this?

Your help is greatly appreciated.

1 Like

No idea why it went down, but glad it's working now. If it happens again, then maybe look at the Ngnix or Aggregate logs for hints.

1 Like