Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove unnecessary copy method overload in MetaManager #206

Merged
merged 1 commit into from
Jun 15, 2024

Conversation

mahendrapaipuri
Copy link
Contributor

Copy Paste functionality is broken with the current 1.0.0 version. It seems to be due to unnecessary overloading of copy method in MetaManager.

2024-06-13 15:15:54,850 - ServerApp - ERROR - Uncaught exception POST /api/contents?1718284554848 (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='POST', uri='/api/contents?1718284554848', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "/home/paipuri/Documents/repos/jupyter/jupyterlab/.venv/lib/python3.11/site-packages/tornado/web.py", line 1790, in _execute
    result = await result
             ^^^^^^^^^^^^
  File "/home/paipuri/Documents/repos/jupyter/jupyterlab/.venv/lib/python3.11/site-packages/jupyter_server/auth/decorator.py", line 73, in inner
    return await out
           ^^^^^^^^^
  File "/home/paipuri/Documents/repos/jupyter/jupyterlab/.venv/lib/python3.11/site-packages/jupyter_server/services/contents/handlers.py", line 277, in post
    await self._copy(copy_from, path)
  File "/home/paipuri/Documents/repos/jupyter/jupyterlab/.venv/lib/python3.11/site-packages/jupyter_server/services/contents/handlers.py", line 217, in _copy
    validate_model(model)
  File "/home/paipuri/Documents/repos/jupyter/jupyterlab/.venv/lib/python3.11/site-packages/jupyter_server/services/contents/handlers.py", line 69, in validate_model
    missing = required_keys - set(model.keys())
                                  ^^^^^^^^^^
AttributeError: 'coroutine' object has no attribute 'keys'
[W 2024-06-13 15:15:54.851 ServerApp] wrote error: 'Unhandled error'
    Traceback (most recent call last):
      File "/home/paipuri/Documents/repos/jupyter/jupyterlab/.venv/lib/python3.11/site-packages/tornado/web.py", line 1790, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/home/paipuri/Documents/repos/jupyter/jupyterlab/.venv/lib/python3.11/site-packages/jupyter_server/auth/decorator.py", line 73, in inner
        return await out
               ^^^^^^^^^
      File "/home/paipuri/Documents/repos/jupyter/jupyterlab/.venv/lib/python3.11/site-packages/jupyter_server/services/contents/handlers.py", line 277, in post
        await self._copy(copy_from, path)
      File "/home/paipuri/Documents/repos/jupyter/jupyterlab/.venv/lib/python3.11/site-packages/jupyter_server/services/contents/handlers.py", line 217, in _copy
        validate_model(model)
      File "/home/paipuri/Documents/repos/jupyter/jupyterlab/.venv/lib/python3.11/site-packages/jupyter_server/services/contents/handlers.py", line 69, in validate_model
        missing = required_keys - set(model.keys())
                                      ^^^^^^^^^^
    AttributeError: 'coroutine' object has no attribute 'keys'
[E 2024-06-13 15:15:54.852 ServerApp] {
      "Host": "localhost:8888",
      "Accept": "*/*",
      "Referer": "http://localhost:8888/lab",
      "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0"
    }
[E 2024-06-13 15:15:54.852 ServerApp] 500 POST /api/contents?1718284554848 ([email protected]) 2.61ms referer=http://localhost:8888/lab
/home/paipuri/Documents/repos/jupyter/jupyterlab/.venv/lib/python3.11/site-packages/tornado/web.py:1801: RuntimeWarning: coroutine 'AsyncContentsManager.copy' was never awaited
  if self._prepared_future is not None and not self._prepared_future.done():
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

This PR fixes it by removing the overloaded method.

In MetaManagerShared, the sync argument for exists method is set to False which fails the jupyterfs when SyncMetaManager is used. The argument has been corrected and set to True.

Copy link

Binder Launch a binder notebook on branch mahendrapaipuri/jupyter-fs/fix_metamanager

* Correct `sync` arg to `True` in `MetaManagerShared` for `exists` method

Signed-off-by: Mahendra Paipuri <[email protected]>
@timkpaine timkpaine merged commit 7e7d6a4 into jpmorganchase:main Jun 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants