Cal-CS-61A-Staff / examtool-web

MIT License
0 stars 2 forks source link

Server responded but failed to save #15

Closed davidwagner closed 3 years ago

davidwagner commented 3 years ago

A student is reporting that they see the error "Server responded but failed to save, please refresh and try again. If this error persists, contact your course staff or use the alternative exam medium." They say that their Internet is working fine.

How would I approach troubleshooting the cause of this problem?

It looks like the relevant code is in the vicinity of

https://github.com/Cal-CS-61A-Staff/examtool-web/blob/71946e2f9b91819f02e8adb83983a3d344158552/apps/exam/main.py#L131

and the online code I can see that would cause an unsuccessful return are related to the time. Do I need to worry about student computers' clocks being set incorrectly? Are there are other possible causes for this error?

rahularya50 commented 3 years ago

You can see if their request is reaching the server by running examtool logs --email <THEIR_EMAIL> --exam <THE_EXAM>. It will show up, if it is arriving. (even if it's past the deadline / they're not on the roster / anything like that)

If not, the error is being thrown on the client because the network request failed. You can see the causes here: https://github.com/Cal-CS-61A-Staff/examtool-web/blob/71946e2f9b91819f02e8adb83983a3d344158552/apps/js/Question.js#L166 [non 200 response code, success=false, or a timeout]

rahularya50 commented 3 years ago

If they see the error just once, then it might be a transient thing with their internet / GCP. If the error is persistent, then something else has gone wrong. If that is the case and they are not showing up in the logs, then I'm fairly confident it's an internet error. If that is the case and they are showing up in the logs, then there is a bug in the server.

rahularya50 commented 3 years ago

The only way a student's clock could cause an issue is if it is non-monotonic. If they submit, then their clock time goes backwards by x time, then they will be unable to submit for min(x, 5 minutes) because the server will assume their saved response is behind the latest response seen by the server.

davidwagner commented 3 years ago

Got it, thank you. I was able to check their clocks by using examtool save-logs (which shows both the client timestamp and the server timestamp; that's not reported with examtool logs but is with save-logs) and rule out clock issues. Thank you for your help.