-
Notifications
You must be signed in to change notification settings - Fork 154
Unable to push forms to an aggregate server #852
Comments
Hi, @DavisRayM! Before starting to comment on my findings, I have a question about the correct URL one should use. Should I use On to the issue now: Let's establish first that Briefcase doesn't follow 302s. This is important because Ona will redirect If I use
So, taking a look at this exchange, I'm not sure what would we have to change... An Aggregate server would set and reuse session cookies to continue an authenticated exchange after the second request. What would Ona require in this instance? I'm also curious about previous versions of Briefcase. Perhaps we broke something related to auth in recent releases? Please advise. |
Hi @ggalmazor, Thank you for investigating this. The correct / advised endpoint to use on ona is In regards to the sequence of requests expected by Ona: Currently onadata expects all requests to be authenticated via digest auth. We don't utilize session cookies on our ODK endpoints afaik (This seems like something we should do... I'll bring this up on the onadata side). Ideal Sequence of requests
Sequence of request Briefcase v1.15.0 (and previous)
|
@ggalmazor I'm curious is this change on our end required for other ODK tools(Collect) ? |
Hi, @DavisRayM! After discussing this with @lognaturel, we agreed on trying to bring back the retries from v1.15 and previous versions, since the OpenRosa standard doesn't tell anything about cookies.
I'm not sure. In any case, let's wait to see how difficult is going to be to have those retries back in Briefcase. |
That would be awesome. I'd like to help where I can, I'm not really used to Java but would like to learn it.... A few pointers on what the change may entail and I can possibly work on it, if that's fine ?
|
That'd be great, although I'm still exploring this issue... I think for now the most useful thing would be to confirm whether Ona is setting the correct value in the
OTOH, this is the 401 response to a
The payload from this one matches the At this moment, I'm suspecting that the crash from trying to read the |
Thanks! Also, note that that response is more than 114 bytes long! https://mothereff.in/byte-counter has proven to be useful lately :D |
In the meantime, I'm exploring alternative ways to make the request so that we don't crash for that reason. |
Might have something to do with the
Keeping the above in https://mothereff.in/byte-counter will calculate the right content-length |
OK, I see. If you can confirm that Ona actually responds that content, then Briefcase might be closing the connection too early, which would explain why it's failing to read the payload. |
OK, @DavisRayM! I've confirmed that I get truncated 401 responses from Ona using curl:
(not really important, but here's the payload file: payload.txt) From my end, it looks like Ona is closing the connection after writing the headers. |
Hey @ggalmazor, sorry for the late response. We don't seem to be doing anything different on the
Mhh let me look into this.... I'm not sure why the connections are being closed.
|
We've been able to replicate and kind of fix the connection close issue (still happens intermittently looking towards fixing that completely). Encountered the following error on Briefcase though. Please use stage-odk.ona.io, for testing (Hopefully will get the connection close issues resolved in a bit) |
Awesome, thanks! I'll check it now |
Huh... I'm getting non-empty responses with my curl command, but Briefcase keeps getting them empty... Any ideas? |
Could you copy the text from that error stacktrace here so that I can debug it? |
|
Thanks! I think I have a working solution for the non-repeatable request error in that stacktrace. Let's see if I can sort out the empty response issue now... |
Still looking into this but the only way to kind of bypass this, is to retry 😅 .
|
If you have a branch with the suspected fix, I could try it out on my side. The retrying bit can get a bit annoying |
The weird thing is that I'm launching both things (curl and Briefcase push) almost at the same time and I'm consistently getting non-empty responses with curl, and empty ones with Briefcase :/ |
Yea, I had the same issue a while back.... We have buffering enabled on post requests(the weird connection close happens if it isn't) but for some reason it just fails sometimes. |
I just got one through! :) Yay! Well, I got a 404 error while sending a submission now. Here's the HTTP exchange log:
It works as expected:
Not sure why I'm getting a 404, though. |
Awesome! I'm not quite sure exactly why you got a 404 but one reason would be that the XForm version specified in the submission xml is not the same as the one onadata has. I'll look into solving the connection issue. |
OK, let's recap then:
|
Sounds about right.
|
OK, I've pushed the change to make repeatable requests here: https://github.com/ggalmazor/briefcase/tree/repeatable_http_requests Let me know if that solves the issue you're seeing. I've tried to reproduce it in my computer without success so far. |
Nice, let me test it out. I hope the connection issue is solved on your side when using |
@ggalmazor Able to replicate the issue by trying to push a form that doesn't exist on ona(no submission data).
|
Here's the debug log: |
Hi, @DavisRayM! It looks like I messed up the branch I linked yesterday and it didn't have the fix. I'm sorry for making you lose time on this. I've created a PR with the fix at #856. Could you try again with the code from that PR, please? |
Hey, no worries at all. Let me try it out. |
@ggalmazor The fix seems to work fine on my side. Able to push forms and submissions now 🎉 |
Awesome! I'll fix this for review and QA then. Let's see if we can get this shipped by Friday tops |
Software versions
Briefcase v1.17.2, MacOS Mojave, onadata v2.1.2
Problem description
Pushing a form to
onadata
freezes onSending Form
.Steps to reproduce the problem
Expected behavior
The form should be pushed or an error should be raised on failure.
Other information
Briefcase log: briefcase(2).log
Related issue: #801
The text was updated successfully, but these errors were encountered: