Draft preview not working

1. What is the problem? Be very detailed.
I have an ODK Central installation with a custom DB configured. When I create any trivial form draft (using e.g. ODK Build) I can upload it, after couple of seconds the "preview" button is enabled but when clicking it an error message saying something as general as "... operation failed." appears.

The browser console shows the following error:

enketo-webform-bundle.min.js:formatted:54956 App in online-only mode.
enketo-webform-bundle.min.js:formatted:5305 POST https://SERVER_URL:8443/-/transform/xform/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa 403 (Forbidden)
send @ enketo-webform-bundle.min.js:formatted:5305
ajax @ enketo-webform-bundle.min.js:formatted:5062
(anonymous) @ enketo-webform-bundle.min.js:formatted:9640
getFormParts @ enketo-webform-bundle.min.js:formatted:9639
Promise.then (async)
(anonymous) @ enketo-webform-bundle.min.js:formatted:54957
(anonymous) @ enketo-webform-bundle.min.js:formatted:54958

2. What app or server are you using and on what device and operating system? Include version numbers.

Default docker-compose installation with custom database configured.

3. What you have you tried to fix the problem?

Tried watching logs in browser, in nginx docker service, in service docker service, in enketo docker service but no trace except of the PUSH request failing record in the nginx access log.

Is there any way how to enable more detailed logging?

4. What steps can we take to reproduce the problem?

I believe this is a problem in my configuration so reproducing it is not relevant.

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.

Nginx access log:
80.188.15.10 - - [30/Nov/2020:16:30:11 +0000] "GET /-/css/theme-kobo.css HTTP/1.1" 304 0 "https://SERVER_URL:8443/-/preview/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"
80.188.15.10 - - [30/Nov/2020:16:30:11 +0000] "GET /-/css/theme-kobo.print.css HTTP/1.1" 304 0 "https://SERVER_URL:8443/-/preview/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"
80.188.15.10 - - [30/Nov/2020:16:30:21 +0000] "GET /-/preview/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa HTTP/1.1" 304 0 "https://SERVER_URL:8443/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"
80.188.15.10 - - [30/Nov/2020:16:30:21 +0000] "GET /-/fonts/OpenSans-Bold-webfont.woff HTTP/1.1" 304 0 "https://SERVER_URL:8443/-/preview/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"
80.188.15.10 - - [30/Nov/2020:16:30:21 +0000] "GET /-/fonts/OpenSans-Regular-webfont.woff HTTP/1.1" 304 0 "https://SERVER_URL:8443/-/preview/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"
80.188.15.10 - - [30/Nov/2020:16:30:21 +0000] "GET /-/fonts/fontawesome-webfont.woff?v=4.6.2 HTTP/1.1" 304 0 "https://SERVER_URL:8443/-/preview/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"
80.188.15.10 - - [30/Nov/2020:16:30:21 +0000] "GET /-/css/theme-kobo.css HTTP/1.1" 304 0 "https://SERVER_URL:8443/-/preview/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"
80.188.15.10 - - [30/Nov/2020:16:30:21 +0000] "GET /-/js/build/enketo-webform-bundle.min.js HTTP/1.1" 304 0 "https://SERVER_URL:8443/-/preview/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"
80.188.15.10 - - [30/Nov/2020:16:30:21 +0000] "GET /-/css/theme-kobo.print.css HTTP/1.1" 304 0 "https://SERVER_URL:8443/-/preview/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"
80.188.15.10 - - [30/Nov/2020:16:30:22 +0000] "GET /-/locales/build/cs/translation-combined.json HTTP/1.1" 304 0 "https://SERVER_URL:8443/-/preview/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"
80.188.15.10 - - [30/Nov/2020:16:30:22 +0000] "GET /-/locales/build/en/translation-combined.json HTTP/1.1" 304 0 "https://SERVER_URL:8443/-/preview/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"
80.188.15.10 - - [30/Nov/2020:16:30:22 +0000] "GET /-/images/favicon.ico HTTP/1.1" 200 1651 "https://SERVER_URL:8443/-/preview/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"
172.23.0.1 - - [30/Nov/2020:16:30:22 +0000] "HEAD /v1/test/Q3Oj2J7Yc$iJ1G1jH90qnHRM7WUbvOdgRgbH9exzsAMsi4cdni$0mhqr85SfOkxK/projects/2/forms/build_ODK-Build-1_1606683730/draft/formList?formID=build_ODK-Build-1_1606683730 HTTP/1.1" 403 0 "-" "-"
80.188.15.10 - - [30/Nov/2020:16:30:22 +0000] "POST /-/transform/xform/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa HTTP/1.1" 403 261 "https://SERVER_URL:8443/-/preview/aW5VM3fxMrCj1OtWeEkQUXdGyhJYsDa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"

Thanks for any hint

Jan

After further investigation I found the following:

  • The first failing request seems to be some internal request from inside of the server component ending with 403 (Not permitted)

    172.23.0.1 - - [30/Nov/2020:16:30:22 +0000] "HEAD /v1/test/Q3Oj2J7Yc$iJ1G1jH90qnHRM7WUbvOdgRgbH9exzsAMsi4cdni$0mhqr85SfOkxK/projects/2/forms/build_ODK-Build-1_1606683730/draft/formList?formID=build_ODK-Build-1_1606683730 HTTP/1.1" 403 0 "-" "-"

  • The same behavior is for forms uploaded in the XML form as well as for XLSForm

  • When looking into the database, imported forms seem to be OK - they have assigned enketo and oneoff tokens, they have created fields, etc.

Any idea what could be causing the 403 on internal request or at least how to enable more detailed debugging?

Thanks Jan

The issue we've sometimes seen with web forms is that a firewall prevents communication between Central and the Enketo web form server. However, a 403 isn't consistent with that. Can you make a test submission with ODK Collect by scanning the draft testing QR code?

Here is the access log of nginx. The first entry is the ODKCollect check of available forms - OK

80.188.15.10 - - [03/Dec/2020:09:11:39 +0000] "GET /v1/test/igH6excWrVdzoJnU3Icjgxg01BFcyF!!ce5shGLpmJifZqUUFBjQT9HG1LnA3orw/projects/2/forms/build_ODK-Build-1_1606841925/draft/formList HTTP/1.1" 200 494 "-" "org.odk.collect.android/v1.28.4 Dalvik/2.1.0 (Linux; U; Android 10; EML-L29 Build/HUAWEIEML-L29)"

The second entry is sunsequent download of selected form - failed

80.188.15.10 - - [03/Dec/2020:09:11:44 +0000] "GET /v1/test/igH6excWrVdzoJnU3Icjgxg01BFcyF!!ce5shGLpmJifZqUUFBjQT9HG1LnA3orw/projects/2/forms/build_ODK-Build-1_1606841925/draft.xml HTTP/1.1" 404 874 "-" "org.odk.collect.android/v1.28.4 Dalvik/2.1.0 (Linux; U; Android 10; EML-L29 Build/HUAWEIEML-L29)"
1 Like

Any idea how to further investigate the issue, please? Thanks

From your logs, it looks like you are running the server on (or forwarding traffic to) port 8443? Can you tell me more about the changes you’ve made as far as ports?

Hi,

Basically I made 2 major changes:

  1. I modified the nginx config so that the new Central ecosystem can coexist aside current Aggregate - I turned off original nginx and the Central nginx component serves both environments - Aggregate on port 443 and Central on port 8443
  2. I turned Central components to my own PostgreSQL database - modified corresponding config according to the ODK Central documentation and removed internal postgres from docker-compose.yml

Where can I find any specific log files of the Central and/or Enketo components and how to configure their debug level? What I found so far were only nginx access logs.

Thanks Jan

Hi, I have the same issue, I installed on two machines.

1 Like

The nginx config is likely the issue. My hypothesis is that Enketo expects the default ports and the changes in the nginx config don't make their way to Enketo. I believe Collect will also fail in this way. We don't yet support running on non-default ports, so try running on the default ports and see if that helps.

Also note that Central waits for the local Postgres container to come up before starting. I've sent in a docs PR at https://github.com/getodk/docs/pull/1290 so custom DB users can make that change.

As to the commands:

  • docker ps --format '{{.Names}}' will show the names of the containers.
  • docker logs --tail <n> <name> will show the last n lines of the named container's log.
1 Like