Can you see previews or test forms for any other forms on your server?
As @Grzesiek2010 says, if other forms work, it would be helpful to see this specific form. If it's not sensitive, you can attach it to this post. If it is sensitive, you could direct message it to a member of the core team such as me or @Grzesiek2010. We would only use it to troubleshoot the error and then discard it.
Alternately, sharing the link to the draft page that shows the error message would be helpful. It should start with https://mlw.mw/-/. What I'd like to look at is whether there are any errors in the JavaScript console that could give us hints. You can also try this yourself -- on most browsers you can right click on the screen, select Inspect at the bottom of the menu and then find the Console tab.
Glad it's now working! If anyone else experiences this error, please share either the link to a failing draft page or errors in the JavaScript console. It seems like Enketo was not able to make successful requests to Central.
Thanks for sharing this information, @Chakshu_Gautam. Are you able to view other previews on that server? Does that form have a lot of logic?
The 504 error makes me think that the web form transformer is not able to process the form in a timely manner. You might be able to address this by increasing the CPU and RAM on your server. It's possible that a server restart would temporarily help because it would reset resource usage. However, that is likely not a long term solution.
These are the steps I followed post your suggestion. Increased the virtual cores from 1-4 and RAM from 2-8 GB. Docker restarts auto due to the service that central adds so didn't restart manually. The form that I am using is off the shelf - Survey on Household Characteristics.
On the docker logs, the Nginx logs show that it waits for quite some time before giving a 504.
Would it be possible for you to share the form? You can either attach it to a response here or if it's sensitive, you can send me a private message. Have you tried a small form with minimal logic? The most likely explanation is that there's something in the form structure that the preview engine (Enketo) cannot process in a timely manner. Unfortunately, you may not be able to use web previews with this form for now. Have you tried it on ODK Collect? You can use the testing tab to scan a temporary barcode and make test submissions.
Hey @LN, we've recently setup ODK Central. While ODK forms are working fine on a mobile app, web-forms through Enketo are not working. Attaching the form and sharing a screenshot of the error. Any solution around this?
Thanks for this, @Sandeep_Prabhu1! Did you experience this same issue and fix it by making sure your host doesn't have a firewall? Given how small the forms @Chakshu_Gautam and @Aayush_Kedia have shared are, an internal networking issue does seem a lot more likely than a true form transformation issue. Did you both follow the instructions @Sandeep_Prabhu1 references here? Are you on a host other than Digital Ocean that could have some other kind of internal firewall?
I am using a form on a self-hosted Central Server, which is very large. Online XML conversion of this form fails. However, we have used the "pyxform" offline converter and easily managed to bypass the issue. The form works perfectly on the "ODK Collect" app.
However, when opening on the web with the "Enketo" it is failing with Gateway time out error. and a message like "Unexpected token < in JSON at position 0" (Screenshot attached at the bottom).
Observations:
The form could be opened on the "Enketo" a week back when it was slightly smaller(just 2-3 lines less from the present size)
I am on Digitalocean and have scaled the droplet to "CPU optimised 32vCPUs and 64GB RAM" to check if the timeout stops occurring. It does not. I "htop"ed to see only one core out of 32 really works to open the form in Enketo and timeout occurs exactly at 60 sec
The self-hosted central server works fine while handing other forms which are smaller
I suspect the timeout is due to NGINX 60sec default timeout. Is there a way to change the 60sec timeout setting?
Requesting the community to come up with some solution/workaround.
The XML is too large to attach here. Therefore providing a google docs link for the same:
Hi:
I have the same problem with all the forms with the latest version of ODK Central in OS Ubuntu 22.04 (I tried with the Ubuntu 20.04 too) and docker version 23.0.3. The virtual machine works with the following characteristics: