yuvipanda / jupyterhub-nginx-chp

configurable-http-proxy for use with JupyterHub written in nginx + lua
BSD 3-Clause "New" or "Revised" License
12 stars 5 forks source link

413 Request Entity Too Large error when saving a not very large notebook #17

Open Analect opened 7 years ago

Analect commented 7 years ago

@yuvipanda ... I haven't been able to switch to the new helm chart for deploying jupyterhub on kubernetes yet and still use this NCHP as part of the mix. Any suggestions on what I might have to tweak here in order to be able to save large files with jupyterlab running on jupyterhub on a kubernetes set-up? This is the first time I'm hitting this problem. Thanks.

Jupyterlab 0.24.1 Notebook 5.0.0 Running on jupyterhub 0.72 on a kubernetes cluster using this proxy solution.

Since nginx features in the dialogue box, I think this is problem stems from there rather than jupyterlab itself. See proxy logs:

2017-06-23T15:06:22.106179931Z 10.4.3.1 - - [23/Jun/2017:15:06:22 +0000] "GET /user/test/api/contents/notebooks/statistical-analysis?content=1&1498230401836 HTTP/1.1" 200 1412 "http://jupyterlab.mydomain.com/user/test/lab?" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
2017-06-23T15:06:29.279857464Z 2017/06/23 15:06:29 [error] 6#6: *75297 client intended to send too large body: 1080562 bytes, client: 10.4.3.1, server: , request: "PUT /user/test/api/contents/notebooks/statistical-analysis/02-statistical-data-visualization.ipynb?1498230409006 HTTP/1.1", host: "jupyterlab.mydomain.com", referrer: "http://jupyterlab.mydomain.com/user/test/lab?"
2017-06-23T15:06:29.293767645Z 10.4.3.1 - - [23/Jun/2017:15:06:29 +0000] "GET /user/test/api/contents/notebooks/statistical-analysis?content=1&1498230409015 HTTP/1.1" 200 1412 "http://jupyterlab.mydomain.com/user/test/lab?" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"

I hadn't come across this limitation before. This is a 1.08MB notebook derived from here: https://github.com/choldgraf/reproducible_research_2017/blob/master/week_03/Statistical%20Data%20Visualization.ipynb ... which I was trying to save in Jupyterlab context.

image

I'm not sure if it's relevant or not, but I had set c.NotebookApp.iopub_data_rate_limit = 10000000 #see https://github.com/jupyter/notebook/issues/2287 in the relevant jupyter_notebook_config.py file, which should have given me ample head-room, if indeed that setting does what I think it does and it's getting picked up in a JupyterLab context.

anton-khodak commented 6 years ago

You can try changing nginx client_max_body_size setting as suggested here: https://github.com/jupyterlab/jupyterlab/issues/4214#issue-307020115