This extension doesn't have any static paths listed

It happens to me in FreeBSD 14.1.

I have among other packages the following:

evcxr-jupyter-0.17.0_3 Jupyter Evaluation Context for Rust
py39-jupyter-client-8.6.1 Jupyter protocol implementation and client libraries
py39-jupyter-core-5.7.2 Jupyter core package
py39-jupyter-events-0.10.0 Jupyter Event System library
py39-jupyter-lsp-2.2.4 Multi-Language Server WebSocket proxy for Jupyter Notebook/Lab server
py39-jupyter-server-2.13.0 The backend to Jupyter web applications
py39-jupyter-server-terminals-0.5.3 Jupyter Server Extension Providing Terminals
py39-jupyter_console-6.6.3 IPython-like terminal frontend for Jupyter kernels in any language
py39-jupyterlab-4.1.5 JupyterLab server extension
py39-jupyterlab-pygments-0.3.0 Pygments theme using JupyterLab CSS variables
py39-jupyterlab-server-2.25.4 JupyterLab Server
py39-jupyterlab_launcher-0.13.1_3 Jupyter Launcher (launcher for the JupiterLab environment)

In addition jupyterhub does not install as a package, but from pip.

If I run jupyterhub in this way everything works fine:

/usr/local/bin/jupyterhub --ip 172.16.0.80 -f /usr/local/etc/jupyterhub/jupyterhub_config.py --pid-file /var/run/jupyterhub.pid &

I can open a terminal without problem, but if I do so (the log will be redirected to the file), it fails:

/usr/local/bin/jupyterhub --ip 172.16.0.80 -f /usr/local/etc/jupyterhub/jupyterhub_config.py --pid-file /var/run/jupyterhub.pid >> /var/log/jupyterhub.log 2>&1

When I open the terminal at browser, give this paths error:

[W 2024-06-12 10:26:34.354 ServerApp] Skipping XSRF check for insecure request GET /user/jose/terminals/websocket/1
[E 2024-06-12 10:26:34.382 ServerApp] Uncaught exception in write_error
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/tornado/web.py”, line 1294, in send_error
self.write_error(status_code, **kwargs)
File “/usr/local/lib/python3.9/site-packages/jupyter_server/base/handlers.py”, line 738, in write_error
html = self.render_template(“%s.html” % status_code, **ns)
File “/usr/local/lib/python3.9/site-packages/jupyter_server/base/handlers.py”, line 666, in render_template
return template.render(**ns)
File “/usr/local/lib/python3.9/site-packages/jinja2/environment.py”, line 1301, in render
self.environment.handle_exception()
File “/usr/local/lib/python3.9/site-packages/jinja2/environment.py”, line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File “/usr/local/lib/python3.9/site-packages/jupyter_server/templates/404.html”, line 1, in top-level template code
{% extends “error.html” %}
File “/usr/local/lib/python3.9/site-packages/jupyter_server/templates/error.html”, line 1, in top-level template code
{% extends “page.html” %}
File “/usr/local/lib/python3.9/site-packages/jupyter_server/templates/page.html”, line 9, in top-level template code
{% block favicon %}<link id=“favicon” rel=“shortcut icon” type=“image/x-icon” href=“{{ static_url(“favicon.ico”) }}”>
File “/usr/local/lib/python3.9/site-packages/jupyter_server/templates/page.html”, line 9, in block ‘favicon’
{% block favicon %}<link id=“favicon” rel=“shortcut icon” type=“image/x-icon” href=“{{ static_url(“favicon.ico”) }}”>
File “/usr/local/lib/python3.9/site-packages/jupyter_server/extension/handler.py”, line 117, in static_url
raise Exception(msg) from None
Exception: This extension doesn’t have any static paths listed. Check that the extension’s static_paths trait is set.
[W 2024-06-12 10:26:34.386 ServerApp] 404 GET /user/jose/terminals/websocket/1

The same happens if I run it with nohup or daemon. Any ideas

Jose

Is this terminal in your singleuser server (jupyter lab/notebook?). Do you have the same problem if you launch JjpyerLAb/Notebook directly, not via JupyterHub?

Hi @manics
If I run as user:

jupyter-lab --ip 172.16.0.80 --port 8000 &

it works fine, I can open the terminal from the browser, but if I run:

nohup jupyter-lab --ip 172.16.0.80 --port 8000 &

it gives me an error already commented:

[E 2024-06-25 14:25:30.919 ServerApp] Uncaught exception in write_error
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/tornado/web.py”, line 1294, in send_error
self.write_error(status_code, **kwargs)
File “/usr/local/lib/python3.9/site-packages/jupyter_server/base/handlers.py”, line 738, in write_error
html = self.render_template(“%s.html” % status_code, **ns)
File “/usr/local/lib/python3.9/site-packages/jupyter_server/base/handlers.py”, line 666, in render_template
return template.render(**ns)
File “/usr/local/lib/python3.9/site-packages/jinja2/environment.py”, line 1301, in render
self.environment.handle_exception()
File “/usr/local/lib/python3.9/site-packages/jinja2/environment.py”, line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File “/usr/local/lib/python3.9/site-packages/jupyter_server/templates/404.html”, line 1, in top-level template code
{% extends “error.html” %}
File “/usr/local/lib/python3.9/site-packages/jupyter_server/templates/error.html”, line 1, in top-level template code
{% extends “page.html” %}
File “/usr/local/lib/python3.9/site-packages/jupyter_server/templates/page.html”, line 9, in top-level template code
{% block favicon %}<link id=“favicon” rel=“shortcut icon” type=“image/x-icon” href=“{{ static_url(“favicon.ico”) }}”>
File “/usr/local/lib/python3.9/site-packages/jupyter_server/templates/page.html”, line 9, in block ‘favicon’
{% block favicon %}<link id=“favicon” rel=“shortcut icon” type=“image/x-icon” href=“{{ static_url(“favicon.ico”) }}”>
File “/usr/local/lib/python3.9/site-packages/jupyter_server/extension/handler.py”, line 117, in static_url
raise Exception(msg) from None
Exception: This extension doesn’t have any static paths listed. Check that the extension’s static_paths trait is set.

nohup jupyter-lab works fine for me in Linux (Python 3.11, jupyter-server 2.14.1, jupyterlab 4.2.2). Do you know if nohup behaves differently on FreeBSD?

I do not know if there are diet between the Linux and FreeBSD version, but analyzing what happens, it occurs to me that the problem is in the redirection of the out log. nohup redirects the log to nohup.out, at least in FreeBSD.

These two commands make it fail to open the terminal at the browser
nohup jupyter-lab &
and
jupyter-lab > ~/mylog.log

Can you try the last command?

Except for the terminal everything else OK works. I have notebook and consoles for Python, Julia and Rust without problems

I suspect the redirection is somehow causing the terminals to fail to start. Can you launch with --debug and share more of the log context before the error message?

The error message is a bit of a red herring (it is a bug in Jupyter Server failing to serve a 404 page.

But the 404 is likely caused by the terminal stopping as soon as it started, i.e. something like:

  1. start terminal
  2. terminal stops right away
  3. connect to terminal → 404, no such terminal!

Can you try the last command?

I did on macOS, and on FreeBSD 13.1. I do not see any problems with the terminals. nohup jupyter lab also works fine for me on FreeBSD.

But I can occasionally see that error message in the logs when restarting the server, because the JupyterLab UI may try to connect to the previous terminal instance after server restart. Refreshing the page makes it go away and everything is fine, as does closing the terminal tab pointing to a defunct terminal. Are you seeing errors in JupyterLab where the terminal actually doesn’t work, or just these log messages?

1 Like

I was reviewing and what I find is that when I execute Jupyter in a real or virtual machine with the redirection or nohup works fine. In my case, I think I didn’t say it before, it is running in a jail where I am redirecting port 8000

# bastille rdr jupyter tcp 8000 8000
# bastille rdr jupyter list

rdr pass on em0 inet proto tcp from any to any port = 8888 → 10.1.1.32 port 8888

Except for the terminal, everything else works fine

Are you seeing errors in JupyterLab where the terminal actually doesn’t work, or just these log messages?