jupyterlab/jupyter-collaboration

Error with depreciated function get_current_user()

TEDmk opened this issue · 3 comments

Description

When I try to access a notebook I have the following error in jupyter lab:

[E 2024-02-19 10:13:10.007 ServerApp] Uncaught exception GET /user/my_group/api/collaboration/room/json:notebook:7f5ce389-adce-4aa7-ba24-da30cb9a1f51?sessionId=0449e2b0-8749-42a3-ab00-c5583123856d (::ffff:1.2.3.4)
    HTTPServerRequest(protocol='http', host='abc.com', method='GET', uri='/user/my_group/api/collaboration/room/json:notebook:7f5ce389-adce-4aa7-ba24-da30cb9a1f51?sessionId=0449e2b0-8749-42a3-ab00-c5583123856d', version='HTTP/1.1', remote_ip='::ffff:1.2.3.4')
    Traceback (most recent call last):
      File "/home/xxxx/.local/lib/python3.10/site-packages/tornado/web.py", line 1765, in _execute
        result = await result  # type: ignore
      File "/home/xxxx/.local/lib/python3.10/site-packages/jupyter_collaboration/handlers.py", line 105, in prepare
        await self._websocket_server.start_room(self.room)
      File "/home/xxxx/.local/lib/python3.10/site-packages/pycrdt_websocket/websocket_server.py", line 88, in start_room
        await self._task_group.start(room.start)
      File "/home/xxxx/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 758, in start
        task = self._spawn(func, args, name, future)
      File "/home/xxxx/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 717, in _spawn
        raise RuntimeError(
    RuntimeError: This task group is not active; no new tasks can be started.
[E 2024-02-19 10:13:10.008 ServerApp] Uncaught exception in write_error
    Traceback (most recent call last):
      File "/home/xxxx/.local/lib/python3.10/site-packages/tornado/web.py", line 1765, in _execute
        result = await result  # type: ignore
      File "/home/xxxx/.local/lib/python3.10/site-packages/jupyter_collaboration/handlers.py", line 105, in prepare
        await self._websocket_server.start_room(self.room)
      File "/home/xxxx/.local/lib/python3.10/site-packages/pycrdt_websocket/websocket_server.py", line 88, in start_room
        await self._task_group.start(room.start)
      File "/home/xxxx/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 758, in start
        task = self._spawn(func, args, name, future)
      File "/home/xxxx/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 717, in _spawn
        raise RuntimeError(
    RuntimeError: This task group is not active; no new tasks can be started.
   
    During handling of the above exception, another exception occurred:
   
    Traceback (most recent call last):
      File "/home/xxxx/.local/lib/python3.10/site-packages/tornado/web.py", line 1294, in send_error
        self.write_error(status_code, **kwargs)
      File "/home/xxxx/.local/lib/python3.10/site-packages/jupyter_server/base/handlers.py", line 711, in write_error
        html = self.render_template("%s.html" % status_code, **ns)
      File "/home/xxxx/.local/lib/python3.10/site-packages/jupyter_server/base/handlers.py", line 637, in render_template
        ns.update(self.template_namespace)
      File "/home/xxxx/.local/lib/python3.10/site-packages/jupyter_server/base/handlers.py", line 647, in template_namespace
        logged_in=self.logged_in,
      File "/home/xxxx/.local/lib/python3.10/site-packages/jupyter_server/base/handlers.py", line 186, in logged_in
        user = self.current_user
      File "/home/xxxx/.local/lib/python3.10/site-packages/tornado/web.py", line 1420, in current_user
        self._current_user = self.get_current_user()
      File "/home/xxxx/.local/lib/python3.10/site-packages/jupyter_server/base/handlers.py", line 165, in get_current_user
        raise RuntimeError(msg)
    RuntimeError: Calling `YDocWebSocketHandler.get_current_user()` directly is deprecated in jupyter-server 2.0. Use `self.current_user` instead (works in all versions).

Reproduce

I use python 3.10 with the following pip freeze:

aiosqlite==0.19.0
alembic==1.13.1
anyio==4.3.0
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-generator==1.10
async-lru==2.0.4 
attrs==23.2.0
Babel==2.14.0
backcall==0.2.0
beautifulsoup4==4.12.3
bleach==6.1.0
certifi==2024.2.2
certipy==0.1.3
cffi==1.16.0
charset-normalizer==3.3.2
colorama==0.4.6
comm==0.2.1
cryptography==42.0.3
debugpy==1.8.1
decorator==5.1.1
defusedxml==0.7.1
exceptiongroup==1.2.0
executing==2.0.1
fastjsonschema==2.19.1
fqdn==1.5.1
gitdb==4.0.11
GitPython==3.1.42
greenlet==3.0.3
h11==0.14.0
httpcore==1.0.3
httpx==0.26.0
idna==3.6
importlib-metadata==7.0.1
importlib-resources==6.1.1
ipykernel==6.29.2
ipython==8.12.3
isoduration==20.11.0
jedi==0.19.1
Jinja2==3.1.3
json5==0.9.14
jsonpointer==2.4
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
jupyter-events==0.9.0
jupyter-lsp==2.2.2
jupyter-server-mathjax==0.2.6
jupyter-telemetry==0.1.0
jupyter-ydoc==2.0.1
jupyter_client==8.6.0
jupyter_collaboration==2.0.2
jupyter_core==5.7.1
jupyter_server==2.12.5
jupyter_server_fileid==0.9.1
jupyter_server_terminals==0.5.2
jupyterhub==4.0.2
jupyterlab==4.1.1
jupyterlab_git==0.50.0
jupyterlab_pygments==0.3.0
jupyterlab_server==2.25.3
Mako==1.3.2
MarkupSafe==2.1.5
matplotlib-inline==0.1.6
mistune==3.0.2
nbclient==0.9.0
nbconvert==7.16.0
nbdime==4.0.1
nbformat==5.9.2
nest-asyncio==1.6.0
notebook_shim==0.2.4
oauthlib==3.2.2
overrides==7.7.0
packaging==23.2
pamela==1.1.0
pandocfilters==1.5.1
parso==0.8.3
pexpect==4.9.0
pickleshare==0.7.5
pkgutil_resolve_name==1.3.10
platformdirs==4.2.0
prometheus_client==0.20.0
prompt-toolkit==3.0.43
psutil==5.9.8
ptyprocess==0.7.0
pure-eval==0.2.2
pycparser==2.21
pycrdt==0.8.11
pycrdt-websocket==0.12.7
Pygments==2.17.2
pyOpenSSL==24.0.0
python-dateutil==2.8.2
python-json-logger==2.0.7
pytz==2024.1
PyYAML==6.0.1
pyzmq==25.1.2
referencing==0.33.0
requests==2.31.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.18.0
ruamel.yaml==0.18.6
ruamel.yaml.clib==0.2.8
Send2Trash==1.8.2
six==1.16.0
smmap==5.0.1
sniffio==1.3.0
soupsieve==2.5
SQLAlchemy==2.0.27
stack-data==0.6.3
terminado==0.18.0
tinycss2==1.2.1
tomli==2.0.1
tornado==6.4
traitlets==5.14.1
types-python-dateutil==2.8.19.20240106
typing_extensions==4.9.0
uri-template==1.3.0
urllib3==1.26.18
wcwidth==0.2.13
webcolors==1.13
webencodings==0.5.1
websocket-client==1.7.0
zipp==3.17.0

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.
welcome
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! 👋

Welcome to the Jupyter community! 🎉

@TEDmk Did you figure out your issue?

I also get this issue. Is there a fix?