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

Jupyterlab shows up as blank when using jupyterhub #7053

Closed
OneRaynyDay opened this issue Aug 19, 2019 · 32 comments · Fixed by #7055
Closed

Jupyterlab shows up as blank when using jupyterhub #7053

OneRaynyDay opened this issue Aug 19, 2019 · 32 comments · Fixed by #7055
Labels
bug status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Build System
Milestone

Comments

@OneRaynyDay
Copy link
Contributor

Description

At Airbnb, we want to serve our data scientists with hosted jupyter notebooks with jupyterhub. We are trying to add jupyterlab as an alternative for user interface. Installing into the single-user instances (inside docker), following the steps in https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html , upon replacing the /tree suburl with /lab, we get a blank screen as shown below:

image

image

Reproduce

Unfortunately, it is difficult to give an MVCE of this problem because we have our own custom jupyterhub code that is not yet open to the public. However, it should not conflict with any jupyterlab things because it's mostly backend. Here's a log of the jupyter single-user output:

[D 2019-08-19 23:54:58.960 ray_zhang application:177] Searching ['/efs/home/ray_zhang', '/home/default_user/.jupyter', '/opt/conda/envs/jupyterhub/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2019-08-19 23:54:58.961 ray_zhang application:555] Looking for jupyter_config in /etc/jupyter
[D 2019-08-19 23:54:58.961 ray_zhang application:555] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2019-08-19 23:54:58.961 ray_zhang application:555] Looking for jupyter_config in /opt/conda/envs/jupyterhub/etc/jupyter
[D 2019-08-19 23:54:58.961 ray_zhang application:555] Looking for jupyter_config in /home/default_user/.jupyter
[D 2019-08-19 23:54:58.961 ray_zhang application:555] Looking for jupyter_config in /efs/home/ray_zhang
[D 2019-08-19 23:54:58.962 ray_zhang application:555] Looking for jupyter_notebook_config in /etc/jupyter
[D 2019-08-19 23:54:58.962 ray_zhang application:577] Loaded config file: /etc/jupyter/jupyter_notebook_config.py
[D 2019-08-19 23:54:58.962 ray_zhang application:555] Looking for jupyter_notebook_config in /usr/local/etc/jupyter
[D 2019-08-19 23:54:58.963 ray_zhang application:577] Loaded config file: /usr/local/etc/jupyter/jupyter_notebook_config.json
[D 2019-08-19 23:54:58.963 ray_zhang application:555] Looking for jupyter_notebook_config in /opt/conda/envs/jupyterhub/etc/jupyter
[D 2019-08-19 23:54:58.963 ray_zhang application:577] Loaded config file: /opt/conda/envs/jupyterhub/etc/jupyter/jupyter_notebook_config.json
[D 2019-08-19 23:54:58.963 ray_zhang application:555] Looking for jupyter_notebook_config in /home/default_user/.jupyter
[D 2019-08-19 23:54:58.963 ray_zhang application:555] Looking for jupyter_notebook_config in /efs/home/ray_zhang
[W 2019-08-19 23:54:58.964 ray_zhang notebookapp:1245] server_extensions is deprecated, use nbserver_extensions
[D 2019-08-19 23:54:58.967 ray_zhang config_manager:98] Paths used for configuration of notebook:
    	/home/default_user/.jupyter/nbconfig/notebook.json
[D 2019-08-19 23:54:58.967 ray_zhang config_manager:98] Paths used for configuration of notebook:

[D 2019-08-19 23:54:58.968 ray_zhang config_manager:98] Paths used for configuration of notebook:
    	/home/default_user/.jupyter/nbconfig/notebook.json
[D 2019-08-19 23:54:58.968 ray_zhang config_manager:98] Paths used for configuration of notebook:

[D 2019-08-19 23:54:58.968 ray_zhang config_manager:98] Paths used for configuration of notebook:
    	/home/default_user/.jupyter/nbconfig/notebook.json
[D 2019-08-19 23:54:58.968 ray_zhang config_manager:98] Paths used for configuration of notebook:

[W 2019-08-19 23:54:59.112 ray_zhang login:236] All authentication is disabled.  Anyone who can connect to this server will be able to run code.
[D 2019-08-19 23:54:59.115 ray_zhang config_manager:98] Paths used for configuration of jupyter_notebook_config:
    	/etc/jupyter/jupyter_notebook_config.json
[D 2019-08-19 23:54:59.116 ray_zhang config_manager:98] Paths used for configuration of jupyter_notebook_config:
    	/usr/local/etc/jupyter/jupyter_notebook_config.json
[D 2019-08-19 23:54:59.116 ray_zhang config_manager:98] Paths used for configuration of jupyter_notebook_config:
    	/opt/conda/envs/jupyterhub/etc/jupyter/jupyter_notebook_config.d/jupyterlab.json
    	/opt/conda/envs/jupyterhub/etc/jupyter/jupyter_notebook_config.json
[D 2019-08-19 23:54:59.117 ray_zhang config_manager:98] Paths used for configuration of jupyter_notebook_config:
    	/home/default_user/.jupyter/jupyter_notebook_config.json
[D 2019-08-19 23:54:59.117 ray_zhang __init__:228] [jupyter_nbextensions_configurator] Loading 0.4.1
[D 2019-08-19 23:54:59.117 ray_zhang __init__:233] [jupyter_nbextensions_configurator]   Editing templates path to add /opt/conda/envs/jupyterhub/lib/python3.6/site-packages/jupyter_nbextensions_configurator/templates
[D 2019-08-19 23:54:59.117 ray_zhang __init__:246] [jupyter_nbextensions_configurator]   Editing nbextensions path to add /opt/conda/envs/jupyterhub/lib/python3.6/site-packages/jupyter_nbextensions_configurator/static
[D 2019-08-19 23:54:59.117 ray_zhang __init__:251] [jupyter_nbextensions_configurator]   Adding new handlers
[I 2019-08-19 23:54:59.118 ray_zhang __init__:259] [jupyter_nbextensions_configurator] enabled 0.4.1
[I 2019-08-19 23:54:59.161 ray_zhang extension:155] JupyterLab extension loaded from /opt/conda/envs/jupyterhub/lib/python3.6/site-packages/jupyterlab
[I 2019-08-19 23:54:59.161 ray_zhang extension:156] JupyterLab application directory is /opt/conda/envs/jupyterhub/share/jupyter/lab
[I 2019-08-19 23:54:59.162 ray_zhang notebookapp:1772] Serving notebooks from local directory: /home/ray_zhang/redspot_home
[I 2019-08-19 23:54:59.162 ray_zhang notebookapp:1772] The Jupyter Notebook is running at:
[I 2019-08-19 23:54:59.162 ray_zhang notebookapp:1772] http://(i-07df6a2c840bea0b2 or 127.0.0.1):43953/user/ray_zhang/
[I 2019-08-19 23:54:59.162 ray_zhang notebookapp:1773] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[D 2019-08-19 23:55:03.696 ray_zhang auth:190] Received request from Hub user {'spawner': 'remote', 'name': 'ray_zhang', 'server': '/user/ray_zhang', 'admin': True, 'pending': None, 'groups': [], 'last_activity': '2019-08-19T18:46:06.926657'}
[D 2019-08-19 23:55:03.699 ray_zhang auth:287] Allowing whitelisted Hub user ray_zhang
[D 2019-08-19 23:55:03.700 ray_zhang handlers:259] Using contents: services/contents
[D 2019-08-19 23:55:03.704 ray_zhang log:48] 200 GET /user/ray_zhang/lab (::ffff:127.0.0.1) 41.71ms
[D 2019-08-19 23:55:03.838 ray_zhang auth:287] Allowing whitelisted Hub user ray_zhang
[D 2019-08-19 23:55:03.839 ray_zhang handlers:772] Path main.818a350c3d8e51c69afb.js served from /opt/conda/envs/jupyterhub/share/jupyter/lab/static/main.818a350c3d8e51c69afb.js
[D 2019-08-19 23:55:03.840 ray_zhang log:48] 304 GET /user/ray_zhang/static/lab/main.818a350c3d8e51c69afb.js (::ffff:127.0.0.1) 1.96ms
[D 2019-08-19 23:55:03.841 ray_zhang auth:287] Allowing whitelisted Hub user ray_zhang
[D 2019-08-19 23:55:03.842 ray_zhang handlers:772] Path vendors~main.16dd8e3ff113bfdf58cc.js served from /opt/conda/envs/jupyterhub/share/jupyter/lab/static/vendors~main.16dd8e3ff113bfdf58cc.js
[D 2019-08-19 23:55:03.842 ray_zhang log:48] 304 GET /user/ray_zhang/static/lab/vendors~main.16dd8e3ff113bfdf58cc.js (::ffff:127.0.0.1) 1.05ms

Expected behavior

See the jupyterlab IDE look upon accessing /lab url

Context

  • Operating System and version:
root@i-07df6a2c840bea0b2:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.1 LTS
Release:	18.04
Codename:	bionic
  • Browser and version:

Chrome:

Version 76.0.3809.100 (Official Build) (64-bit)
  • JupyterLab version:
jupyterlab==1.0.6
jupyterlab-server==1.0.4
Troubleshoot Output
root@i-07df6a2c840bea0b2:/home/default_user/redspot_home# /opt/conda/envs/jupyterhub/bin/jupyter troubleshoot
WARNING: The directory '/efs/home/ray_zhang/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
$PATH:
	/opt/conda/bin
	/usr/local/sbin
	/usr/local/bin
	/usr/sbin
	/usr/bin
	/sbin
	/bin
	/srv/lib/spark/spark-2.4.0-bin-hadoop2.7/bin

sys.path:
/opt/conda/envs/jupyterhub/bin
/opt/conda/envs/jupyterhub/lib/python36.zip
/opt/conda/envs/jupyterhub/lib/python3.6
/opt/conda/envs/jupyterhub/lib/python3.6/lib-dynload
/opt/conda/envs/jupyterhub/lib/python3.6/site-packages

sys.executable:
/opt/conda/envs/jupyterhub/bin/python

sys.version:
3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31)
[GCC 7.3.0]

platform.platform():
Linux-4.4.0-154-generic-x86_64-with-debian-buster-sid

pip list:
Package Version
--------------------------------- ---------
alembic 0.9.3
asn1crypto 0.24.0
attrs 19.1.0
backcall 0.1.0
bleach 3.1.0
boto3 1.4.4
botocore 1.5.95
certifi 2019.6.16
cffi 1.12.3
chardet 3.0.4
cryptography 2.7
datadog 0.28.0
decorator 4.4.0
deepmerge 0.0.4
defusedxml 0.6.0
docker 2.4.2
docker-pycreds 0.4.0
docutils 0.15.2
entrypoints 0.3
escapism 1.0.0
idna 2.5
ipykernel 5.1.1
ipython 7.7.0
ipython-genutils 0.2.0
ipywidgets 7.5.0
jedi 0.15.1
Jinja2 2.9.6
jmespath 0.9.4
json5 0.8.5
jsonschema 3.0.2
jupyter-client 5.3.1
jupyter-console 5.2.0
jupyter-contrib-core 0.3.3
jupyter-core 4.5.0
jupyter-nbextensions-configurator 0.4.1
jupyterhub 0.7.2
jupyterlab 1.0.6
jupyterlab-server 1.0.4
lxml 4.4.1
Mako 1.1.0
MarkupSafe 1.1.1
mistune 0.8.4
mysqlclient 1.3.12
nbconvert 5.4.1
nbformat 4.4.0
nose 1.3.7
notebook 5.7.5
pamela 0.3.0
pandocfilters 1.4.2
parso 0.5.1
pexpect 4.7.0
pickleshare 0.7.5
pip 19.1.1
prometheus-client 0.7.1
prompt-toolkit 2.0.9
ptyprocess 0.6.0
pycparser 2.19
Pygments 2.4.2
pyhocon 0.3.38
pyOpenSSL 17.4.0
pyparsing 2.4.2
pyrsistent 0.15.4
python-dateutil 2.8.0
python-editor 1.0.4
PyYAML 3.12
pyzmq 18.1.0
qtconsole 4.5.1
raven 6.10.0
requests 2.18.1
s3transfer 0.1.13
Send2Trash 1.5.0
setuptools 41.1.0
six 1.12.0
SQLAlchemy 1.1.11
straitlets 0.3.1
terminado 0.8.2
testpath 0.4.2
tornado 4.5.1
traitlets 4.3.2
urllib3 1.21.1
wcwidth 0.1.7
webencodings 0.5.1
websocket-client 0.56.0
wheel 0.33.4
widgetsnbextension 3.5.1

conda list:
# packages in environment at /opt/conda:
#
asn1crypto 0.22.0 py27h94ebe91_1
ca-certificates 2017.08.26 h1d4fec5_0
certifi 2017.7.27.1 py27h9ceb091_0
cffi 1.10.0 py27hf1aaaf4_1
chardet 3.0.4 py27hfa10054_1
conda 4.3.27 py27hff99c7a_0
conda-env 2.6.0 h36134e3_1
cryptography 2.0.3 py27hea39389_1
enum34 1.1.6 py27h99a27e9_1
idna 2.6 py27h5722d68_1
ipaddress 1.0.18 py27h337fd85_0
libedit 3.1 heed3624_0
libffi 3.2.1 h4deb6c0_3
libgcc-ng 7.2.0 hcbc56d2_1
libstdcxx-ng 7.2.0 h24385c6_1
ncurses 6.0 h06874d7_1
openssl 1.0.2l h9d1a558_3
pip 9.0.1 py27h4c18a59_2
pycosat 0.6.2 py27h1cf261c_1
pycparser 2.18 py27hefa08c5_1
pyopenssl 17.2.0 py27h189ff3b_0
pysocks 1.6.7 py27he2db6d2_1
python 2.7.13 hfff3488_13
readline 7.0 hac23ff0_3
requests 2.18.4 py27hc5b0589_1
ruamel_yaml 0.11.14 py27h672d447_2
setuptools 36.5.0 py27h68b189e_0
six 1.10.0 py27hdcd7534_1
sqlite 3.20.1 h6d8b0f3_1
tk 8.6.7 h5979e9b_1
urllib3 1.22 py27ha55213b_0
wheel 0.29.0 py27h411dd7b_1
yaml 0.1.7 h96e3832_1
zlib 1.2.11 hfbfcf68_1

Browser Output
lab:2 Uncaught SyntaxError: Unexpected token & in JSON at position 6
    at JSON.parse ()
    at Object.getOption (pageconfig.js:44)
    at Module.ANye (index.out.js:13)
    at n (bootstrap:84)
    at Object.0 (main.818a350c3d8e51c69afb.js:1)
    at n (bootstrap:84)
    at r (bootstrap:45)
    at Array.s [as push] (bootstrap:32)
    at vendors~main.16dd8e3ff113bfdf58cc.js:1
lab:1 Error handling response: TypeError: Cannot read property 'corp_email_domain' of undefined
    at chrome-extension://gbknpchijlnmdiejnppjnefniabialca/content_script_compiled.js:401:178
lab:1 Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
@haraldschilly
Copy link

Hi, at CoCalc.com, we also try to update Jupyter Lab and run into exactly the same issue. Stopping the JS console right there and inspecting the supposed json value, it shows up as:

    {"appName": "JupyterLab", "appNamespace": "jupyterlab", "appSettingsDir": "/usr/local/share/jupyter/lab/settings", "appUrl": "/lab", "appVersion": "1.0.6", "baseUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/", "buildAvailable": true, "buildCheck": true, "cacheFiles": true, "devMode": false, "fullAppUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab", "fullMathjaxUrl": "/static/mathjax/MathJax.js", "fullSettingsUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/api/settings", "fullStaticUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/static/lab", "fullThemesUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/api/themes", "fullTreeUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/tree", "fullWorkspacesApiUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/api/workspaces", "fullWorkspacesUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/workspaces", "ignorePlugins": [], "mathjaxConfig": "TeX-AMS-MML_HTMLorMML-full,Safe", "notebookVersion": "[6, 0, 0]", "quitButton": true, "schemasDir": "/usr/local/share/jupyter/lab/schemas", "serverRoot": "/home/user", "settingsUrl": "/lab/api/settings", "staticDir": "/usr/local/share/jupyter/lab/static", "staticUrl": "/static/lab", "store_id": 5, "templatesDir": "/usr/local/share/jupyter/lab/static", "terminalsAvailable": true, "themesDir": "/usr/local/share/jupyter/lab/themes", "themesUrl": "/lab/api/themes", "token": "", "treeUrl": "/lab/tree", "userSettingsDir": "/home/user/.jupyter/lab/user-settings", "workspacesApiUrl": "/lab/api/workspaces", "workspacesDir": "/home/user/.jupyter/lab/workspaces", "workspacesUrl": "/lab/workspaces", "wsUrl": ""}
  

I found various related tickets, but wasn't able to figure out what to do to fix this. In particular, how exactly is it ending up in that div holding the config data?

Screenshot from 2019-08-20 11-41-02

@haraldschilly
Copy link

@OneRaynyDay since your ticket was just 10 hours old when I saw it, I tried to rollback. Indeed, pip3 install jupyterlab==1.0.5 and now it works. My conclusion is the 1.0.6 is a broken release.

@jasongrout
Copy link
Contributor

Thanks for the clear report. We had some changes in 1.0.6 relating to serializing that config to JSON: #7036 (backported from #7016). I'll look at this in the morning. What version of jupyterlab_server do you have? There were also related changes in jupyterlab_server: jupyterlab/jupyterlab_server#75

@haraldschilly
Copy link

In the environment I was just working with, I've right now:

root@...:/# pip3 list | grep jupyterlab   
jupyterlab                        1.0.5            
jupyterlab-launcher               0.13.1           
jupyterlab-server                 1.0.4            

@jasongrout
Copy link
Contributor

Also, are either of you using custom jinja templates for the page that is housing the pageconfig? In other words, are you replacing the https://github.com/jupyterlab/jupyterlab/blob/master/dev_mode/templates/partial.html template that comes with JupyterLab?

@haraldschilly
Copy link

Well, I'm not modifying anything, at least not intentional. During my battle with this, I even uninstalled jupyterlab, updated some related packages (also this jupyterlab server), … and even deleted the entire /usr/local/share/jupyter/lab before installing jupyterlab again.

@blink1073
Copy link
Member

@haraldschilly, are you able to set a break point in the jupyterlab_server? If so, can you please print the contents of page_config here?

@jasongrout
Copy link
Contributor

@blink1073 - I wonder if the handlebars template is escaping that pageconfig for some reason in https://github.com/jupyterlab/jupyterlab/blob/master/jupyterlab/staging/templates/template.html#L7

@haraldschilly
Copy link

@blink1073 well, this is remote in cocalc, or my debugger skills aren't that good. I updated jupyterlab, such that the error appears again … and I installed the server as a user via pip3 install -U --ignore-installed --no-deps jupyterlab-server and then inserted that line above the one you mention:

open(os.path.expanduser('~/jupyter-server-page_config'), 'w').write(json.dumps(page_config))

the file content looks fine, i.e.

{"quitButton": true, "buildAvailable": true, "buildCheck": true, "devMode": false, "token": "", "notebookVersion": "[6, 0, 0]", "terminalsAvailable": true, "ignorePlugins": [], "serverRoot": "/home/user", "store_id": 1, "mathjaxConfig": "TeX-AMS-MML_HTMLorMML-full,Safe", "fullMathjaxUrl": "/static/mathjax/MathJax.js", "appName": "JupyterLab", "appNamespace": "jupyterlab", "appSettingsDir": "/home/user/.local/share/jupyter/lab/settings", "appUrl": "/lab", "appVersion": "1.0.6", "cacheFiles": true, "schemasDir": "/home/user/.local/share/jupyter/lab/schemas", "settingsUrl": "/lab/api/settings", "staticDir": "/home/user/.local/share/jupyter/lab/static", "staticUrl": "/static/lab", "templatesDir": "/home/user/.local/share/jupyter/lab/static", "themesDir": "/home/user/.local/share/jupyter/lab/themes", "themesUrl": "/lab/api/themes", "treeUrl": "/lab/tree", "userSettingsDir": "/home/user/.jupyter/lab/user-settings", "workspacesApiUrl": "/lab/api/workspaces", "workspacesDir": "/home/user/.jupyter/lab/workspaces", "workspacesUrl": "/lab/workspaces", "fullAppUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab", "fullSettingsUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/api/settings", "fullStaticUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/static/lab", "fullThemesUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/api/themes", "fullTreeUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/tree", "fullWorkspacesApiUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/api/workspaces", "fullWorkspacesUrl": "/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/workspaces"}

@blink1073
Copy link
Member

Thanks @haraldschilly, I can use that to recreate your setup locally.

@jasongrout
Copy link
Contributor

Another thought - perhaps autoescaping is somehow turned on in jinja, so that block is getting escaped? Perhaps https://jinja.palletsprojects.com/en/2.10.x/templates/#autoescape-overrides helps?

@blink1073
Copy link
Member

Okay, with no changes applied other than injecting the new page_config, I get:

document.getElementById('jupyter-config-data').textContent
"
    {\"appName\": \"JupyterLab\", \"appNamespace\": \"jupyterlab\", \"appSettingsDir\": \"/home/user/.local/share/jupyter/lab/settings\", \"appUrl\": \"/lab\", \"appVersion\": \"1.0.6\", \"baseUrl\": \"/\", \"buildAvailable\": true, \"buildCheck\": true, \"cacheFiles\": true, \"devMode\": false, \"fullAppUrl\": \"/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab\", \"fullMathjaxUrl\": \"/static/mathjax/MathJax.js\", \"fullSettingsUrl\": \"/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/api/settings\", \"fullStaticUrl\": \"/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/static/lab\", \"fullThemesUrl\": \"/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/api/themes\", \"fullTreeUrl\": \"/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/tree\", \"fullWorkspacesApiUrl\": \"/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/api/workspaces\", \"fullWorkspacesUrl\": \"/b9bacd7b-6cee-402c-88ed-9d74b07f29a1/port/6002/lab/workspaces\", \"ignorePlugins\": [], \"mathjaxConfig\": \"TeX-AMS-MML_HTMLorMML-full,Safe\", \"notebookVersion\": \"[6, 0, 0]\", \"quitButton\": true, \"schemasDir\": \"/home/user/.local/share/jupyter/lab/schemas\", \"serverRoot\": \"/home/user\", \"settingsUrl\": \"/lab/api/settings\", \"staticDir\": \"/home/user/.local/share/jupyter/lab/static\", \"staticUrl\": \"/static/lab\", \"store_id\": 1, \"templatesDir\": \"/home/user/.local/share/jupyter/lab/static\", \"terminalsAvailable\": true, \"themesDir\": \"/home/user/.local/share/jupyter/lab/themes\", \"themesUrl\": \"/lab/api/themes\", \"token\": \"\", \"treeUrl\": \"/lab/tree\", \"userSettingsDir\": \"/home/user/.jupyter/lab/user-settings\", \"workspacesApiUrl\": \"/lab/api/workspaces\", \"workspacesDir\": \"/home/user/.jupyter/lab/workspaces\", \"workspacesUrl\": \"/lab/workspaces\", \"wsUrl\": \"\"}
  "
JSON.parse(document.getElementById('jupyter-config-data').textContent)
Object { appName: "JupyterLab", appNamespace: "jupyterlab", appSettingsDir: "/home/user/.local/share/jupyter/lab/settings", appUrl: "/lab", appVersion: "1.0.6", baseUrl: "/", buildAvailable: true, buildCheck: true, cacheFiles: true, devMode: false,}

@haraldschilly
Copy link

hmm, I can try to render a basic {{ data | tojson }} template with the config the server is using. In case it matters, the version of jinja2 I have here is 2.9.6

@blink1073
Copy link
Member

The above works in Firefox and Chrome (all I have right now on my Linux machine).

@blink1073
Copy link
Member

I have jinja 2.10.1 locally.

@jasongrout
Copy link
Contributor

on my Linux machine

👍 :)

@haraldschilly
Copy link

ok, we have some progress. I ran

$ pip3 install -U --ignore-installed --no-deps jinja2
Collecting...
Successfully installed jinja2-2.10.1

and that unbreaks it!!!

@blink1073
Copy link
Member

I'm trying the reverse now...

@haraldschilly
Copy link

yes, I'm currently double-checking as well.

@jasongrout
Copy link
Contributor

Possibly relevant change in jinja: pallets/jinja#718

In other words, it seems that in jinja 2.9, tojson would render output that wasn't marked as safe, so presumably it would be further escaped.

@blink1073
Copy link
Member

Confirmed! I think we should just add the minimum jinja version and cut JupyterLab 1.0.7.

@haraldschilly
Copy link

I also found pallets/jinja#718 which is in 2.10: https://jinja.palletsprojects.com/en/2.10.x/changelog/

@jasongrout
Copy link
Contributor

Yep. That test that pallets/jinja#718 fixed looks exactly like our issue here.

@haraldschilly
Copy link

ah, we found the same, yes. good.

@blink1073
Copy link
Member

@OneRaynyDay had 2.9.6 as well. I think we're good.

@blink1073
Copy link
Member

(good thing we have that sweet issue template...)

@jasongrout
Copy link
Contributor

Thanks for debugging this with us, and giving such a clear report!

@haraldschilly
Copy link

sure, you're welcome

@blink1073
Copy link
Member

blink1073 commented Aug 20, 2019

@OneRaynyDay, short term fix is pip install --upgrade jinja2. We'll cut a 1.0.7 that requires jinja2 2.10+

@blink1073
Copy link
Member

Thanks for jumping in and providing all the feedback @haraldschilly!

@OneRaynyDay
Copy link
Contributor Author

Hi,
My apologies for not being present during your discussions(it was 3AM here). Thank you so much for the fix! I bumped down the version and the notebook rendered properly now. Cheers :)

@jasongrout
Copy link
Contributor

jasongrout commented Aug 20, 2019

it was 3AM here

Same here :)

I bumped down the version and the notebook rendered properly now

The real fix is upgrading jinja2 to 2.10 or later. The problem is a bug in jinja2 2.9.

@jasongrout jasongrout modified the milestones: 1.0.x, 1.1 Aug 28, 2019
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Sep 27, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Build System
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants