nbviewer icon indicating copy to clipboard operation
nbviewer copied to clipboard

Download notebook file size limit in nbviewer

Open vinaykumar80 opened this issue 4 years ago • 5 comments

Hi,

We are running nbviewer application on JupyterHub (Littlest JupyterHub) and have recently noticed that download notebook functionality in nbviewer is cutting off some cells in the downloaded notebook, so part of the notebook contents are not downloaded.

However, the viewing of notebook in nbviewer iteself works fine. Is there any max file size limit on notebook sizee in nbviewer download functionality?

Thank you!

vinaykumar80 avatar May 28 '20 02:05 vinaykumar80

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/nbviewer-truncating-notebooks-size-grater-than-128-kb/4605/1

meeseeksmachine avatar May 28 '20 22:05 meeseeksmachine

I mentioned the issue on Jupyter Community Forum as well, to seek additional assistance.

vinaykumar80 avatar May 28 '20 22:05 vinaykumar80

Can you share a notebook that has this issue, both the downloaded truncated version and the original?

If the file itself is being truncated, then it will not be a valid notebook since the JSON won't be complete and you won't be able to open it. Is this the case? If the notebook is valid, then it is not being truncated at the http level. In that case, I suspect what's happening is a possible cache issue where the version rendered and the version downloaded are interacting with the cache differently.

minrk avatar May 29 '20 11:05 minrk

@minrk : The notebook files are valid as we can run them successfully in JupyterHub and also browse the complete files in nbviewer. We can download these notebooks completely in Jupyter/JupyterHub and Chrome browser (starting http.server), but on clicking "Download" menu option in nbviewer is downloading partial files for notebooks greater than 128 KB (files less than 128 KB downloads completely)

Attached zip file has example notebooks - "chunks_3_jh" and "chunks_4_jh" notebooks are original files and "chunks_3_nbviewer" and "chunks_4_nbviewer" notebooks are truncated files (after nbviewer download) notebooks.zip

Screenshot of file sizes before nbviewer download and after nbviewer download: notebook_file_sizes_before notebook_file_sizes_after

vinaykumar80 avatar May 29 '20 14:05 vinaykumar80

@minrk : To add, it appears like notebook file itself is truncated on nbviewer download, hence we are receiving the below error when opening this notebook:

The error was: SyntaxError: Unexpected end of JSON input

Any thoughts? Thanks!

vinaykumar80 avatar Jun 01 '20 13:06 vinaykumar80