Unfortunately this Issue appears in ~50% of sessions, but of course this is frequent enough to prevent use of Notebook development in VS Code (with the Notebook Editor) on my machine.
Interestingly, the problem seems to correlate with the Notebook Editor mistakenly opening multiple windows of the same file in step 1, if opening directly from the VS Code Explorer. In ~50% of VS Code sessions, I observe this behavior (multiple Notebook Editor windows even though I opened the file "once"). If this happens, my inability to save occurs ~100% of the time...
In this case:
Example:


_Please provide as much info as you readily know_
Extension|Author (truncated)|Version
---|---|---
remote-containers|ms-|0.122.1
remote-ssh|ms-|0.51.0
remote-ssh-edit|ms-|0.51.0
remote-wsl|ms-|0.44.4
vscode-remote-extensionpack|ms-|0.20.0
gitlens|eam|10.2.2
python|ms-|2020.6.89148
Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl
Please could u check the error logs and provide the output from the developer tools console output.
This happened to me today, and I am able to reproduce using the second method provided (on Ubuntu 20.04, VS Code 1.46.1).
Here is a partial output of the developer console. The notebook that could not be saved was 'word2vec.ipynb'.
[Extension Host] Info Python Extension: 2020-06-26 00:42:09: Loading colors from /usr/share/code/resources/app/extensions/theme-defaults/themes/dark_plus.json ...
console.ts:137
[Extension Host] Info Python Extension: 2020-06-26 00:42:09: Cached data exists getEnvironmentVariables, /home/<path-removed>/word2vec.ipynb
2console.ts:137
[Extension Host] Info Python Extension: 2020-06-26 00:42:09: Attempting search for colors ...
2console.ts:137
[Extension Host] Info Python Extension: 2020-06-26 00:42:09: Loading base colors from /usr/share/code/resources/app/extensions/theme-defaults/themes/dark_plus.json ...
6console.ts:137
[Extension Host] Info Python Extension: 2020-06-26 00:42:09: Attempting search for colors ...
6console.ts:137
[Extension Host] Info Python Extension: 2020-06-26 00:42:09: Loading base colors from /usr/share/code/resources/app/extensions/theme-defaults/themes/dark_plus.json ...
8console.ts:137
[Extension Host] Info Python Extension: 2020-06-26 00:42:09: Using colors to generate CSS ...
webviewElement.ts:331
[Embedded Page] Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq
webviewElement.ts:331
[Embedded Page] Failed to construct 'Worker': Script at 'vscode-resource://file///home/<path-removed>/editor.worker.js' cannot be accessed from origin 'null'.
4console.ts:137
[Extension Host] Info Python Extension: 2020-06-26 00:42:13: Cached data exists getEnvironmentVariables, /home/<path-removed>/word2vec.ipynb
console.ts:137
[Extension Host] Info Python Extension: 2020-06-26 00:46:17: Cached data exists getEnvironmentVariables, Untitled-1
Would be great to have this fixed, lost a few hours of work today :/
More info: the following warnings appear whenever new characters are typed into the 'stuck' notebook. (don't appear on notebooks that can be saved).
5console.ts:137 [Extension Host] Info Python Extension: 2020-06-26 00:52:20: Cached data exists getEnvironmentVariables, /home/<path-removed>/word2vec.ipynb
2console.ts:137 [Extension Host] Info Python Extension: 2020-06-26 00:52:21: Cached data exists getEnvironmentVariables, /home/<path-removed>/word2vec.ipynb
2console.ts:137 [Extension Host] Info Python Extension: 2020-06-26 00:52:22: Cached data exists getEnvironmentVariables, /home/<path-removed>/word2vec.ipynb
I agree with @thomasbbrunner's observations
nterestingly, the problem seems to correlate with the Notebook Editor mistakenly opening multiple windows of the same file in step 1, if opening directly from the VS Code Explorer.
I missed this. Unfortunately our current editor implementations do not support opening an ipynb file multiple files.
How did you manage to open multiple copies of the same file, please could you repro that.
Resolving that should fix the saving issue.
Open a pre-existing Jupyter notebook (any .ipynb file; as indicated open within WSL. I am running Ubuntu-18.04).
What are the exact steps that led you to having two editors opened for the same file.
If you are interested in opening the same notebook multiple times, that is being tracked here microsoft/vscode-python#10496 (by using a completely new editor for notebooks in the extension, with a number of other fixes/features).
Here is a partial output of the developer console
@thomasbbrunner
Please could you provide the complete log.
& do you also have mutliple copies of the same ipynb opened, if not please could you file a separate issue.
When I single-click on a notebook in the explorer, two different tabs open, each with an instance of the notebook. Sometimes if I close one (unclear if they are different) it breaks the kernel for the other. Log file is attached. This is a file that sometimes I have been unable in the notebook to save via the save button, command-s, or any other method. [log.txt](https://github.com/microsoft/vscode-python/files/4885805/log.txt
When I single-click on a notebook in the explorer, two different tabs open
This sounds like a result of the python extension loading. A workaround for that would be to open a python file first. That should cause only a single file to open.
I'm going to enter a separate bug for two tabs opening. That shouldn't be happening.
https://github.com/microsoft/vscode-python/issues/12787
I have the same problem. My setting ist that I run jupyter notebooks on a remote linux server. They notebooks are stored on the server too. I connect to the server using the vscode remote SSH extension at version 0.51.0.
The jupyter notebook server is running on the same linux machine in a docker container.
VSCode Info:
Remote OS: Ubuntu 18.04.4 LTS
python version on the remote machine: 3.6.9
Extensions on the remote machine:
The problems I had were only in context with jupyter notebooks created using the jupyter notebook browser interface. Notebooks created using vscode didn't have the problems so far.
The behaviour I had (only on the notebooks created with the browser interface):
test.ipynb which I already had deleted half an hour before. I found a file called afb6f322.ipynb in the folder ~/.vscode-server/data/User/globalStorage/ms-python.python that contains the content of test.ipynb so I think thats why the deleted file could get restored and openend. This was the console log:console.ts:137 [Extension Host] (node:2852) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ console.ts:137
searchService.ts:217 No search provider registered for scheme: vscode-remote, waiting
(anonymous) @ searchService.ts:217
console.ts:137 [Extension Host] (node:40631) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ console.ts:137
console.ts:137 [Extension Host] Error Python Extension: 2020-07-09 14:47:47: Failed to load notebook file file:///<path-remove>/test.ipynb [EntryNotFound (FileSystemError): Unable to read file 'vscode-remote://ssh-remote+<path-removed>/test.ipynb' (EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, open '<path-removed>/test.ipynb') at _handleError (/home/<removed>/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d/out/vs/server/remoteExtensionHostProcess.js:687:25) at processTicksAndRejections (internal/process/task_queues.js:89:5) at async v.readText (/home/<removed>/.vscode-server/extensions/ms-python.python-2020.6.91350/out/client/extension.js:1:589368) at async r.loadFromFile (/home/<removed>/.vscode-server/extensions/ms-python.python-2020.6.91350/out/client/extension.js:1:477764) at async b.loadModel (/home/<removed>/.vscode-server/extensions/ms-python.python-2020.6.91350/out/client/extension.js:24:456508) at async b.createNotebookEditor (/home/<removed>/.vscode-server/extensions/ms-python.python-2020.6.91350/out/client/extension.js:24:456611) at async b.create (/home/<removed>/.vscode-server/extensions/ms-python.python-2020.6.91350/out/client/extension.js:48:310511) at async b.open (/home/<removed>/.vscode-server/extensions/ms-python.python-2020.6.91350/out/client/extension.js:48:309468)] { code: 'FileNotFound', name: 'EntryNotFound (FileSystemError)'}
t.log @ console.ts:137
2console.ts:137 [Extension Host] Warn Python Extension: 2020-07-09 14:47:47: startHttpServer=false, will not be used. Temporarily turned off
t.log @ console.ts:137
console.ts:137 [Extension Host] Error Python Extension: 2020-07-09 14:47:47: Failed to check if file needs to be fixed [EntryNotFound (FileSystemError): Unable to read file 'vscode-remote://ssh-remote+<path removed>/home/<removed>/.config/Code/User/settings.json' (EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, open '/home/<removed>/.config/Code/User/settings.json') at _handleError (/home/<removed>/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d/out/vs/server/remoteExtensionHostProcess.js:687:25) at processTicksAndRejections (internal/process/task_queues.js:89:5) at async v.readText (/home/<removed>/.vscode-server/extensions/ms-python.python-2020.6.91350/out/client/extension.js:1:589368) at async p.doesFileNeedToBeFixed (/home/<removed>/.vscode-server/extensions/ms-python.python-2020.6.91350/out/client/extension.js:48:901511) at async /home/<removed>/.vscode-server/extensions/ms-python.python-2020.6.91350/out/client/extension.js:48:900638 at async Promise.all (index 0) at async p.getFilesToBeFixed (/home/<removed>/.vscode-server/extensions/ms-python.python-2020.6.91350/out/client/extension.js:48:900584) at async p.updateTestSettings (/home/<removed>/.vscode-server/extensions/ms-python.python-2020.6.91350/out/client/extension.js:48:900211)] { code: 'FileNotFound', name: 'EntryNotFound (FileSystemError)'}
t.log @ console.ts:137
console.ts:137 [Extension Host] Warn Python Extension: 2020-07-09 14:47:48: startHttpServer=false, will not be used. Temporarily turned off
t.log @ console.ts:137
2console.ts:137 [Extension Host] Warn Python Extension: 2020-07-09 14:47:56: startHttpServer=false, will not be used. Temporarily turned off
t.log @ console.ts:137
16console.ts:137 [Extension Host] Warn Python Extension: 2020-07-09 14:48:10: Color theme Default Dark+ not found. Using default colors.
t.log @ console.ts:137
24console.ts:137 [Extension Host] Warn Python Extension: 2020-07-09 14:48:16: Color theme Default Dark+ not found. Using default colors.
t.log @ console.ts:137
20console.ts:137 [Extension Host] Warn Python Extension: 2020-07-09 14:49:03: Color theme Default Dark+ not found. Using default colors.
t.log @ console.ts:137
4console.ts:137 [Extension Host] Warn Python Extension: 2020-07-09 14:49:09: Color theme Default Dark+ not found. Using default colors.
t.log @ console.ts:137
16console.ts:137 [Extension Host] Warn Python Extension: 2020-07-09 14:49:11: Color theme Default Dark+ not found. Using default colors.
I have all the same as it was said above. And a tab of .ipynb doubling during opening it, and impossibility to save a .ipynb tab with all subtle features described.
Moreover in my case there are doubling of pasted content as in microsoft/vscode-python#11796.
VSCode Info:
Version: 1.47.0
Commit: d5e9aa0227e057a60c82568bf31c04730dc15dcd
Date: 2020-07-09T08:30:34.302Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.3.0-62-generic snap
I have such errors in console:
Error Python Extension: 2020-07-12 18:16:19: Exception while attempting zmq : [Error: /snap/core/current/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.22' not found (required by /home/den/.vscode/extensions/ms-python.python-2020.6.91350/out/client/node_modules/zeromq/prebuilds/linux-x64/electron.napi.glibc.node)
at process.func (electron/js2c/asar.js:140:31)
at process.func [as dlopen] (electron/js2c/asar.js:140:31)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:922:18)
at Object.func (electron/js2c/asar.js:140:31)
at Object.func [as .node] (electron/js2c/asar.js:140:31)
at Module.load (internal/modules/cjs/loader.js:735:32)
at Module._load (internal/modules/cjs/loader.js:648:12)
at Module._load (electron/js2c/asar.js:717:26)
at Function.Module._load (electron/js2c/asar.js:717:26)
at Function.t._load (/snap/code/36/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:974:348)
at Function.i._load (/snap/code/36/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:943:839)
at Function.n._load (/snap/code/36/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:940:198)
at Module.require (internal/modules/cjs/loader.js:775:19) at n (/snap/code/36/usr/share/code/resources/app/out/vs/loader.js:15:731)
at load (/home/den/.vscode/extensions/ms-python.python-2020.6.91350/out/client/node_modules/node-gyp-build/index.js:21:10)
at Object.<anonymous> (/home/den/.vscode/extensions/ms-python.python-2020.6.91350/out/client/node_modules/zeromq/lib/native.js:6:43)
at Module.o._compile (/snap/code/36/usr/share/code/resources/app/out/vs/loader.js:15:956)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
at Module.load (internal/modules/cjs/loader.js:735:32)
at Module._load (internal/modules/cjs/loader.js:648:12)
at Module._load (electron/js2c/asar.js:717:26)
at Function.Module._load (electron/js2c/asar.js:717:26)
at Function.t._load (/snap/code/36/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:974:348)
at Function.i._load (/snap/code/36/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:943:839)
at Function.n._load (/snap/code/36/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:940:198)
at Module.require (internal/modules/cjs/loader.js:775:19) at n (/snap/code/36/usr/share/code/resources/app/out/vs/loader.js:15:731)
at Object.<anonymous> (/home/den/.vscode/extensions/ms-python.python-2020.6.91350/out/client/node_modules/zeromq/lib/index.js:3:16)
at Module.o._compile (/snap/code/36/usr/share/code/resources/app/out/vs/loader.js:15:956)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
at Module.load (internal/modules/cjs/loader.js:735:32)
at Module._load (internal/modules/cjs/loader.js:648:12)
at Module._load (electron/js2c/asar.js:717:26)
at Function.Module._load (electron/js2c/asar.js:717:26)
at Function.t._load (/snap/code/36/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:974:348)
at Function.i._load (/snap/code/36/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:943:839)
at Function.n._load (/snap/code/36/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:940:198)
at Module.require (internal/modules/cjs/loader.js:775:19) at n (/snap/code/36/usr/share/code/resources/app/out/vs/loader.js:15:731)
at Object.<anonymous> (/home/den/.vscode/extensions/ms-python.python-2020.6.91350/out/client/extension.js:24:144904)
at n (/home/den/.vscode/extensions/ms-python.python-2020.6.91350/out/client/extension.js:1:186)
at /home/den/.vscode/extensions/ms-python.python-2020.6.91350/out/client/extension.js:48:633281
at processTicksAndRejections (internal/process/task_queues.js:85:5)
at async d.zmqSupportedImpl (/home/den/.vscode/extensions/ms-python.python-2020.6.91350/out/client/extension.js:48:633248)]
t.log @ console.ts:137
Hi,
I have a similar problem to others here.
I run notebook on a remote machine and I'm unable to save python notebook by either:
Furthermore, copy paste now results in a duplicate paste as in the issue cited by @newmrdenis.
i.e. copy "x" + paste -> "xx"
Could find any error messaging in the logs
Version: 1.47.0 (user setup)
Commit: d5e9aa0227e057a60c82568bf31c04730dc15dcd
Date: 2020-07-09T08:02:06.629Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363
installed extensions as follows. No errors found in the logs.

I am experiencing this problem as well on
VS Code
1.47.0
d5e9aa0227e057a60c82568bf31c04730dc15dcd
x64
Ubuntu 20.04
I faced this problem, is this trial version?
My environment:
The double paste problem is this:
https://github.com/microsoft/vscode/issues/101946 (it will be fixed by VS code in an upcoming release).
It should be noted that you need to use the save icon on the notebook or hit CTRL+S to save a notebook. We are not currently a 'real' VS code editor so VS code does not understand we're dirty or that we're even a file. This work here will alleviate the 'File | Save' menu not working:
https://github.com/microsoft/vscode-python/issues/10496
However I cannot repro the double open situation. Nor the save not working at all problem.
Hi @rchiodo,
My issue is that I'm unable to save the notebook using the methods you outlined as per my comment earlier in this chain. Netiher the icon or Ctrl+S seems to result in a save.
@rchiodo When is the release fixing this bug. It's been like 2 weeks now.
@phillip-haydon without a repro it's unlikely this will be fixed. We're still attempting to repro the situation. Alternatively you can wait for this:
https://github.com/microsoft/vscode-python/issues/10496
@rchiodo i think it鈥檚 actually a bug in core VSCode. Issue occurs everywhere. I donno how I ended up in a python... story.
@phillip-haydon are you saying that other extensions are double opening their webviews? Otherwise if it's just notebook editors behaving this way, it's likely our fault.
@rchiodo the double paste issue? Yes, i actually /first/ noticed this in drawio extension.
https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio
Then in a Markdown editor (I donno which extension it is, it's on my other computer) in the view/edit mode everything I paste double pastes.
I was trying to find a solution and ended up clicking through so many issues, majority of which were closed, and ended up here where you stated the double paste will be fixed in next release of vscode. Not realising I'm in vscode-python.
I have the same issue on WIndows 10. It happens randomly. I cannot figure out what is triggering it. I downgraded my vscode to the May version and it helped for a while then it started happening again. It's incredibly frustrating because you may have hours of unsaved work before you notice it and there is no easy way to save your work other than converting your file to .py.
Version: 1.46.1 (system setup)
Commit: cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
Date: 2020-06-17T21:13:20.174Z
Electron: 7.3.1
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18362
Potential suspect: the most recent occurrence of this happened after i opened an ipynb file and tried to run a cell but got 'direct kernel connection broken' error. I clicked on the python version in the left bottom corner, reselected python version, then did the same in the right top corner of the notebook. I was able to run cells fine, but after a while i noticed that nothing was autosaving, nor was I able to save manually in any way.
Hi all,
I have this same issue; not being able to save or save as using the file menu. System details below.

@aaronsmith1234 did you notice this comment?
It should be noted that you need to use the save icon on the notebook or hit CTRL+S to save a notebook. We are not currently a 'real' VS code editor so VS code does not understand we're dirty or that we're even a file. This work here will alleviate the 'File | Save' menu not working:
microsoft/vscode-python#10496
Still happening
Most helpful comment
This happened to me today, and I am able to reproduce using the second method provided (on Ubuntu 20.04, VS Code 1.46.1).
Here is a partial output of the developer console. The notebook that could not be saved was 'word2vec.ipynb'.
Would be great to have this fixed, lost a few hours of work today :/