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() from within notebook #372

Open liffiton opened 5 years ago

liffiton commented 5 years ago

Using Ok.py v1.14.15 and Jupyterlab 1.0.2.

When I submit a notebook using ok.submit() from within the notebook itself, the process completes and claims success, but when accessing the URL for the submission (provided in the output), no file is present. The okpy.org web interface for the submission says "Received on Fri 09/06 01:04 PM from [email]" with just blank space below it. Downloading the submissions for that assignment produces a .zip file with a directory for the user's submission, but there is only an info.json file in it and no notebook.

I also tested this on an assignment that I know was working correctly in the spring, so it is not an error in configuring the ok file or something like that.

Submitting the same assignment from the command line using ok --submit in the same directory works.

ja5087 commented 5 years ago

Thanks for the bug report. If you don't mind, can you upload a copy of the affected notebook (or a subset that demonstrates the issue)?

liffiton commented 5 years ago

Sure!

okpy_issue_372.zip

That includes a notebook and an .ok file. Executing the submission code in that notebook claims to succeed and gives me an okpy.org URL for the submission, but the web interface is blank as noted above.

The notebook submission code includes a workaround for issue #348, but I don't believe that is relevant (I've tried it without that also). The .ok file points to a "dummy" test file, because at least when I set it up okpy required I list at least one test, I think.

liffiton commented 5 years ago

I was just looking at the okpy-client code, and I see there is a new mode parameter for the Notebook constructor. If I change the initialization to ok = Notebook('A7.ok', mode="jupyterlab"), it submits successfully. This also fixes the error messages in #349 that were still present for me.

I'd suggest that something should at least warn the user instead of silently failing. And I haven't seen this documented anywhere, which would certainly help as well. But for now, I at least have a solution, I believe.

ybh0822 commented 4 years ago

Hello, I am just wondering if anyone had a similar issue this year. Weirdly such problems never happened previously.

davidwagner commented 4 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.