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
Comments
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:
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? |
@OneRaynyDay since your ticket was just 10 hours old when I saw it, I tried to rollback. Indeed, |
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 |
In the environment I was just working with, I've right now:
|
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? |
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 |
@haraldschilly, are you able to set a break point in the |
@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 |
@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
the file content looks fine, i.e.
|
Thanks @haraldschilly, I can use that to recreate your setup locally. |
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? |
Okay, with no changes applied other than injecting the new 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, … } |
hmm, I can try to render a basic |
The above works in Firefox and Chrome (all I have right now on my Linux machine). |
I have jinja 2.10.1 locally. |
👍 :) |
ok, we have some progress. I ran
and that unbreaks it!!! |
I'm trying the reverse now... |
yes, I'm currently double-checking as well. |
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. |
Confirmed! I think we should just add the minimum jinja version and cut JupyterLab 1.0.7. |
I also found pallets/jinja#718 which is in 2.10: https://jinja.palletsprojects.com/en/2.10.x/changelog/ |
Yep. That test that pallets/jinja#718 fixed looks exactly like our issue here. |
ah, we found the same, yes. good. |
@OneRaynyDay had |
(good thing we have that sweet issue template...) |
Thanks for debugging this with us, and giving such a clear report! |
sure, you're welcome |
@OneRaynyDay, short term fix is |
Thanks for jumping in and providing all the feedback @haraldschilly! |
Hi, |
Same here :)
The real fix is upgrading jinja2 to 2.10 or later. The problem is a bug in jinja2 2.9. |
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:
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:
Expected behavior
See the jupyterlab IDE look upon accessing
/lab
urlContext
Chrome:
Troubleshoot Output
Browser Output
The text was updated successfully, but these errors were encountered: