I have been investigating the issue reported by @neusrosell and finally have been able to fix them by two methods:
Either modifying the DNS records so even from inside the host machine, the resolved domain name is a public IP address and not the internal private address (and rebooting the machine)
Or either adding to files/enketo/config.json.template and service/config.json.template the section:
"ip filtering": {
"allowPrivateIPAddress": true,
"allowMetaIPAddress": false,
"allowIPAddressList": [],
"denyIPAddressList": []
},
The fixing consist on setting the value ture for "allowPrivateIPAddress"
After that, it is necessary to rebuild the containers for the change to take effect.
In the rebuild process, you can lose access to your database. Make a Backup first and follow this fix:
https://docs.getodk.org/central-troubleshooting/#database-reset-after-running-docker-command
docker
Actually, the root cause of the problem occurs inside ODK Central "sevice" and "enketo" docker containers:
When Enketo tries to fetch the CSV file, an error occurs and a result code of "500 Internal Server Error" is returned, but the request returns a body that is not a CSV but an HTML text describing the error:
<!DOCTYPE html><html lang="en-us" dir="ltr"><head><title>Enketo</title><meta charset="utf-8"><meta name="author" content="Martijn van de Rijdt (Enketo LLC)"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="shortcut icon" href="/-/images/favicon.ico"><link rel="icon" type="image/png" sizes="180x180" href="/-/images/icon_180x180.png"><link rel="apple-touch-icon" sizes="180x180" href="/-/images/icon_180x180.png"><link rel="stylesheet" href="/-/css/error.css"></head><body><h1 class="error">DNS lookup 10.20.30.50(family:4, host:odk.palestinercs.org) is not allowed. Because, It is private IP address.<span class="status-code">Error Code: 500</span></h1></body></html>
For clarity and without HTML code it says:
"DNS lookup 10.20.30.50(family:4, host:odk.palestinercs.org) is not allowed. Because, It is private IP address.Código de error: 500”
Javascript code of Enketo page running in the web browser does not detect the 500 HTML result code and continues to try to process the retuned body of the CSV-file request normally, so it interprets the HTML text as a CSV file and thinks that the name of the first column is up to the fist comma. I.E.:
<!DOCTYPE html><html lang="en-us" dir="ltr"><head><title>Enketo</title><meta charset="utf-8"><meta name="author" content="Martijn van de Rijdt (Enketo LLC)"><meta name="viewport" content="width=device-width
This text contains spaces and is thus an invalid CSV column name for Enketo and that is the reason of the appearing error.
An additional problem is that when this "column header" text is inserted in the error message:
CSV column heading "${header}" cannot be turned into a valid XML element
the contents of ${header} are not afterward properly HTML-escaped to be rendered on the web page showing the error, producing a resulting web page HTML code that is invalid and is cut in the middle of the message, although you can see the complete "CSV column" name if you go to the HLML source of the error page:
Enketo error in HTML.zip (54.8 KB)