504 bad gateway error when creating web user in ODK Central

Environment:

  • Central version: v2023.5.1
  • Client version: v2023.5.0
  • Server version: v2023.5.0

We've been running our self-hosted ODK Central instance on DigitalOcean for several months without any major issues. Most questions we've had were easily addressed through the official documentation or existing forum discussions.

However, today we encountered a new issue when trying to create web users. After clicking the "Create" button in the Web User dialog, the system takes more than a minute to respond, eventually displaying the following error at the top of the dialog:

“Something went wrong: error code 504.”

This suggests a gateway timeout. Searching the forum, I found that similar errors may be related to memory pressure. Given that we've steadily added more forms and users over time, I increased our server's memory allocation from 2GB to 3GB and rebuilt the service, but unfortunately, the issue persists.

I suspect the delay and timeout might be related to sending the invitation email to the new user. We're using Mailjet for outbound email, and it appears to be functioning normally, account creation emails, password resets, and other notifications have been sent successfully during the last 30 days. No recent changes have been made on that front.

Has anyone experienced something similar? Any suggestions on where to look next would be much appreciated.

Thanks in advance.

My guess is that DigitalOcean has added an SMTP restriction on your account.

Hi Yaw, thanks for your response. I suspected the same and opened a ticket with DO to request the removal of this restriction. The confirmed that a blanket ban had been enabled from 6 March, however our droplet continued to send emails until a few days ago.

1 Like

After some investigation, I can confirm that the root cause was a blanket block on outbound SMTP traffic applied by DigitalOcean, which hosts our ODK Central instance. This block prevented the system from sending an email during the web user creation process, resulting in the observed gateway timeout error (504).

I raised a support ticket with DigitalOcean, and after some discussion and motivation for the exception, they lifted the SMTP restriction for our instance. This immediately resolved the issue, user creation now works as expected.

For those self-hosting ODK Central, especially on providers like DigitalOcean, it's worth checking whether outbound SMTP is blocked by default.

Suggestion for ODK Central Team:
It might be helpful to consider decoupling the email-sending process from web user creation. That way, user creation could still proceed even if email delivery fails, and a more informative error message could be displayed (e.g., “Email delivery failed – please check email configuration, firewall settings, etc.”). This would improve the experience for administrators and help isolate issues more quickly.

Hope this helps someone!

2 Likes

We've added a Account creation and password resets are not working section to the troubleshooting as a stop gap. We'll be adding more guidance to the installation documentation as well.

I agree that the error message could be better and I've filed an issue so we can fix that.