Enketo-Express and ODK 1.4.4 integration. (Forbidden. This server is not linked with Enketo)

2,151 views
Skip to first unread message

El Piqo

unread,
Nov 24, 2014, 5:38:23 AM11/24/14
to enketo...@googlegroups.com
Hi there, 

I'm testing the New Enketo-Express (I just pulled latest version, the one with external auth) with ODK 1.4.4 but I'm having issues connecting the two. (My ODK works with Enketo.org, the online version but I would like to test it on Enketo-express)


ODK 1.4.4 and Enketo-express are installed within the same machine. 

ODK CONFIGURATION:
API: MYAPIHERE


Enketo-express configuration:
    "app name": "Enketo Smart Paper for KoBoCAT",
    "port": "13131",
    "linked form and data server": {
        "name": "KoBoCAT",
       "server url": "192.168.2.140",
        "api key": "MYAPIHERE",
        "authentication": {
            "managed by enketo": true,
            "external login url that sets cookie": "http://example.com/login?return={RETURNURL}"
        }
    },



I tried without the authentication as well, (since at the moment I dont have any solution about it, and I want to make them work first), but I always get the following when I click one the Enketo Webform button in ODK: 
There was an error obtaining the webform. (message:Forbidden. This server is not linked with Enketo)

Other observations:
      Enketo Smart Paper for KoBoCAT is running! Please access Enketo forms from your KoBoCAT installation.

  • Monitoring the app from PM2 shows that memory is increasing as time passes (uptime 20 minutes show a 51.684MB memory) 
  • HTOP shows my only two processors staying at 100% all the time, caused by enketo-express/app.js

Best Regards, 
piqo




El Piqo

unread,
Nov 24, 2014, 5:49:54 AM11/24/14
to enketo...@googlegroups.com
I think the memory thing was caused because the PM2 could not start the app because the app seemed already running. PM2 logs show:
Error: bind EADDRINUSE
    at errnoException (net.js:904:11)
    at net.js:1084:30
    at Object.106:1 (cluster.js:594:5)
    at handleResponse (cluster.js:171:41)
    at respond (cluster.js:192:5)
    at handleMessage (cluster.js:202:5)
    at process.emit (events.js:117:20)
    at handleMessage (child_process.js:322:10)
    at child_process.js:396:7
    at process.handleConversion.net.Native.got (child_process.js:91:7)
---
I still don't know how to stop it though.. (I'm new to Node) (after pm2 stop app.js, still shows the same result when I access http://192.168.2.140:13131/ ) 
Neither npm stop seems to do anything. 

Regards, 

El Piqo

unread,
Nov 24, 2014, 7:38:32 AM11/24/14
to enketo...@googlegroups.com
I also retract that thing about not being able to stop it. I had created an instance of it in another terminal that was running... Now I got it how to start/stop the app. Thought, the issue still remains the same. 

Regards, 

martijn

unread,
Nov 24, 2014, 11:10:25 AM11/24/14
to enketo...@googlegroups.com
Hi Piqo,

Thanks for trying this out. If Aggregate is available on http://192.168.2.140, I suspect the issue may be with Aggregate not sending the correct server_url parameter when it communicates with Enketo's API.

Some suggestions to troubleshoot this:
- change enketo-express configuration of "server url" to an empty string (so all server_urls will become acceptable) and restart enketo express
- make a manual API call e.g. with curl --user MYAPIHERE: -d "server_url=http://192.168.2.140&form_id=test1" http://192.168.2.140:13131/api/v2
- stop enketo-express and start manually with `grunt develop`. Look at what is logged in the terminal when you click the Enketo button in Aggregate

Please let us know what you find out!

Best regards,
Martijn

Cal Collins

unread,
Nov 24, 2014, 1:13:00 PM11/24/14
to enketo...@googlegroups.com
Hi Martijn,

I recently had a similar problem with the latest build from https://github.com/kobotoolbox/enketo-express, running together with ODK Aggregate. 

The error I got when making the API call with curl was "Cannot read property xform of undefined". 
Additionally, when running with grunt develop, the terminal said "Unknown Error occurred during attempt to update cache"

I did not change the "authentication" parameters in config.json. 

Not sure if this is the same problem as Piqo but it sounds like it could be. I'm going to reinstall everything from scratch to make sure it wasn't something I did wrong and will let you know the result.

Best,
Cal

Martijn van de Rijdt

unread,
Nov 24, 2014, 3:02:33 PM11/24/14
to enketo...@googlegroups.com
Thanks Cal,

I think that the issue you ran into is what happens when trying to load the url that the API (successfully) returned in the browser. This is the message shown when the XForm actually does not exist on the Aggregate server. That message is too cryptic though. Note that the Enketo API won't actually check whether the XForm exists (by design).

It looks as if Piqo's issue is that the API returns a 403: Forbidden response.

Cheers,
Martijn


--
You received this message because you are subscribed to the Google Groups "enketo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enketo-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Did you know that Enketo Smart Paper has now become the #1 tool for data collection? Don't fall behind. Use it!

Enketo    |    LinkedIn    |    GitHub    |    Twitter

Martijn van de Rijdt

unread,
Nov 24, 2014, 3:17:48 PM11/24/14
to enketo...@googlegroups.com
Cal, apologies, there is indeed a bug in the latest enketo-express with ODK Aggregate: https://github.com/kobotoolbox/enketo-express/issues/107 that shows that error message also for forms that ARE present. Will fix this quickly. Thanks!

Cal Collins

unread,
Nov 24, 2014, 10:09:27 PM11/24/14
to enketo...@googlegroups.com
Great, thanks Martijn!

El Piqo

unread,
Dec 5, 2014, 9:15:12 AM12/5/14
to enketo...@googlegroups.com
Hi Martin,

When in 'grunt develop' I get the following (after I removed the server url in config.json, I dont get an messagebox error, it's a 200 but nothing is shown):

  api-controller account +10s { openRosaServer: 'http://myaggregade.domain.com:8083/ODKAggregate',
  key: 'zu13jclsuj8gds4i' }
  survey-model getting id for : or:myaggregade.domain.com:8083/odkaggregate,my_form_name +2ms
  survey-model result +1ms null YYYp
  api-controller id: YYYp +0ms
  survey-model getting id for : or:myaggregade.domain.com:8083/odkaggregate,my_form_name +1ms
  survey-model result +0ms null YYYp

When I post from curl I get:


curl --user MYAPI: -d "server_url=http://192.168.2.140&form_id=ALB_Suedez_PUNA_ne_terren" http//192.168.2.140:13131/api/v2/
{
    "code": 405,
    "message": "Not allowed"


curl --user MYAPI: -d "server_url=http://192.168.2.140&form_id=my_form_name" http://192.168.2.140:13131/api/v2/survey
{
    "code": 201
}

When I open http://192.168.2.140:13131/::YYY8 kobotoolbox shows up but Request to http://192.168.2.140/formList failed.

Any idea?

Thanks
piqo

martijn

unread,
Dec 5, 2014, 10:47:03 AM12/5/14
to enketo...@googlegroups.com
Hi Piqo,

Your first curl snippet is not a valid API *endpoint*, hence the 405 response. See valid API v1 endpoints here: http://apidocs.enketo.org/ (API v2 is not documented yet, but backwards-compatible with v1).

Where is your Aggregate Server? On  http://192.168.2.140 or on  http://192.168.2.140:8083? Both are very different. This is the server_url you should use in your API requests as this is where Enketo will retrieve your forms and submit data to. To test whether your server_url is actually reachable by Enketo (it isn't currently), just add /formList to the server_url and try to access this in your browser.

For further assistance, please cut and paste this relevant section from your enketo-express installation: https://github.com/enketo/enketo-express/blob/master/config/config.json#L4-L11. That will make it easier to help. Make sure to restart the app after making any changes to config.json.

Cheers,
Martijn

-- 
Revolutionizing data collection since 2012.

Enketo    |    LinkedIn    |    GitHub    |    Twitter    |    Blog

El Piqo

unread,
Dec 9, 2014, 5:16:35 AM12/9/14
to enketo...@googlegroups.com
Hi Martijn, 

ODK is installed in http://192.168.2.140:8083

http://192.168.2.140:8083/formList says The requested resource (/formList) is not available. I searched for troubleshooting it but nothing so far.

I'm now a bit unclear about API url, isnt it http://192.168.2.140:13131/api/v2 

I tried api_v1 when curling the result was the same, but now i guess it is pointless since it is not able get the form properly.


My current configuration

Enketo's Config.js (server url set to blank to accept from all servers, as suggested)

{
    "app name": "Enketo Smart Paper for KoBoCAT",
    "port": "13131",
    "linked form and data server": {
        "name": "Enketo",
       "server url": "",
        "api key": "MY_API_HERE"
    },
    "support": {
        "email": "info at kobotoolbox.org"
    },
    "google": {
        "analytics": {
            "ua": "",
            "domain": ""
        },
        "api key": ""
    },
    "maps": [ {
        "tiles": [ "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" ],
        "attribution": "Map data © <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors"
    } ],
    "widgets": [
        "enketo-widget/note/notewidget",
        "enketo-widget/select-desktop/selectpicker",
        "enketo-widget/select-mobile/selectpicker",
        "enketo-widget/geo/geopicker",
        "enketo-widget/table/tablewidget",
        "enketo-widget/radio/radiopicker",
        "enketo-widget/time/timepicker-extended",
        "enketo-widget/date/datepicker-extended",
        "enketo-widget/datetime/datetimepicker-extended",
        "enketo-widget/mediagrid/mediagridpicker",
        "enketo-widget/select-likert/likertitem",
        "enketo-widget/distress/distresspicker",
        "enketo-widget/file/filepicker",
        "enketo-widget/trigger/triggerwidget"
    ],
    "query parameter to pass to submission": "",
    "redis": {
        "main": {
            "host": "127.0.0.1",
            "port": "6379",
            "password": #####
        },

        "cache": {
            "host": "127.0.0.1",
            "port": "6379",
            "password": #####
        }
    },
    "logo": {
        "source": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRy$
        "href": ""
    }
}



ODK CONFIGURATION:

Enketo API URL

The URL of the Enketo service API

Enketo API token

MY_API


Best Regards,
piqo



On Friday, December 5, 2014 4:47:03 PM UTC+1, martijn wrote:
Hi Piqo,

Your first curl snippet is not a valid API *endpoint*, hence the 405 response. See valid API v1 endpoints here: http://apidocs.enketo.org/ (API v2 is not documented yet, but backwards-compatible with v1).

Where is your Aggregate Server? On  http://192.168.2.140 or on  http://192.168.2.140:8083? Both are very different. This is the server_url you should use in your API requests as this is where Enketo will retrieve your forms and submit data to. To test whether your server_url is actually reachable by Enketo (it isn't currently), just add /formList to the server_url and try to access this in your browser.

For further assistance, please cut and paste this relevant section from your enketo-express installation: https://github.com/enketo/enketo-express/blob/master/config/config.json#L4-L11. That will make it easier to help. Make sure to restart the app after making any changes to config.json.

Cheers,
Martijn

On Friday, December 5, 2014 7:15:12 AM UTC-7, El Piqo wrote:
Hi Martin,

When in 'grunt develop' I get the following (after I removed the server url in config.json, I dont get an messagebox error, it's a 200 but nothing is shown):

  api-controller account +10s { openRosaServer: 'http://myaggregade.domain.com:8083/ODKAggregate',
  key: 'zu13jclsuj8gds4i' }
  survey-model getting id for : or:myaggregade.domain.com:8083/odkaggregate,my_form_name +2ms
  survey-model result +1ms null YYYp
  api-controller id: YYYp +0ms
  survey-model getting id for : or:myaggregade.domain.com:8083/odkaggregate,my_form_name +1ms
  survey-model result +0ms null YYYp

When I post from curl I get:


curl --user MYAPI: -d "server_url=http://192.168.2.140&form_id=my_form_name" http//192.168.2.140:13131/api/v2/

El Piqo

unread,
Dec 9, 2014, 5:28:15 AM12/9/14
to enketo...@googlegroups.com
UPDATE
the url 
shows the my form:
<forms>
<form url="http://my_domain(that points to 192.168.2.140):8083/ODKAggregate/formXml?formId=My_FORM_NAME">MY FORM NAME</form>
</forms>

In browser, http://my_domain(that points to 192.168.2.140):8083/ODKAggregate/formXml?formId=My_FORM_NAME

downloads successfully the form.. 

{
    "code": 405,
    "message": "Not allowed"
}

I get the same when I try the api/v2 URL.

Any idea would be appreciated, 
Thnx

martijn

unread,
Dec 9, 2014, 11:12:36 AM12/9/14
to enketo...@googlegroups.com
Hi Piqo,

All seems good now (if you want to protect your enketo-express installation even better in the future, the "server url" in config.json should be "http://192.168.2.140:8083/ODKAggregate"). In any case all API calls to Enketo should use that value for the server_url parameter.

The only thing to clarify is how the API works. The API url is indeed http://192.168.2.140:13131/api/v1/ (or v2). However, this URL by itself just redirects to apidocs.enketo.org for a GET request and returns a 405 for any other request. When you try to communicate with Enketo (or any other REST API), you have to pick a method (POST or DELETE) and an endpoint based on what you'd like Enketo to do. The main API call (and the only one that is currently built-in to ODK Aggregate) is:  POST /survey (but there are many others).

So your curl snippet should be something like this (and this is what Aggregate when you click the Enketo button):

curl --user MY_API: -d "server_url=http://192.168.2.140:8083/ODKAggregate&form_id=MY_FORM_NAMEhttp://192.168.2.140:13131/api_v1/survey

To illustrate the what the 2 parameters (server_url and form_id) in this API call do:
  1. Enketo will go and visit the formList, by appending "/formList" to the server_url => http://192.168.2.140:8083/ODKAggregate/formList
  2. It will do a search inside this formList to find the form resources belonging to the form_id you provided
  3. It will now be able to load these resources
  4. When submitting a record Enketo will know to submit to 'server_url' + '/submission' => http://192.168.2.140:8083/ODKAggregate/submission
Cheers,
Martijn

P.S. the GET methods are purely for developers who'd like to traverse the API in the browser (without cURL). API calls with this method have no practical use because a GET request should never alter the database, so it can only be used for surveys that were POSTed earlier.

martijn

unread,
Dec 9, 2014, 11:50:15 AM12/9/14
to enketo...@googlegroups.com
/api/v1 and /api_v1 are the same by the way. The first is the preferred path for enketo-express (api_v1 was what enketo-legacy was using and therefore added as an alias to enketo-express). So corrected cURL snippet is:

...

El Piqo

unread,
Dec 15, 2014, 11:19:12 AM12/15/14
to enketo...@googlegroups.com
Hi Martijn, 
the:

returns a:
{
    "code": 200
}

I dont get what ::YYYP is, but does this mean that from enketo-express side everything is working properly? From ODK when I click on Enketo Webform nothing happens. (posting Headers below)
Should I investigate the issue with ODK guys? BTW, has this been tried before? because I get the feeling I'm the first to try to connect these two (ODK 1.4.4 <-> Enketo-Express). Or perhaps just bad luck. :)


HEADERS on POST from ODK 1.4.4:
 -------------------------------
Remote Address:192.168.2.140:8083
Request Method:POST
Status Code:200 OK

Request Headers
Accept:*/*
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.8,sq;q=0.6
Authorization:Digest username="odk_username", realm="ODK 1.4.4 Aggregate", nonce="MTQxODY1ODU3MjczMTplNjBjMmVjOWM5ZmfIwZjNjMjYzMTZkMDZmZTI2NDIyOQ==", uri="/ODKAggregate/enk/enketoApiHandler", response="ce8c169bb06c3dfcbfb466cb4sfbd280d0", qop=auth, nc=000001c7, cnonce="78adddd3b5f592fb"
Cache-Control:no-cache
Connection:keep-alive
Content-Length:123
Content-type:application/x-www-form-urlencoded
....
Pragma:no-cache
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36

Form Data
form_id:MY_FORM_NAME
enketo_api_token:MY_API
Response Headersview source
Content-Length:0
Date:Mon, 15 Dec 2014 15:35:15 GMT
Server:Apache-Coyote/1.1
----------------------------

Thnx for the help, 
Piqo
  key: 'zu13jclsujf8gds4i' }
  survey-model getting id for : or:myaggregade.domain.com:8083/odkaggregate,my_form_name +2ms
  survey-model result +1ms null YYYp
  api-controller id: YYYp +0ms
  survey-model getting id for : or:myaggregade.domain.com:8083/odkaggregate,my_form_name +1ms
  survey-model result +0ms null YYYp

When I post from curl I get:


curl --user MYAPI: -d "server_url=http://192.168.2.140&form_id=my_form_name" http//192.168.2.140:13131/api/v2/
{
    "code": 405,
    "message": "Not allowed"


curl --user MYAPI: -d "server_url=http://192.168.2.140&form_id=my_form_name" http://192.168.2.140:13131/api/v2/survey
{
    "code": 201
}

When I open http://192.168.2.140:13131/::YYY8 kobotoolbox shows up but Request to http://192.168.2.140/formList failed.

Any idea?

Thanks
piqo





On Monday, November 24, 2014 5:10:25 PM UTC+1, martijn wrote:
Hi Piqo,

Thanks for trying this out. If Aggregate is available on http://192.168.2.140, I suspect the issue may be with Aggregate not sending the correct server_url parameter when it communicates with Enketo's API.

Some suggestions to troubleshoot this:
- change enketo-express configuration of "server url" to an empty string (so all server_urls will become acceptable) and restart enketo express
- make a manual API call e.g. with curl --user MYAPIHERE: -d "server_url=http://192.168.2.140&form_id=test1"
...

martijn

unread,
Dec 15, 2014, 1:12:58 PM12/15/14
to enketo...@googlegroups.com, opendatakit...@googlegroups.com
Hi Piqo,

Enketo-Express:

The API response and your Enketo express installation seems fine. If it doesn't load the form (on url http://192.168.2.140:13131/::YYYp in the browser), that will be because the form with ID "MY_FORM_NAME" cannot be reached or maybe it doesn't exist on http://my_aggregate_subdomain.al:8083/ODKAggregate/formList, or is protected. In all those cases, you should see a helpful error message telling you what's wrong when loading the URL in your browser. 

ODK Aggregate:

You are definitely an Enketo-Express/Aggregate pioneer (thanks for that). Make sure you are using the latest version of Enketo-Express and that both ODK Aggregate and Enketo-express can communicate with each other (in your case, are on the same local network). I made sure the API of the old Enketo App and new Enketo App functions in the same way and return the same responses, so the apps could in theory be swapped without pain.... However, it seems you've run into an issue caused by some subtle difference in the responses/communication between the different Enketo apps and Aggregate. I don't yet know what's going on so I'm posting this here to see if anybody can help. I'm cross-posting this to the ODK-Dev forum. 

An API call to the old Enketo-legacy shows the following Aggegrate (v 1.4.3) log with the correct 200 response and a 46 Byte size from which the Enketo URL can be extracted:

in the terminal with cURL this response is received:

< HTTP/1.1 200 OK
< Date: Mon, 15 Dec 2014 17:56:04 GMT
* Server Apache/2.2.22 (Ubuntu) is not blacklisted
< Server: Apache/2.2.22 (Ubuntu)
< X-Powered-By: PHP/5.3.10-1ubuntu3.15
< Set-Cookie: __enketo_a=[removed this]
< Content-Length: 67
< Content-Type: application/json
<
{
  "url": "https:\/\/ocxat.enketo.org\/webform",
  "code": "200"
* Connection #0 to host enketo.org left intact
}


The same API call to an enketo-express server shows the following log, also with a 200 response but with a 0 B response and therefore without an enketo url to redirect to.
 


in the terminal with cURL the same API call shows this response (this response does have a body):

< HTTP/1.1 200 OK
* Server nginx/1.4.6 (Ubuntu) is not blacklisted
< Server: nginx/1.4.6 (Ubuntu)
< Date: Mon, 15 Dec 2014 17:54:42 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 54
< Connection: keep-alive
< X-Powered-By: Express
< Vary: Accept-Encoding
<
{
    "url": "http://enk.to/::YYYH",
    "code": 200
* Connection #0 to host enk.to left intact
}

Any ideas, anybody? 

Cheers,
Martijn

...

El Piqo

unread,
Dec 16, 2014, 9:41:09 AM12/16/14
to enketo...@googlegroups.com, opendatakit...@googlegroups.com
Voila. Good news regarding Enketo-express side. I did also pull today from github (didn't see too many differences from my previous pull so I'm not sure if this is the reason why it worked). When I sent an API call to enketo-express today, the link I received showed the form successfully (The print button though didn't work). I filled the form and the data was submitted to ODK 1.4.4 successfully. Thnx.

From ODK side the the issue is still present. 


On Monday, December 15, 2014 7:12:58 PM UTC+1, martijn wrote:
Hi Piqo,

...

El Piqo

unread,
Dec 16, 2014, 11:03:04 AM12/16/14
to enketo...@googlegroups.com, opendatakit...@googlegroups.com
I checked Catalina logs from ODK and they showed the same logs for Enketo.org (which works) and my enketo-express which didn't work. 

Trying to understand more, I was looking the java code of EnketoApiHandlerServlet.java and saw something that maybe its related (ODK guys will know best)

Line 107 checks if URL contains 'https'. In my enketo-express installation this is not the case... and the responseURL variable remains NULL.


What do you think?


On Monday, December 15, 2014 7:12:58 PM UTC+1, martijn wrote:
Hi Piqo,

...

Martijn van de Rijdt

unread,
Dec 16, 2014, 11:26:23 AM12/16/14
to El Piqo, enketo...@googlegroups.com, opendatakit-developers
Ah, nice one! It looks like this whole code section could be improved a bit. The fact that it currently shows no error message to the user, should also be considered a bug.

The way I would do this is:

1 check the http response code
2 if responseCode >= 200 or responseCode <300, parse the JSON response, check if it contains a "url" property (check validity of url if necessary, but I wouldn't) and redirect to this url
3 for any other responseCodes, parse the JSON response if exists, check if contains a "message" property and output this error to the user. If the response is empty or does not contain a "message" property output a generic error message. 

I don't do Java, so I hope somebody can do this work.... This will mean ODK Aggregate can be used with the brand new 100% free, open-source, easy-to-install Enketo Express app (which is still missing some features, but should become full-featured in a few months).

Cheers,
Martijn

--
You received this message because you are subscribed to the Google Groups "enketo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enketo-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martijn van de Rijdt

unread,
Dec 16, 2014, 2:10:35 PM12/16/14
to Mitch Sundt, opendatakit-developers, El Piqo, enketo...@googlegroups.com
Ah yes, I see where this is coming from now. However, I think we should leave form authentication security to just following the OpenRosa Authentication API, which I don't think is part of this code.

The basic authentication in this particular piece of code seems to deal with Enketo's API communication including API authentication using the API token. If you'd like to ensure API authentication takes place securely to protect Enketo's API token, the API call should never be made to http which I think is currently not the case (and if it gets added, it would be great if it could be bypassed to reduce the hurdle to start playing around with Enketo Express and Aggregate).

Does this make sense?

On Tue, Dec 16, 2014 at 11:44 AM, Mitch Sundt <mitche...@gmail.com> wrote:
The reason for the check for https is that the request is using Basic authentication -- that encodes the username and password in plaintext on the request.

i.e., Basic authentication should never be used outside of an https transport.

The code could be reworked to not supply any authentication if the response URL specifies http.

Does the Enketo-Express require authentication?


You received this message because you are subscribed to the Google Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit-devel...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

martijn

unread,
Jan 11, 2015, 4:31:59 PM1/11/15
to enketo...@googlegroups.com, opendatakit...@googlegroups.com
This is no longer an issue now with ODK Aggregate v1.4.5 (see point #9), thanks to the ODK team!
To unsubscribe from this group and stop receiving emails from it, send an email to enketo-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

-- 
Revolutionizing data collection since 2012.

Enketo    |    LinkedIn    |    GitHub    |    Twitter    |    Blog

--
You received this message because you are subscribed to the Google Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit-developers+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

-- 
Revolutionizing data collection since 2012.

Enketo    |    LinkedIn    |    GitHub    |    Twitter    |    Blog

Anirudha Rath

unread,
Feb 27, 2015, 2:29:58 PM2/27/15
to enketo...@googlegroups.com
Hi Martin,
Hope you are doing well.I am from SDRC India Pvt. Ltd.

I have already installed enketo express in cent os server and running fine with htttp://serverurl:8005 showing the below message.

Enketo Smartpaper is running! Please access Enketo forms from your ODKAggregate installation.

after editing the config.json file when I am setting enketo api url as http://apiserverurl:8005/api/v2 and self modified api token I cannot find any enketo webform link in ODKAggregate. Can you please help me to configure enketo express with ODKAggregate.

Anirudha Rath

unread,
Feb 27, 2015, 2:31:06 PM2/27/15
to enketo...@googlegroups.com
Hi Martin,
Hope you are doing well.I am from SDRC India Pvt. Ltd.

I have already installed enketo express in cent os server and running fine with htttp://serverurl:8005 showing the below message.

Enketo Smartpaper is running! Please access Enketo forms from your ODKAggregate installation.

after editing the config.json file when I am setting enketo api url as http://apiserverurl:8005/api/v2 and self modified api token I cannot find any enketo webform link in ODKAggregate. Can you please help me to configure enketo express with ODKAggregate.


Regards
Anirudh

On Monday, November 24, 2014 at 4:08:23 PM UTC+5:30, El Piqo wrote:

El Piqo

unread,
Feb 27, 2015, 2:53:33 PM2/27/15
to enketo...@googlegroups.com
Hi Anirudha, 

At the config.json set the server url": "your_odk_aggregate_url" (but you can leave it empty "" initially just to make it work first.

At ODK Aggregate, (make sure you have a recent version), go to site admin -> preferences, and enter your Enketo API url, and your api key (the same that is in your config.json)

Hope that helps.

piqo

Anirudha Rath

unread,
Feb 28, 2015, 6:06:04 AM2/28/15
to enketo...@googlegroups.com

Hi Piqo,
After setting enketo url in odk aggergate preference setting I got the enketo webform link but when I click the webform link i could not able to view the webform in proper format. I have attached the screenshot file, please go through this and revert back.
enketo.png
webform.png

El Piqo

unread,
Feb 28, 2015, 7:07:55 AM2/28/15
to enketo...@googlegroups.com
Hi Anirudha, 

Make sure you have run 'grunt' from the project root, so it builds the project.

El Piqo

unread,
Mar 1, 2015, 3:43:08 PM3/1/15
to enketo...@googlegroups.com
ps. make sure you have installed all dependencies.

Anirudha Rath

unread,
Mar 2, 2015, 3:42:12 AM3/2/15
to enketo...@googlegroups.com
Hello Piqo,
hpoe you are doing well.
I have already installed the dependencies.when i am accessing the webform it is showing some java script error. I attached the file. please go through that and revert back.

regards
anirudha
enketo.txt
Grunt history.txt

Anirudha Rath

unread,
Mar 2, 2015, 7:21:54 AM3/2/15
to enketo...@googlegroups.com
If you cannot find any css file named as theme-enketo.css and theme-enketo.print.css. show the webform page showing 500 error i.e; request resource is not available. 
 
if the two file are missing in css folder. then do the following solution to resolve the 500 error.

The problem was the missing theme-enketo.css and theme-enketo.print.css file missing in the css folder.
So I made a copy of these file from files theme-kobo.css and theme-kobo.print.css correspondingly. and rename these two files as theme-enketo.css and theme-enketo.print.css file respectively. and open the odk aggregate port in window firewall inbound setting to fetch the form from ODK Aggregate to enketo express to overcome the webform upload error.

Martijn van de Rijdt

unread,
Mar 2, 2015, 1:16:39 PM3/2/15
to enketo...@googlegroups.com, Anirudha Rath, Narasingha Panigrahi, Satyabrata Kar
Yes, I think so too.

Re css files. There are 3 themes included in Enketo Express: formhub, kobo and grid. There should be no theme-enketo.css and theme-enketo.print.css. I'm guessing you may have set 'default theme' to 'enketo' in config/config.json.

Best regards,
Martijn

On Mon, Mar 2, 2015 at 7:51 AM, Edi Piqoni <piq...@gmail.com> wrote:
It seems you're using an older version of Enketo.  pull the latest version..


On Mon, Mar 2, 2015 at 3:02 PM, Anirudha Rath <anir...@sdrc.co.in> wrote:
Hello Piqoni,
we have integrated enketo express successfully with ODKAggregate,
when I am accessing the web-form with anonymous authentication the web-form is working fine. But when accessing the web-form with user level authentication it is showing authentication error as I have attached the screenshot. Please look into this matter and revert back.
below attached screenshot image for that error. 



Regards
Anirudha Rath
SDRC Pvt. Ltd.
Enabling social change initiatives.


On Mon, Mar 2, 2015 at 3:25 PM, Anirudha Rath <anir...@sdrc.co.in> wrote:
hello Piqoni,
please find another attachment showing request resource not available.

Regards
Anirudha Rath
SDRC Pvt. Ltd.
Enabling social change initiatives.


On Mon, Mar 2, 2015 at 12:32 AM, Anirudha Rath <anir...@sdrc.co.in> wrote:

Hi piqoni,
We have already the grunt in running condition. But the webform is not displayed properly.

On Feb 28, 2015 5:37 PM, "Edi Piqoni" <piq...@gmail.com> wrote:
Hi Anirudha, 

Make sure you have run 'grunt' from the project root, so it builds the project.

piqo



--
You received this message because you are subscribed to a topic in the Google Groups "enketo-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/enketo-users/FbeXdTQs29Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to enketo-users...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Anirudha Rath

unread,
Mar 3, 2015, 3:43:34 AM3/3/15
to enketo...@googlegroups.com
Hi Piqo,
Thanks very much for your kind support.
I have updated successfully to the latest version of enketo express from the link you had sent. now the fetching web form in enketo is working fine for user level authentication.

regards
anirudha

Martijn van de Rijdt

unread,
Mar 3, 2015, 3:25:50 PM3/3/15
to enketo...@googlegroups.com, Anirudha Rath, Edi Piqoni, Satyabrata Kar, Narasingha Panigrahi
Great! :)

I wrote something about theming here: https://github.com/kobotoolbox/enketo-express#themes. In brief, it's probably best to copy an existing theme, e.g. theme-formhub in a new folder (e.g. theme-sdrc). This gives you a great starting point from where you can start customizing (in your own port) without creating merge conflicts when keeping enketo-express up to date. 

If you use the same naming convention in theme-sdrc, it will be enabled automatically after you re-build (grunt) and re-start the application. In your config/config.json you can set 'sdrc' as the default theme.

If you get stuck, please open a new thread in the forum specifically about theming. In this particular case, it's about changing Enketo Express' code (going beyond installation issues) so the enketo-dev forum would be most appropriate. 

Good luck!
Martijn
 

On Tue, Mar 3, 2015 at 12:21 PM, Narasingha Panigrahi <naras...@sdrc.co.in> wrote:
Hello Piqoni, Martijn,

Thank you for all the support in helping us setting up enketo. We updated the enketo from Github and were able to successful with the set up. We will continue our work on it and will let you know in case we come across some thing interesting. 

On a side note, in case we want to do some enhancements on top of the existing themes and designs what would be the starting point. 

Looking forward to an exciting future for the open source version of enketo. 

Regards,
Narasingha.

--
You received this message because you are subscribed to a topic in the Google Groups "enketo-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/enketo-users/FbeXdTQs29Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to enketo-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anirudha Rath

unread,
May 22, 2015, 6:57:26 AM5/22/15
to enketo...@googlegroups.com
Hello team,
I am using enketo express for ODKAggregate to using web form.But I am only connect and configure one ODK instance with enketo express config.json file. But when I am modifying enketo express config.json file for generating multiple api key for different ODK instances,it is showing error when I am starting grunt. So please anyone tell me how can I configure config.json file to generate multiple api keys for multiple ODK instances. The enketo express is working fine for a single ODK instance.

Martijn van de Rijdt

unread,
May 22, 2015, 10:13:28 AM5/22/15
to enketo...@googlegroups.com
Hi Anirudha,

The capability to add multiple API keys is not built in (deliberately, to keep it simple). You'd have to add that functionality or use the same API key for both your Aggregate servers.

Cheers,
Martijn

--
You received this message because you are subscribed to the Google Groups "enketo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enketo-users...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Anirudha Rath

unread,
Jun 9, 2015, 3:27:40 AM6/9/15
to enketo...@googlegroups.com
Hi Martijn,

Hope you are fine.
I did the configuration enketo express with multiple instances of ODK with same APi key. thank you for your advise. I will discuss further if any issue will arise.

regards
Anirudha

David Piedra

unread,
May 4, 2016, 5:46:22 PM5/4/16
to enketo-users
Hi, I'm trying to connect enketo-express to ODK Aggregate, but still cannot edit the forms on the enketo side.
This is what I did:

Installed ODK, it's working ok.
Installed Enketo on a computer, after grunt and npm start looks it's working ok.
  • On the config.json leave the odk server url blank.
On the ODK aggregate configure the enketo api like this:
When I try to edit form from the ODK Aggregate web, I get a small square with a red X in the center.

Using curl:  curl.exe --user enketorules: -d "server_url=http://xxx.xxx.xxx.xxx&form_id=test1" http://xxx.xxx.xxx.xxx:8005/api/v1/

I get: 

{
    "code": 405,
    "message": "Not allowed"
}

Using curl:  curl.exe --user enketorules: -d "server_url=http://xxx.xxx.xxx.xxx&form_id=test1" http://xxx.xxx.xxx.xxx:8005/api/v1/

I get:
{
    "code": 201
}

Copy the link http://xxx.xxx.xxx.xxx:8005/_/#YYY8 to the browser and get a Request to http://xxx.xxx.xxx.xxx/formList failed. 
 guess is because there's no test1 form available.I

What I'm I missing or doing wrong?

Thanks

David

Martijn van de Rijdt

unread,
May 4, 2016, 7:56:40 PM5/4/16
to enketo...@googlegroups.com
Hi David,

When I try to edit form from the ODK Aggregate web, I get a small square with a red X in the center.

I don't understand this. Maybe send a screenshot.

guess is because there's no test1 form available.

Yes, that's correct. Try it with a formID that exists. Does that return URL work? If so the issue is between communicating between Enketo and ODK Aggregate. Check Aggregate logs to see request to /api/v1/survey and what response is received.

Cheers,
Martijn
 

--
You received this message because you are subscribed to the Google Groups "enketo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enketo-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Piedra

unread,
May 5, 2016, 11:53:02 AM5/5/16
to enketo-users
Hello, thanks for your answer.

I'll send a screenshot. It's weird the sreenshot named enketo2.png is how appears to me, I tested in 2 Windows 8.1  computers, different browsers and appears like that, but in the Winodws 10 machines appears like enketo1.png.

The return URL works partially, it opens a webpage but right before it open appears the message . Request to http://xxx.xxx.xxx.xxx/formList failed (enketo3.png), but this URL was generate with a form that doesn't exits. You said that try with a form that exists but don't have one, because the enketo installation is new. 

Now I've checked the ODK Logs, this is what appears when I click the Enketo button.

may 05, 2016 8:41:39 AM org.opendatakit.aggregate.servlet.AggregateHtmlServlet doPost
INFORMACIÃN: Exception caught while calling enketo api :java.net.ConnectException: Expiró el tiempo de conexión
may 05, 2016 8:41:42 AM org.opendatakit.common.security.spring.RoleHierarchyImpl refreshReachableGrantedAuthorities
INFORMACIÃN: Executing: refreshReachableGrantedAuthorities
may 05, 2016 8:41:42 AM org.opendatakit.common.security.spring.UserServiceImpl reloadPermissions
INFORMACIÃN: Executing: reloadPermissions
may 05, 2016 8:41:42 AM org.opendatakit.aggregate.form.FormFactory internalGetForms
INFORMACIÃN: FormCache: fetching new list of Forms

I'm using the api url  http://xxx.xxx.xxx.xxx:8005/api/v1/ and the same api key in both servers.

Hope you can help me with this, we're trying to evaluate if enketo works for our organization.

David
enketo2.PNG
enketo1.png
enketo3.PNG

Martijn van de Rijdt

unread,
May 6, 2016, 10:46:45 AM5/6/16
to enketo...@googlegroups.com
Hi David,

Let's first check if your Enketo server is working properly. What I meant was:

1. Upload a form to Aggregate and note down the formID
2. Then make the API call with that formID (which therefore exists on your Aggregate server)
3. See if the returned enketo webform URL works

Cheers,

David Piedra

unread,
May 17, 2016, 4:12:14 PM5/17/16
to enketo-users
Hi, sorry for the late reply, I was out of office. I upload a form to the Aggregate, then make the api call, here are the results.

C:\Program Files (x86)\cURL\bin>curl.exe --user APIKEY: -d "server_url=http
://XXX.XXX.XXX.XXX&form_id=Form_Prueba" http://XXX.XXX.XXX.XXX:8005/api/v1/
{
    "code": 405,
    "message": "Not allowed"
}
C:\Program Files (x86)\cURL\bin>curl.exe --user APIKEY: -d "server_url=http
://XXX.XXX.XXX.XXX&form_id=Form_Prueba" http://XXX.XXX.XXX.XXX:8005/api/v1/survey
{
    "code": 200
}

Using the survey at the end of the link works otherwise get a "Not Allowed" message.

Thanks

David

Martijn van de Rijdt

unread,
May 17, 2016, 4:55:06 PM5/17/16
to enketo-users
Ok, great. This means Enketo is working well, but something goes wrong when ODK Aggregate makes the API call to Enketo.

It's probably not able to reach the Enketo server from the Aggregate server. I don't know much about troubleshooting Aggregate, so hopefully somebody else can jump in here. However, is Aggregate on a local server as well? Can you reach the Enketo server from the Aggregate server? You can't access a local IP address from a public server of course.... :) (unless you perform some wizardry that I don't recommend). If that's the "issue", just install enketo on a DigitalOcean (since the costs are neglible if you're just testing a few days).

El Piqo

unread,
May 18, 2016, 6:00:44 AM5/18/16
to enketo-users
Hi David, 

Also, make sure you have the form as active ( at ODK form settings, set it to accept downloads/submission). Most likely they're active, but just in case, check them..

David Piedra

unread,
May 18, 2016, 5:49:48 PM5/18/16
to enketo-users
Thanks Piqo, the form is active.

After testing more troubleshooting ideas, found out that was a network problem, after fixing that i get a different error:

"There was an error obtaining the webform. (message:Bad Request. Server URL is not a valid URL.)"

What i see in the post of the webpage is this url: 


Seems good for me, does not know if this still a problem with Aggregate.

David

El Piqo

unread,
May 19, 2016, 3:44:42 AM5/19/16
to enketo-users
To see the Aggregate logs do a (on the Aggregate server):

 tail -f /var/log/tomcat6/catalina.out 

and then make the request from Enketo to see if logs are created with errors from ODK side. 

If nothing appears, investigate from Enketo side.
Re-check config.json, My server url seems like this: "server url": "https://XXX.XXX.XXX.XXX:PORT/ODKAggregate

Also, if you use http for testing (and not https), set "allow insecure transport": true,

piqo

David Piedra

unread,
May 19, 2016, 1:45:59 PM5/19/16
to enketo-users
Thanks for your help, when make a request from enketo in the Aggregate webpage, this appear on the catalina.out file:

may 19, 2016 8:12:32 AM org.opendatakit.aggregate.servlet.AggregateHtmlServlet doPost
INFORMACIÃN: Enketo API response code : 400
may 19, 2016 8:12:32 AM org.opendatakit.aggregate.servlet.AggregateHtmlServlet doPost
INFORMACIÃN: Getting the Error Message from ErrorStream
may 19, 2016 8:12:32 AM org.opendatakit.aggregate.servlet.AggregateHtmlServlet doPost
INFORMACIÃN: BufferReader Object : java.io.BufferedReader@51075df6
may 19, 2016 8:12:32 AM org.opendatakit.aggregate.servlet.AggregateHtmlServlet doPost
INFORMACIÃN: BufferReader Object : Not Null
    "message": "Bad Request. Server URL is not a valid URL."

The allow insecure transport is true and cannot find the enketo logs to check if something happen when I make the call.

David

David Piedra

unread,
May 19, 2016, 3:57:00 PM5/19/16
to enketo-users
Plus, if I put the link I get from the Aggregate in the address bar i get this error:

{
    "code": 400,
    "message": "Bad Request. Server URL missing."
}

The link is: "http://XXX.XXX.XXX.XXX:8005/api/v1/survey&form_id=formulario_inscripcion&enketo_api_token=APIKEY"

David Piedra

unread,
May 20, 2016, 1:32:16 PM5/20/16
to enketo-users
Could it be the Aggregate version, I have 1.4.7, and every webpage I read says the compatibility between Enketo and Aggregate 1.4.1?


El jueves, 19 de mayo de 2016, 1:44:42 (UTC-6), El Piqo escribió:

Martijn van de Rijdt

unread,
May 20, 2016, 2:06:05 PM5/20/16
to enketo...@googlegroups.com
Could be. I have only tested Aggregate 1.4.5 myself. Anybody running Aggregate 1.4.7 with Enketo?

This makes no sense to me:

enketo_api_url=http://XXX.XXX.XXX.XXX:8005/api/v1/survey&form_id=formulario_inscripcion&enketo_api_token=APIKEY

The api token isn't passed like this (in Authorization header instead, the server_url is missing.

David Piedra

unread,
May 24, 2016, 12:49:51 PM5/24/16
to enketo-users
Make a test and installed an aggregate 1.4.5 on a virtual machine and Enketo works like a charm, so pis probably a problem with Aggregate 1.4.7. So propably will downgrade the original aggregate to version 1.4.5.

Thanks for your help.

David

Martijn van de Rijdt

unread,
May 24, 2016, 12:59:01 PM5/24/16
to enketo...@googlegroups.com
Glad to hear that. If anybody is running the latest ODK Aggregate (1.4.9), please let us know if this works for you.

David Piedra

unread,
May 25, 2016, 5:28:52 PM5/25/16
to enketo-users
I updated that test virtual machine to a 1.4.9 and enketo now works fine.

Just in case anyone is having the same problems.

David

Martijn van de Rijdt

unread,
May 26, 2016, 11:04:44 AM5/26/16
to enketo...@googlegroups.com
Great. Thanks for letting us know!
Reply all
Reply to author
Forward
0 new messages