Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
liffiton opened this issue Sep 6, 2019 · 5 comments
Open

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

liffiton opened this issue Sep 6, 2019 · 5 comments

Comments

@liffiton
Copy link

liffiton commented Sep 6, 2019

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
Copy link
Contributor

ja5087 commented Sep 9, 2019

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
Copy link
Author

liffiton commented Sep 9, 2019

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
Copy link
Author

liffiton commented Sep 9, 2019

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
Copy link

ybh0822 commented Sep 24, 2020

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

@davidwagner
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants