Error when calling REST Service

Hi,

I’m getting the following log error when submitting a form with a REST Service:

kobocat_1         | ERROR 2020-01-23 14:15:06,787 tasks 139 140556372989696 service_definition_task     - 404 Client Error: NOT FOUND for url: http://kf.kobo.[hidden domain].internal/api/v2/assets/ahC2qdvnQ3gkSSMAiQgCGx/hook-signal/
    kobocat_1         | Traceback (most recent call last):
    kobocat_1         |   File "/srv/src/kobocat/onadata/apps/restservice/tasks.py", line 26, in service_definition_task
    kobocat_1         |     service.send(rest_service.service_url, data)
    kobocat_1         |   File "/srv/src/kobocat/onadata/apps/restservice/services/kpi_hook.py", line 29, in send
    kobocat_1         |     response.raise_for_status()
    kobocat_1         |   File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 940, in raise_for_status
    kobocat_1         |     raise HTTPError(http_error_msg, response=self)
    kobocat_1         | HTTPError: 404 Client Error: NOT FOUND for url: http://kf.kobo.[hidden domain].internal/api/v2/assets/ahC2qdvnQ3gkSSMAiQgCGx/hook-signal/

The REST endpoint doesn’t get invoked. If someone could provide any tips or clues about what’s going on I’d be very grateful.

Best regards,

Hi,
This looks like an error with your URL on the same. The error 404 could be pointing to a denied connection. Could you check your code properly. Please confirm if this has ever worked before

Stephane

1 Like

Hi @stephanealoo,

Thanks for your response. I’m installing the software components using kobo-install so I haven’t modified any code base at all. I’m going to make a clean, fresh install, try again and update this answer.

Best regards,

2 Likes

I did a clean, fresh install and I’m getting the same 404 error. I’m able to ping the internal kf hostname from within the kobocat container, but apparently the endpoint doesn’t exist.

Hi, can anyone confirm that REST services invokation work when installing KoBoToolbox with kobo-install? I’ve installed it several times using default settings and I’m still getting the error posted above. Thanks in advance.

So I’ve been able to fix the issue with the following changes in the kobocat source code:

1 Like

Hi @rpalma,

Thanks for sharing it with the entire community!

Have a great day!