You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using traitlets (in a jupyter_lab_config.py file) the declared order of the urls to proxy is used when being turned in to url handlers inside the Tornado server 1.
But when using entry_points (in a python package) pkg_resources.iter_entry_points('jupyter_serverproxy_servers') is used to get the list of paths to proxy and this is sorted alphabetically by setuptools first 2.
This means that url handlers can mask each other and be unreachable, e.g. if the order declared is:
a/b/some/path/
a/b/
with entry_points the order returned will be:
a/b/
a/b/some/path/
and so the proxy to a/b/some/path/ cannot be reached.
As the list of entry_points is global to all installed packages this can be hard to track down.
A quick fix for this would be to reverse the results of pkg_resources.iter_entry_points('jupyter_serverproxy_servers') before using them, as these would be in an appropriate order for url routing.
In my particular case I wanted to proxy to my wiki server under my application root so that links from the app worked as expected, and was forced to use traitlets, with my users copy and pasting configs rather than being able to install a module.
The text was updated successfully, but these errors were encountered:
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋
Docs: https://jupyter-server-proxy.readthedocs.io/en/latest/server-process.html#specifying-config-via-traitlets
When using
traitlets
(in ajupyter_lab_config.py
file) the declared order of the urls to proxy is used when being turned in to url handlers inside the Tornado server 1.But when using
entry_points
(in a python package)pkg_resources.iter_entry_points('jupyter_serverproxy_servers')
is used to get the list of paths to proxy and this is sorted alphabetically bysetuptools
first 2.This means that url handlers can mask each other and be unreachable, e.g. if the order declared is:
with
entry_points
the order returned will be:and so the proxy to a/b/some/path/ cannot be reached.
As the list of
entry_points
is global to all installed packages this can be hard to track down.A quick fix for this would be to reverse the results of
pkg_resources.iter_entry_points('jupyter_serverproxy_servers')
before using them, as these would be in an appropriate order for url routing.In my particular case I wanted to proxy to my wiki server under my application root so that links from the app worked as expected, and was forced to use
traitlets
, with my users copy and pasting configs rather than being able to install a module.The text was updated successfully, but these errors were encountered: