ok-client icon indicating copy to clipboard operation
ok-client copied to clipboard

No file uploaded by ok.submit() from within notebook

Open liffiton opened this issue 6 years ago • 5 comments

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.

liffiton avatar Sep 06 '19 19:09 liffiton

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)?

ja5087 avatar Sep 09 '19 20:09 ja5087

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 avatar Sep 09 '19 20:09 liffiton

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.

liffiton avatar Sep 09 '19 20:09 liffiton

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

ybh0822 avatar Sep 24 '20 09:09 ybh0822

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.

davidwagner avatar Oct 07 '20 16:10 davidwagner