Preview is always not ready with processing, so can't use forms in any way

1. What is the problem? Be very detailed.
I've installed ODK Central v1.1.2 on our server, using the Default Project I've installed the ALL widgets form successfully, for testing ODK-collect can see the form and I can select it, however downloading fails. After "publishing" the form I can't see it anymore in ODK-Collect, nor the Preview option is working, is always saying it's busy processing - Please refresh later and try again.
Same problem after pushing existing forms from ODK Aggregate with ODK Briefcase to ODK Central this seems to work fine, including all submissions (successful).
Form access is Open for all forms I tried for me as App User. I'm administrator.

2. What app or server are you using and on what device and operating system? Include version numbers.
ODK Central v1.1.2
ODK Collect v1.30.1
Ubuntu v18.04.5 TLS

3. What you have you tried to fix the problem?
Tried an empty All Widgets form, can't use it preview (stays grey), Public Access - link (never ready to use), Submission->New option fails(stays grey).

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

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

![Screenshot 2021-04-20 at 16.26.24|690x195]
(upload://6DDrghvvsSKaj2cECMP7cVQkMa3.png)

hey @lubbers,
are you using a public-facing domain with a valid ssl certificate?
and, do you recall running ufw disable when you set up the installation?

2 Likes

Hi Issa,

Thanks a lot!
The UFW was indeed blocking access to ODK-collect. Now forms are shown and working.
Do you know which port ODK-Collect is using?
However, in ODK-Central the problems remains, I can't use the Preview option (greyed out) and Public Access->Link stays on "Not available yet". Perhaps, a DNS server problem here? See link: https://docs.getodk.org/central-troubleshooting/#preview-could-not-connect-with-server

Cheers,

Marcel

Ports 80 and 443 need to be open externally. Trying the DNS fix is another good next step. If you have any network firewall up, try turning it off temporarily to see if that helps.

Dear Yanokwa,

I've now opened UFW tcp for IN and OUT for port 7443, now ODK-Collect works :wink:

However, in ODK-Central the problems remains, I can't use the Preview option (greyed out) and Public Access->Link stays on "Not available yet". Perhaps, a DNS server problem here? See link: https://docs.getodk.org/central-troubleshooting/#preview-could-not-connect-with-server 1
Cheers,

Marcel

Hi Yanokwa,

I believe port 80 is not needed when using HTTPS.
Because, port 443 and 8443 are already in use on our server, I use 7443.
Do "Preview" and Access->Link both depend on DNS server settings?
Cheers,

Marcel

Hi Yanokwa,

I believe the functioning of "Preview" depends on EnketoPreview being enabled?
Saw this piece of coding in GIT, showing the message I got when "disabled"

"EnketoPreview": {

      "action": {
        "preview": {
          "string": "Preview",
          "developer_comment": "This is the text for an action, for example, the text of a button."
        }
      },
      "disabled": {
        "processing": {
          "string": "Preview has not finished processing for this Form. Please refresh later and try again."
        },
        "notOpen": {
          "string": "In this version of ODK Central, preview is only available for Forms in the Open state."
        }
      }
    },

Looking at the processes running on my server I found some enketo_express processes:

UID PID PPID C STIME TTY TIME CMD
root 18996 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19002 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19004 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19010 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19016 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19023 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19025 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19045 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19046 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19052 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19058 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19066 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19072 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19078 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19086 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js
root 19093 10650 0 12:51 ? 00:00:00 node /srv/src/enketo_express/app.js

Any idea on how to fix the Preview button to work in ODK Central will be appreciated!

Regards,

Marcel

Hi @lubbers! What happens if you upload a new form? Does the Preview button become enabled for the new form? I believe that ODK Central will stop trying to generate Enketo links for a form if it is unable to do so after several attempts over about an hour. That means that uploading a new form or a new version of the existing form will be useful in testing whether Central and Enketo are now communicating.

Hi Matthew,

Thanks for highlighting this! Uploading a new form didn't resolve the problem. If this is really the case for the "Preview" option, then I think it is a flaw in the program. As a programmer, I would definitely add an option (button) to restart the process.
Perhaps, the "Preview" option is less valuable if you can do the same on a tablet/phone with ODK Collect. I've also read, that Enketo doesn't support all form options that are available in ODK Collect. By the way, the option to complete a form in the browser doesn't work as well. Suppose this is also Enketo related.
To me it seems that Enketo is not working at all on my server.
Cheers & thanks for you comments,

Marcel

Yes, and the vast majority of the time, this is because of a networking issue due to the way Docker interacts with ufw. If you have not disabled ufw, you must do that before we can continue to assist. It is not sufficient to open a few ports.

Once you do that, try connecting to the enketo container (docker exec -it enketo sh) and see if you can reach your domain (curl https://central.example.com).

If all goes well, you should see this...

<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><title>ODK Central</title><link rel=icon href=/favicon.ico><link href=/css/app.e4a03511.css rel=preload as=style><link href=/js/app.ebefcd8e.js rel=preload as=script><link href=/js/chunk-vendors.08d8acc7.js rel=preload as=script><link href=/css/app.e4a03511.css rel=stylesheet></head><body><noscript><strong>We're sorry but ODK Central doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.08d8acc7.js></script><script src=/js/app.ebefcd8e.js></script></body></html>

This will not work. Central currently requires port 80 and 443. And if that's an issue, you'll have to wait until v1.2 when we add support for upstream SSL so you can setup a reverse proxy.

2 Likes

to explain further:

docker does weird things w iptables to make its internal networking work.
as part of this, public loopback doesn't work by default (eg if i am in the enketo container, the public ip of the docker host is not accessible).
because of this, we recommend you disable ufw entirely. this resolves the issue.
if you want to leave ufw enabled, you'll need to work out how to reconfigure iptables to work correctly with docker internal networking.
but none of us have any experience at all doing this so you'll be on your own.

this is all explained in the documentation.

1 Like

Thanks a lot for your comments. Is already known when version 1.2 will be released?
The Enketo connector with UFW disabled works, and I can reach my domain, so this part is working.

I believe Enketo is only used to "Preview" forms in a browser, if I don't use this option (for now), then besides this option I think ODK Central in combination with ODK-Collect is working fine.

Cheers,

Marcel

It's scheduled for release in a month or two.