vscode: ERROR: unable to resolve text model content for notebook cell output
Type: Bug
When Jupyter Notebook output is truncated, an option to ‘open in a text editor’ is presented. When I do this, a new tab is opened, but it only displays a VS Code error:
The editor could not be opened due to an unexpected error: Unable to resolve text model content for resource vscode-notebook-cell-output://wsl%2Bubuntu/home/jlute/projects/Vulnscape/vulnscape/vulndig/test.ipynb#opb069b443-c48a-463a-a45a-d41950a88071%2Cvscode-remote
During troubleshooting, I discovered that the first time one uses the ‘open in a text editor’ functionality in a new notebook, the error does not occur–the text opens as expected. Subsequent attempts to ‘open in a text editor’, even for truncated output in a different cell, all result in the error moving forward.
I had other reasons to want to refresh my environment, so I also performed an entire uninstall and reinstall of WSL, VS Code, and associated Extensions, but the problem persists.
VS Code version: Code 1.81.0 (6445d93c81ebe42c4cbd7a60712e0b17d9463e97, 2023-08-02T12:37:13.485Z) OS version: Windows_NT x64 10.0.22621 Modes: Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2
System Info
Item | Value |
---|---|
CPUs | 12th Gen Intel® Core™ i7-12700H (20 x 2688) |
GPU Status | 2d_canvas: enabled canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled |
Load (avg) | undefined |
Memory (System) | 15.73GB (2.13GB free) |
Process Argv | |
Screen Reader | no |
VM | 0% |
Item | Value |
---|---|
Remote | WSL: Ubuntu |
OS | Linux x64 5.15.90.1-microsoft-standard-WSL2 |
CPUs | 12th Gen Intel® Core™ i7-12700H (20 x 2688) |
Memory (System) | 7.62GB (5.84GB free) |
VM | 0% |
Extensions (9)
Extension | Author (truncated) | Version |
---|---|---|
jupyter-keymap | ms- | 1.1.2 |
remote-wsl | ms- | 0.81.0 |
autopep8 | ms- | 2023.6.0 |
vscode-pylance | ms- | 2023.8.10 |
jupyter | ms- | 2023.7.1002162226 |
jupyter-keymap | ms- | 1.1.2 |
jupyter-renderers | ms- | 1.0.17 |
vscode-jupyter-cell-tags | ms- | 0.1.8 |
vscode-jupyter-slideshow | ms- | 0.1.5 |
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
vscaat:30438848
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
vsccc:30803844
2e4cg342:30602488
89544117:30613380
showlangstatbar:30737416
vsctsb:30748421
03d35959:30757346
pythonfmttext:30731395
pythoncmv:30756943
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
gsofa:30804715
pythonnosmt12:30797651
pythonidxpt:30805730
pythonnoceb:30805159
e537b577:30795824
dsvsc013:30795093
dsvsc014:30804076
For reference
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 13
- Comments: 19 (1 by maintainers)
Commits related to this issue
- Fix #189673. Tracking original output id that is reused. — committed to microsoft/vscode by rebornix 10 months ago
- Merge pull request #191162 from microsoft/rebornix/yummy-wolverine Fix #189673. Tracking original output id that is reused. — committed to microsoft/vscode by rebornix 10 months ago
This is an effective workaround for now! Click the 3 dots > Clear Cell Outputs
I have the same issue. For me its only that cell that is broken though. If I open a new cell and copy paste the code into the new cell, it works again (at least for a couple of executions…)
Same here. Difference is I’m on Win 10, running VS Code directly in Windows, otherwise identical versions as @vinyluis.
Extension versions:
To replicate:
If I omit step 5 (i.e. keep the editor tab open), then after subsequent re-runs of the cell I get this:
Closing the editor tab and clicking “text editor” leads to the previous error.
If I “Clear all outputs”, then the next “text editor” click works (but have to re-run the cell again).
Version: 1.81.0 (user setup) Commit: 6445d93c81ebe42c4cbd7a60712e0b17d9463e97 Date: 2023-08-02T12:37:13.485Z Electron: 22.3.18 ElectronBuildId: 22689846 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045
Same issue here. Clearing output helps.
Version: 1.81.1 (user setup) Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794 Date: 2023-08-09T22:22:42.175Z Electron: 22.3.18 ElectronBuildId: 22689846 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.22621
I can repro, it looks like we don’t update the update ID as new outputs are generated, but the textmodel with the old ID is disposed, so it can’t find that model. Somehow this also seems to repro in 1.80.2 and 1.79.2