vscode: Cannot Save Jupyter Notebook on SSH Disconnect

Applies To

  • Notebooks (.ipynb files)

What happened?

When the connection to my remote development server disconnects, I sometimes have unsaved changes that need to be saved locally before reloading the window so I don’t lose work. However, I can’t seem to save locally. File > Save As produces an error: Failed to save '<>.ipynb': NO provider registered for view type: 'jupyter-notebook'

The closest related issue I could find was this which is related to code server and requires the user to apparently open a folder before attempting to save. If my issue is similar, it may indicate that the jupyter-notebook viewer needs the local folder I’m saving to already open in the Workspace, which isn’t good because I can’t add the local location.

I really just need a way to export files when the SSH session crashes and the window needs reloading. For now I have to copy all the cells into a new local file and hope that diff can help me sort out the unsaved changes…

UPDATE: On checking extension version, returning to the notebook’s tab showed that the Jupyter extension was no longer active (hence the command viewOutput not found below), so I had to open the file as text and use that to save a local copy. Maybe my problem is that the jupyter extension gets unloaded when the SSH session crashes so I can’t even save files anymore. That’s an issue for ensuring work can be saved despite (possibly unstable) remote connections…

VS Code Version

1.83.0

Jupyter Extension Version

v2023.9.1102792234

Jupyter logs

command 'jupyter.viewOutput' not found

Coding Language and Runtime Version

Python

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 19
  • Comments: 18

Most upvoted comments

It has not been an issue for me for years. I could rely on VSCode at connections dropping on and off, even if I switched networks progress was preserved locally and could be committed to the remote server once connection restored.

Since the last update (v1.101, jupyter extension: 2025.5.0), however, it is an everyday issue with a loss of work. Sometimes even work that I believe I have saved was not committed over the network. I have to keep my fingers on CTRL+s, and hope for the best.

Not sure how to troubleshoot this, it would be very helpful if we could get some support.

For anyone stumbling here later, saving as a txt file does not work. vscode points out that

Failed to save '***.ipynb': File name ***.txt is not supported by .ipynb Support.

Please make sure the file name matches following patterns:
*.ipynb

None of the export options worked for me, except to manually copy-paste cells I cared about more, or thought had changes.

This affects me too and is a major nuisance. Saving as txt or as a separate file does not work, as mentioned above. Most of the time, file contents are lost.

I have also encountered this issue. In general working over ssh can be very frustrating, especially when dealing with a spotty internet connection or otherwise dealing with the ssh connection dropping.

Any progress on this? I’ve lost data a few times now because of this.

This issue still persists and I am even unable to view the .ipynb file (to copy cell content which I believe has changed). I would appreciate if the maintainers could work on a fix.