okpy / ok-client

A Python client for the OK autograding system
https://okpy.org/
Apache License 2.0
57 stars 42 forks source link

No file uploaded by ok.submit() - related to #372 #451

Open ybh0822 opened 4 years ago

ybh0822 commented 4 years ago

Hello,

This is related to #349 and #372. I am a GSI for Physics 188/288. We use OK for homework submission.

Running ok.submit(), I get the following error message:

Saving notebook... Could not automatically save 'HW4_188.ipynb' Make sure your notebook is correctly named and saved before submitting to OK! Making a best attempt to submit latest 'HW4_188.ipynb', last modified at Thu Sep 17 23:51:49 2020 Submit... 100% complete

Downloading the submissions for that assignment, I also get only an info.json file in it and no notebook. (similar to #372 ) Weirdly I get this error on an assignment that I know was working last fall. (also similar to #372 )

If I change the initialization to ok = Notebook('HW4.ok', mode="jupyterlab"), as suggested in #372 , I get this following error:

Javascript error adding output! TypeError: Cannot read property 'click' of null See your browser Javascript console for more details. Saving notebook... Could not automatically save 'HW4_188.ipynb' Make sure your notebook is correctly named and saved before submitting to OK! Making a best attempt to submit latest 'HW4_188.ipynb', last modified at Thu Sep 17 23:51:49 2020 Submit... 100% complete

Thank you for the help in advance!

Also, below I uploaded a copy of the notebook and .ok file: P188_ok_issue.zip

Update: Out of 54 submissions, we have issues with 10 students. Any advise or comment would be greatly appreciated.

ja5087 commented 3 years ago

This doesn't seem to be related to the Jupyterlab mode. Just curious, are you using DataHub or the like? The issue only affecting some proportion of students suggests this depends on the environment and is possibly a race condition in the saving logic.

ybh0822 commented 3 years ago

@ja5087, thank you for your comment. Sorry you are right, this isn't related to the Jupyterlab mode. We are using Datahub indeed. Hmm, any advice on how to debug this? This time, half of the students who had issues in the last assignment got affected.

davidwagner commented 3 years ago

We might have figured out the issue. It looks like our Jupyter Hub was having trouble saving notebooks: the save took longer than 5 seconds, or failed. When that happens, the client-side code uploads an empty notebook, and the symptoms described here happen.

Yuvi Panda made some changes to the Berkeley datahub that have mostly (but not entirely) eliminated this problem. So, if you see this, I suggest checking whether that's what's going on.

I think this can probably be closed as the root cause is primarily datahub. The best that okpy could do is handle this error message better.