CSRF token missing

I tried the REST service https://support.kobotoolbox.org/en/articles/592398-rest-services to beeceptor.

During submission, I get the error “CSRF token missing”. This has been reported several times during the last year in the community, but all but one old thread never had an answer.

CSRF token missing is a fairly generic error that can crop up in a lot of places. I’m searching the forum for other examples, but I can only find one right now:

That’s not related to REST Services, unfortunately.

When you say “During submission”, do you mean when you attempt to add the new REST service, or when you attempt to submit data via Enketo or the Collect Android app? Detailed steps to reproduce the problem would be helpful.

“During submission”: I copied the example in the video exactly, with beeceptor tested separately for a working endpoint. It hangs in Submission, and you can reproduce it by clicking on (i).
Endoskopie-Protokoll _ KoboToolbox-000038

I remember that I got this to work before, so I suspect it has to do with the recent update.

1 Like

Well, not during the last year, I admit…



I recreated the REST service today, and it works nicely. Looks like it is an intermittent problem, as one of the previous post on the subject mentioned.

2 Likes

Fair enough: searching for CSRF instead of the exact phrase returns more threads :smile: They’re referencing different parts of the application, though :wink:

Thanks for providing detailed steps. Do you recall if you logged out and back in again between seeing the failure and having success? Thanks again for helping us debug.

Logged out: Yes, several time, I am a strong believer in rebooting. I did not follow up though, because I gave up using this approach because the submitted data were incomplete - mainly on repeats.

Right, right: a good belief to have, but I asked only because the CSRF token error can be caused (or fixed) specifically by logging in/out, often in different tabs. We did just deploy a release that should avoid it in certain—hopefully most—scenarios.

That doesn’t sound good. You’re saying that the JSON (or XML?) posted by KoBo to your external server didn’t include all responses within repeating groups?

1 Like