-
Notifications
You must be signed in to change notification settings - Fork 352
Description
Description
We have an extension for Jupyter that, among other things, configures the gateway_token_renewer_class value to be a class that we provide.
With the 2.7.3 release, this works perfectly. However, with the 2.8.0 release, this has stopped working.
I see that the token renewer class is being configured because I see a log message of the form:
[D 2023-10-18 13:21:34.339 ServerApp] Config changed: {'ExtensionApp': {'log_level': 'DEBUG'}, 'PasswordIdentityProvider': {'hashed_password': '<REDACTED>'}, 'DelegatingWebsocketConnection': {'kernel_ws_protocol': ''}, 'GatewayClient': {'auth_scheme': 'Bearer', 'headers': '{"Cookie": "_xsrf=XSRF", "X-XSRFToken": "XSRF"}', 'gateway_token_renewer_class': <class 'google.cloud.jupyter_config.tokenrenewer.CommandTokenRenewer'>, 'url': '<REDACTED>'}, 'CommandTokenRenewer': {'token_command': 'gcloud config config-helper --format="value(credential.access_token)"'}, 'NotebookApp': {}, 'ServerApp': {'log_level': 'DEBUG', 'password': '<REDACTED>', 'jpserver_extensions': <LazyConfigValue value={'jupyterlab': True, 'dataproc_jupyter_plugin': True, 'jupyter_lsp': True, 'jupyter_server_fileid': True, 'jupyter_server_terminals': True, 'jupyter_server_ydoc': True, 'nbclassic': True, 'notebook_shim': True}>, 'kernel_spec_manager_class': <class 'kernels_mixer.kernelspecs.MixingKernelSpecManager'>, 'kernel_manager_class': <class 'kernels_mixer.kernels.MixingMappingKernelManager'>, 'session_manager_class': <class 'jupyter_server.services.sessions.sessionmanager.SessionManager'>, 'kernel_websocket_connection_class': <class 'kernels_mixer.websockets.DelegatingWebsocketConnection'>}}
... however, the token renewer class is never being called. Specifically, when I add print statements to it for every call to the get_token
method, those print statements never show up in the log.
Reproduce
I can consistently reproduce this, but the reproduction steps require a Google account. I'll see if I can put together a smaller, more minimal repro, but what I have now is this:
- Install the
dataproc-jupyter-plugin
package from PyPI, along withjupyter_server==2.8.0
andjupyterlab==4.0.5
- Install the
gcloud
command line tool from the Google Cloud SDK. - Configure
gcloud
with credentials, a project, and region. - Launch jupyter lab.
- See a bunch of
HTTP 401: Unauthorized
errors in the logs because the token renewer is never being called.
Expected behavior
The expected behavior is what was seen with the 2.7.3
version; the above steps would work without any errors.