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

Send to jupyter failed #20

Open
chenboshuo opened this issue May 6, 2023 · 3 comments
Open

Send to jupyter failed #20

chenboshuo opened this issue May 6, 2023 · 3 comments

Comments

@chenboshuo
Copy link

The log of jupyter is

Either a properly named notebook (ending in .sync.ipynb) is not running, or it didn't register properly for some reason.
{"jsonrpc": "2.0", "result": {"success": false, "error": "Unable to find a paired notebook for /tmp/temp_downloads/try.sync.py in registered notebooks: {}.\nEither a properly named notebook (ending in .sync.ipynb) is not running, or it didn't register properly for some reason."}, "id": 1}

And I check the .sync.ipynbexist
Could you tell me how to handle it, Thank you for your attention.

@chenboshuo
Copy link
Author

And the content from /tmp/jupyter_ascending/log.log is

> File "/home/cbs/anaconda3/lib/python3.9/site-packages/jupyter_ascending/requests/sync.py", line 36, in <module>
    send(arguments.filename)
    │    │         └ '/tmp/temp_downloads/try.sync.py'
    │    └ Namespace(filename='/tmp/temp_downloads/try.sync.py')
    └ <function send at 0x7fb85e31b430>
  File "/home/cbs/anaconda3/lib/python3.9/site-packages/jupyter_ascending/requests/sync.py", line 24, in send
    request_notebook_command(request_obj)
    │                        └ SyncRequest(file_name='/tmp/temp_downloads/try.sync.py', contents='# ---\n# jupyter:\n#   jupytext:\n#     formats: ipynb,py:...
    └ <function request_notebook_command at 0x7fb85e31b3a0>
  File "/home/cbs/anaconda3/lib/python3.9/site-packages/jupyter_ascending/requests/client_lib.py", line 36, in request_notebook_command
    raise RequestFailure(
          └ <class 'jupyter_ascending.requests.client_lib.RequestFailure'>

jupyter_ascending.requests.client_lib.RequestFailure: Connection to server successful, but got error message from server: Unable to find a paired notebook for /tmp/temp_downloads/try.sync.py in registered notebooks: {}.
Either a properly named notebook (ending in .sync.ipynb) is not running, or it didn't register properly for some reason.

@joshalbrecht
Copy link
Contributor

Are there any other errors or warnings earlier in the server log?

You should see the output as a result of this line above in the log, assuming logging is configured:

logger.info("IPYTHON: Registering notebook {}", notebook_path)

Could you copy that line here? (the name of the notebook on the remote and local machine need to line up)

@LioSergent
Copy link

LioSergent commented Oct 11, 2023

Got a similar error and corrected the problem by changing the way jupytext organizes files.
I had a jupytext config containing:

[formats]
"notebooks/" = "ipynb"
"scripts/" = "py:percent"

which meant the name.sync.ipynb and name.sync.py were not in the same folder.

I switched it back to the more classic

formats = "ipynb,py:percent"

and it now works

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

No branches or pull requests

3 participants