Having Time out error loading forms

We are facing gateway time out error while previewing form.


This is the env


In odk collect app too the form is not coming up , we suspect there is some issue with enketo.

This runs latest odk central 2023 v2.

Form XML

<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:orx="http://openrosa.org/xforms" xmlns:odk="http://www.opendatakit.org/xforms">


        <h:title>GPS location</h:title>



                <data id="GPS-location" version="1666073709">










                <translation lang="English">

                    <text id="/data/location_default:label">



                    <text id="/data/locationshowmap:label">



                    <text id="/data/video:label">





            <bind nodeset="/data/meta/instanceID" type="string" readonly="true()" jr:preload="uid"/>

            <bind nodeset="/data/location_default" type="geopoint" required="true()"/>

            <bind nodeset="/data/locationshowmap" type="geopoint" required="true()"/>

            <bind nodeset="/data/video" type="binary" required="true()"/>




        <input ref="/data/location_default">

            <label ref="jr:itext('/data/location_default:label')"/>


        <input ref="/data/locationshowmap" appearance="maps">

            <label ref="jr:itext('/data/locationshowmap:label')"/>


        <upload ref="/data/video" mediatype="video/*">

            <label ref="jr:itext('/data/video:label')"/>




We have looked at the docker logs. And the POST request times out with the following error message. Looks like this is something to do with routing the POSt request?

*2071 upstream timed out (110: Connection timed out) while reading response header from upstream, client:, server: odk.staging.eastafricacoffee.org, request: "POST /-/transform/xform/JfzpocQZvwXhVw25H6Q6QzNjkxwyhl4 HTTP/1.1", upstream: "", host: "odk.staging.eastafricacoffee.org", referrer: "https://odk.staging.eastafricacoffee.org/-/preview/JfzpocQZvwXhVw25H6Q6QzNjkxwyhl4"

As noted in .env.template...

  • The domain should be odk.staging.eastafricacoffee.org not https://odk.staging.eastafricacoffee.org/#/.
  • If you are using a self-signed cert, DOMAIN should be local.

Try fix that and rebuilding with docker compose build && docker compose up -d.

Thanks for the advise.
Now I get a 404
Does enketo have logs we can look it?
This problem happened after we upgraded to the latest with postgres 14 - - [28/May/2023:01:53:14 +0000] "POST /-/transform/xform/wV6p8TpSdyMAdQllxM7ZJVpvRJ7R80G HTTP/1.1" 404 343 "https://odk.staging.eastafricacoffee.org/-/preview/wV6p8TpSdyMAdQllxM7ZJVpvRJ7R80G"

I think form previews are keyed to the domain and you just changed yours. Try downloading the form definition, increasing the form version, re-uploading the form for publication.

We have tried building with the DOMAIN=local and selfsign
And we uploaded a fresh form to test.
Again the form failed to show. (screenshot attached)

Are there detailed logs that we can see?
Looks like some routing issues.
The issue started after we upgraded to the latest version with infrastructure upgrade to Postgres 14.


We managed to fix this error. It was something about not providing the appropriate ports.

In the new version there is a variable called $BASE_URL added and that was causing an error after upgrade.

We changed the config.json.template by changing
"env": {
"domain": "https://${DOMAIN}",
"sysadminAccount": "${SYSADMIN_EMAIL}"

Thanks for all the support.

1 Like