504 Gateway Timeout

I have just found out that the link to my survey is currently not working (error loading - 504 gateway Timeline). We have already received 95 submissions and have not encountered this problem before.

I receive the following message:

" Error occured during the loading of this form. We do not recommend you use this form for data entry until this is resolved.

Please contact [support@kobotoolbox.org] with the link to this page and the error message below: Failed to load form"

I have contacted the Support desk but they have told me to reach out to the community.

I have tried using different servers. Sometimes it works, sometimes it doesn’t, and sometimes the page does come through but with a very ugly layout.

The deadline to fill out the survey is next Monday so I would appreciate it if somebody can help me solve this issue.

Strangely, the online-offline web link is still working: Enketo Express for KoboToolbox
But the online-online web link (which has been communicated to everyone) is not: Enketo Express for KoboToolbox.

If there is something I can do, could you please let me know. Thank you

1 Like

I though the problem was solved but unfortunately the problem persists. The server does not seem to affect the loading error. I have received loading errors regardless of the server used (mobile phone using 4G, WiFi at work, WiFi at home).

Is there somebody who can help?

Welcome to the community, @navis! Could you also let us know your forms’ total number of questions?

A 504 is a timeout and may be related to a combination of a slow server and a large form/form with many select choices.

However, at the moment, I could load your forms with both the URL you shared. FYR:

@navis, BTW the loading of the Enketo form also relies on the device’s configuration. Devices with higher-end configurations could load the form more quickly than compared with lower-end configurations (when your survey form is too long).

Thanks for your response, @Kal_Lam!

Yes, the problem seems to appear only from time to time. According to the landing page, we have 92 questions (although in reality we only have 16 questions excluding a few skip logic questions that only pop up depending on how people answer the survey). The form is deployed in four languages.

Might the error have something to do with the fact that the survey has been redeployed various times?

In any case, it appears to be working now. I’m hoping the problem won’t reoccur. Is there anything I can do to reduce the likelihood that this problem will reoccur?

1 Like

@navis, we also advise validating the XLSForms through this online validator to see if there are any syntax issues. This also saves a lot of your time troubleshooting!

Thanks for your reply, @Kal_Lam!

Perhaps this is a silly question, but how do I validate the XLSForm? I just submitted my file through the link you sent. I then click on “preview in browser” and then reach what looks like my survey page… everything looks ok (apart from an image not showing).

However, when I press “validate” it says the form contains “errors”, but all errors have to do with the fact that most fields are “required”. Am I expected to fill out the survey completely to check for any syntax errors?

In order to reduce the number of questions or elements in the survey, would it help to delete the following “text boxes” at the end of my survey in the survey builder? They were automatically created when uploading the XLSForms.

If there are syntax issues in your XLSForm, you will not be able to preview the form (and you will also be getting the errors you should be able to track or check). If there are no syntax issues, you should be able to preview without any issues.

Ninety-two questions are not that long. The system should support it without any issues. The timeout may occur if your constraints are too complex, though. So check out the constraint parts too.

Ok, perfect! So there are no Syntax issues then. I am able to preview the form perfectly fine and there seem to be no errors other than certain fields being required.

1 Like

Good luck with your survey! As a cross-check, please try submitting a dummy submission to the server to see if everything is fine. If everything is fine, you could start your survey.

We have 5 questions with constraints. Some of them might be relatively complex, such as:

not(selected(., ‘don_t_know’) and (selected(., ‘sale_of_local_government_owned_land_asse’) or selected(., ‘lease_of_local_government_owned_land_ass’) or selected(., ‘sale_of_development_rights’) or selected(., ‘land_value_taxes’) or selected(., ‘none’) or selected(., ‘other’))) and not(selected(., ‘none’) and (selected(., ‘sale_of_local_government_owned_land_asse’) or selected(., ‘lease_of_local_government_owned_land_ass’) or selected(., ‘sale_of_development_rights’) or selected(., ‘land_value_taxes’) or selected(., ‘don_t_know’) or selected(., ‘other’)))

Yes, that could be the issue.