Closed Comee closed 3 years ago
the error looks like the server extension is not successfully installed. That's why you're seeing the 404. Would you be able to find any logs on your server to see why the server extension is not successfully activated?
server extension validating failed.
- Validating...
X is jupyterlab_hubshare importable?
jupyter-shaozl@xl-Standard-PC-i440FX-PIIX-1996:~$ sudo -E jupyter serverextension list
config dir: /opt/tljh/user/etc/jupyter
jupyter_lsp enabled
- Validating...
jupyter_lsp 1.1.4 OK
jupyter_server_proxy enabled
- Validating...
jupyter_server_proxy OK
jupyter_resource_usage enabled
- Validating...
jupyter_resource_usage OK
jupyterlab enabled
- Validating...
jupyterlab 3.0.14 OK
jupyterlab_git enabled
- Validating...
jupyterlab_git 0.30.0 OK
nbdime enabled
- Validating...
nbdime 3.0.0 OK
nbgitpuller enabled
- Validating...
nbgitpuller 0.9.0 OK
nteract_on_jupyter enabled
- Validating...
nteract_on_jupyter 2.1.3 OK
jupyter_nbextensions_configurator enabled
- Validating...
jupyter_nbextensions_configurator 0.4.1 OK
jupyterlab_hubshare enabled
- Validating...
X is jupyterlab_hubshare importable?
jupyter-shaozl@xl-Standard-PC-i440FX-PIIX-1996:~$
After this method
I added follow line, then it worked
# For backward compatibility
load_jupyter_server_extension = _load_jupyter_server_extension
before (not work in TLJH)
from .handlers import setup_handlers
import json
from pathlib import Path
from ._version import __version__ # noqa
HERE = Path(__file__).parent.resolve()
with (HERE / "labextension" / "package.json").open() as fid:
data = json.load(fid)
def _jupyter_labextension_paths():
return [{"src": "labextension", "dest": data["name"]}]
def _jupyter_server_extension_points():
return [{"module": "jupyterlab_hubshare"}]
def _load_jupyter_server_extension(server_app):
"""Registers the API handler to receive HTTP requests from the frontend extension.
Parameters
----------
server_app: jupyterlab.labapp.LabApp
JupyterLab application instance
"""
setup_handlers(server_app.web_app)
server_app.log.info(
"Registered Jupytelab_hubshare extension at URL path /jupyterlab_hubshare"
)
after (work in TLJH)
from .handlers import setup_handlers
import json
from pathlib import Path
from ._version import __version__ # noqa
HERE = Path(__file__).parent.resolve()
with (HERE / "labextension" / "package.json").open() as fid:
data = json.load(fid)
def _jupyter_labextension_paths():
return [{"src": "labextension", "dest": data["name"]}]
def _jupyter_server_extension_points():
return [{"module": "jupyterlab_hubshare"}]
def _load_jupyter_server_extension(server_app):
"""Registers the API handler to receive HTTP requests from the frontend extension.
Parameters
----------
server_app: jupyterlab.labapp.LabApp
JupyterLab application instance
"""
setup_handlers(server_app.web_app)
server_app.log.info(
"Registered Jupytelab_hubshare extension at URL path /jupyterlab_hubshare"
)
# For backward compatibility
load_jupyter_server_extension = _load_jupyter_server_extension
ah thanks! would you mind send a pull request directly?
config this extension using case 2: User have their own work space but can still access others workspace