Can't export data (Not found)

Hi Everyone,

Recently some of our users of KoBo started to run into issues with the exports of their surveys’ data. The download links basically give the a ‘Not Found’ error with the description of ‘The requested URL /private-media/(username)/exports/(name-with-timestamp).xls was not found on this server.’ for them sometimes (and sometimes they randomly work again).

The only thing I could figure out is if I went into the ‘kobocat’ docker image I could find the requested .xls file - at least I think I did - but it had a different timestamp at the end of its name if that matters (it could also be becase of the difference between raising a bug report to us and the user starting to get the error).

Other than this, lately the ‘kobocat site’ started to give 504 as a response also, which happens pretty randomly too, maybe it could be related? Mostly restarting KoBo solves the problem, but it’s only as good as a workaround temporarily.

The installation is mostly standard as far as I know, not much has been changed. I guess the docker image’s name contains the version: kobotoolbox/kobocat:2.019.16a.

Would appretiate any help, since I’m clueless on how could we even backtrack these kind of errors.

Thank you,
Gregory

2 Likes

I am not sure of the reason for these 404 Not Found errors occurring, but in a different thread (about media not normal exports) it was due to an ngix misconfiguration - not sure if that relates here? Cannot access media

2 Likes

This probably doesn’t help, but just for reference: a 404 will also be returned if access is denied (so as not to leak information about the existence of a resource). Do you find that users also get logged out randomly sometimes? That’s not a known issue, but I’m just speculating.

1 Like

Hi jnm,

I don’t know about that, so based on that I didn’t hear about any occasion of them getting logged out, I’d say it didn’t happen. Since I created this post, I tried to reproduce it and was able to, but I still have no clue why it happens.

So the first XLS export of my dummy data was created successfully, then I tried it with a CSV export but then it started to fail. Later that day it worked again for 1-2 exports randomly but then it stopped working again. The site tells me my exports are being created successfully but most downloads gave me the 404 for the file and I could only find those 2 XLS files in the kobocat (if I remember correctly) docker under my username’s folder.

The weirdest thing is that since early last week it seems to be working well again for most people. So I’m just wondering if higher traffic could’ve caused such things or at least play a part in that.

Thank you for the help!

1 Like

@nolive, do we actually persist KPI exports on the host when S3 storage is not used? I’m seeing XLS in /srv/src/kpi/media/[username]/exports/ inside the KPI container, but /srv/src/kpi/media is not one of the binds reported by docker inspect:

kobo@localhost:~/kobo-install$ docker inspect kobo-docker_kpi_1 | grep ':/srv/src'
                "/home/kobo/kobo-docker/uwsgi/kpi_uwsgi.ini:/srv/src/kpi/uwsgi.ini:rw",
                "/home/kobo/kobo-docker/.vols/kobocat_media_uploads:/srv/src/kobocat/media:rw",
1 Like

/home/kobo/kobo-docker/.vols/kobocat_media_uploads:/srv/src/kobocat/media:rw

This line seems to be a mistake. It should be /srv/src/kpi/media within KPI container.

1 Like

I think it was kobocat intentionally, for the KPI gallery feature that wasn’t ever finished:

I’ve opened an issue to add a new mapping for /srv/src/kpi/media:

1 Like