Unable to test a form on odk central

I have a form that is working on odk aggregate and using the xls file I have uploaded a draft on odk central with associated media files when I preview the definition am getting the following errors Request to https://mlw.mw/v1/test/yV4k79jB3J9x0OkZHa3Ow4BkGgLW1sNYabXC4kqX9bNAq0zWUnt44CuzsIUKdP7h/projects/2/forms/test/draft/formList?formID=simprints_verification_test failed." and "Unexpected token < in JSON at position 0"

Am using odk central version 1.1.1 first time to set up odk central and using postgresql.

1 Like

Is this a form you previously used with ODK Collect? The web preview is provided by Enketo which may not support features that this form uses. I think that's especially likely seeing simprints in the formId. Please try making a draft submission with Collect (more in the docs).

Yes, the form works in ODK Collect when uploaded on Aggregate server. I tried removing some functions like pulldata and the simprints, still getting the same error

Could you attach that form?

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.

Problem was with the odk central server installation, Am now able to preview the form after re-installation.
Thank you @LN and @Grzesiek2010

1 Like

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.

I am facing the same issue and the console for enketo give me the Failed to load resource: the server responded with a status of 504 (Gateway Time-out) on /-/transform/xform/. This is URL for preview - https://central-mp.samagra.io/-/preview/qxYXm716zkFrFSDuEIkFhoyuZVMeHil

I have upgraded the Central from an older version (Dec 2019) to the new one by building the docker image and docker-compose up --no-start

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.

Yes. ODK Collect is still able to submit responses. I am sharing the form here.
g2h1.xml (4.4 KB)

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?

Link for the form - https://odk.adapt-odisha.com/-/preview/87Xeo5jsZLf4s463SMfppci1bDsnGou

Attendance_Marker.xml (3.5 KB)

Hey @LN, any solution around this?

Remove or set firewall
Screenshot_2021-03-19-22-06-38-695_com.android.chrome

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?

Hey @LN, It's on Digital ocean only and we have used default docker installation steps from the site.
Additionally, there are no firewalls whatsoever.

Hey @LN, following up to check if you were able to see this?

@Aayush_Kedia I have tested your form on a new server and install and it's working great there, so the issue is with your server.

  1. Did you deviate from the instructions at https://docs.getodk.org/central-install-digital-ocean?
  2. What Docker version did you deploy?
  3. What size of machine did you use?
  4. What happens when you run ufw status on the command line?
  5. Does a reboot help?
  6. Do the steps at https://docs.getodk.org/central-troubleshooting/#preview-could-not-connect-with-server help?
1 Like

A post was split to a new topic: Form transformation failing due to timeout