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

Unable to open Notebook without metadata #165

Open
martinRenou opened this issue May 4, 2023 · 8 comments
Open

Unable to open Notebook without metadata #165

martinRenou opened this issue May 4, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@martinRenou
Copy link
Contributor

Description

I am getting the following:

    Traceback (most recent call last):
      File "/home/martinrenou/micromamba/envs/glue-lab/lib/python3.11/site-packages/tornado/websocket.py", line 944, in _accept_connection
        await open_result
      File "/home/martinrenou/micromamba/envs/glue-lab/lib/python3.11/site-packages/jupyter_collaboration/handlers.py", line 236, in open
        if self.room.document.source != model["content"]:
           ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/martinrenou/micromamba/envs/glue-lab/lib/python3.11/site-packages/jupyter_ydoc/ybasedoc.py", line 60, in source
        return self.get()
               ^^^^^^^^^^
      File "/home/martinrenou/micromamba/envs/glue-lab/lib/python3.11/site-packages/jupyter_ydoc/ynotebook.py", line 213, in get
        metadata=meta["metadata"],
                 ~~~~^^^^^^^^^^^^
    KeyError: 'metadata'

Leading to not being able to open the Notebook (it's an empty area on Jupyterlab)

@martinRenou martinRenou added the bug Something isn't working label May 4, 2023
@welcome
Copy link

welcome bot commented May 4, 2023

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! 🎉

@fcollonval
Copy link
Member

@martinRenou
Copy link
Contributor Author

It's unclear to me as to why I ended up with this invalid Notebook though

@hbcarlos
Copy link
Contributor

hbcarlos commented May 4, 2023

Hi @martinRenou. What version of jupyter_ydoc are you using?

In theory, this was fixed in #158

@martinRenou
Copy link
Contributor Author

I'm using 1.0.2

@fcollonval
Copy link
Member

Did you played with your local installation? The reported line number in the error is not consistent with the code.

Line 213 of ynotebook at v1.0.2 is:

Metadata query is at line 223 in v1.0.2:

metadata=meta.get("metadata", {}),

Could you try forcing a re installation?

@martinRenou
Copy link
Contributor Author

Indeed 🤔

code /home/martinrenou/micromamba/envs/glue-lab/lib/python3.11/site-packages/jupyter_ydoc/ynotebook.py

gives me

Screenshot from 2023-05-04 17-19-21

So I'd say the traceback is lying!

@fcollonval
Copy link
Member

You may be trolled by inconsistent byte-code version. Do you get .pyc files for ynotebook.py. If so you could give a try of removing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants