vscode: Problems loading settings schemas

Type: Bug

I got the following error randomly while changing workspace settings. I used the extension bisect feature to see if it was an extension, but nothing was identified on the very first pass. The issue continued to persist, until Visual Studio Code was reloaded.

Here’s the message that appeared in the problem pane:

Problems loading reference ‘vscode://schemas/settings/workspace’: Unable to load schema from ‘vscode://schemas/settings/workspace’: cannot open vscode://schemas/settings/workspace. Detail: Unable to resolve text model content for resource vscode://schemas/settings/workspace.

I found a similar issue regarding multi-root workspaces on github: https://github.com/microsoft/vscode/issues/124491#issue-899481844 My workspace has multiple folders. I only edited the workspace settings and I never touched the folder settings for the workspace. I did made some recent adjustments by installing/uninstalling extensions, switching profiles, and editing workspace settings.

VS Code version: Code - Insiders 1.77.0-insider (bbe8e872dc7c8899eb80bc4b650a6f090f4bc952, 2023-03-14T05:23:49.668Z) OS version: Windows_NT x64 10.0.23403 Modes: Sandboxed: Yes

System Info
Item Value
CPUs 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz (8 x 2803)
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
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 15.71GB (2.81GB free)
Process Argv –crash-reporter-id f283d74a-2be7-4cd0-86fd-41b52e41f42d
Screen Reader no
VM 0%
Extensions (11)
Extension Author (truncated) Version
Ionide-fsharp Ion 7.5.1
csharp ms- 1.25.4
dotnet-interactive-vscode ms- 1.0.4164011
vscode-dotnet-pack ms- 1.0.12
python ms- 2023.4.1
vscode-pylance ms- 2023.3.20
jupyter ms- 2023.3.1000752049
jupyter-keymap ms- 1.1.0
jupyter-renderers ms- 1.0.15
vscode-jupyter-cell-tags ms- 0.1.6
vscode-jupyter-slideshow ms- 0.1.5
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256198
vslsvsres303:30308271
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
vscod805:30301674
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30404738
cppdebug:30492333
vsclangdf:30492506
c4g48928:30535728
dsvsc012:30540252
pynewext54:30618038
pylantcb52:30590116
pyindex848:30611229
nodejswelcome1:30587009
pyind779:30611226
pythonsymbol12:30651887
6233i204:30659907
vscodeenable:30660116
pythonb192:30661256
funwalk2cf:30682975
pythonms35:30671666
0bg3d529:30680467
57b77579:30677314

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 12
  • Comments: 32 (11 by maintainers)

Commits related to this issue

Most upvoted comments

For me the problem message appears in a typescript node project when I have package.json open. Close this file and the problem message goes away. (The package.json file contains no known issues). While others report either user or workspace settings reference loading problems, for me it is configurationDefaults:

Problems loading reference 'vscode://schemas/settings/configurationDefaults': Unable to load schema from 'vscode://schemas/settings/configurationDefaults': cannot open vscode://schemas/settings/configurationDefaults. Detail: Unable to resolve text model content for resource vscode://schemas/settings/configurationDefaults.

I’m sure a hotfix will release the fix to all of us soon, but here’s a workaround for now: I found that poking any json.<...> settings key in settings.json restores proper autocomplete/hover in VSCode’s settings.json until next VSCode restart. But a json key must be poked after every restart. For example, put "json.schemaDownload.enable": true, at the top of your settings.json and save the file. You will have to toggle and save this key every time you start VSCode. A detailed set of steps for doing this can be inspected at the end of this comment.

If you use the VSCode extension Settings Cycler, you can set up a hotfix keybind (like Ctrl+Alt+Shift+Q in this case), and press the keybind twice every time you restart VSCode. Or, just never restart VSCode until the patch drops! 😅

settings.json

  "settings.cycle": [
    {
      "id": "copilot",
      "values": [
        {
          "github.copilot.inlineSuggest.enable": false
        },
        {
          "github.copilot.inlineSuggest.enable": true
        }
      ]
    },
    //! https://github.com/microsoft/vscode/issues/177142
    {
      "id": "hotfix",
      "values": [
        {
          "json.schemaDownload.enable": true
        },
        {
          "json.schemaDownload.enable": false
        }
      ]
    }
  ],
  //! https://github.com/microsoft/vscode/issues/177142
  "json.schemaDownload.enable": true,

keybindings.json

  //! https://github.com/microsoft/vscode/issues/177142
  {
    "key": "ctrl+shift+alt+q",
    "command": "settings.cycle.hotfix"
  },
details

I can confirm that setting "json.validate.enable": false allows hover hints and completion to function again, e.g. in VSCode’s own settings.json modification. However, this workaround throws out all JSON linting and reporting in the “Problems” pane, so it’s sort of the nuclear option. This issue just cropped up for me in the past few days, so it may be a regression associated with the latest release?

After further investigation, I find that poking any json.<...> settings key in settings.json restores proper autocomplete/hover in VSCode’s setitngs.json until next VSCode restart. But a json key must be poked after every restart. Here’s a rundown:

  1. Ensure all json.<...> tree of settings keys are initially at their defaults, e.g. none of these keys are explicitly specified in any of your settings.json (maybe unnecessary, but this is my starting state).
  2. Restart VSCode (e.g. with Developer: Reload Window). Navigate to your user settings.json. The following warning presents in the Problems pane:
Unable to load schema from 'vscode://schemas/settings/user': cannot open vscode://schemas/settings/user. Detail: Unable to resolve text model content for resource vscode://schemas/settings/user.
  1. Make a trivial setting modification in the json tree of settings keys, even if that modification is a no-op, like explicitly specifying a default as its default value. For example, put "json.schemaDownload.enable": true, at the top of your settings.json and save the file. (You could’ve also poked "json.validate.enable" to be either true or false I think, maybe?)
  2. Check whether autocomplete/hover works properly in settings.json, completing settings names and such. It should work now.
  3. You can even remove the edit you made in step (4), save settings.json again, and autocomplete/hover still works.
  4. Restart VSCode.
  5. Now autocomplete/hover is broken again in settings.json, until some modification to the json.<...> tree of settings keys is made again, like in step 4. For example, commenting out "json.validate.enable": true if it’s there, and saving, restores autocomplete/hover.

So this issue may have to do with unstable startup behavior of JSON schema handling, perhaps isolated to VSCode’s own settings.json or perhaps all JSON schemas more broadly, and this unstable state can be temporarily fixed by poking a json.<...> settings key, but the unstable behavior returns on the next program start. At least in my case.

This bug has been fixed in the latest release of VS Code Insiders!

@ddoggdiggitty, you can help us out by commenting /verified if things are now working as expected.

If things still don’t seem right, please ensure you’re on version c1bca6d7cc2c5f71ae04deda90c0cf50819ffde4 of Insiders (today’s or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn’t working as expected.

Happy Coding!

Reopening this because it can be still reproduced.

Currently experiencing the issue on my linux machine. On my Windows machine (with the same configuration file, since it’s synchronized) it works fine on stable, but not on insiders.

Can confirm that toggling json.schemaDownload.enable as a workaround works until restart.

Linux version: Version: 1.80.0 Commit: 660393deaaa6d1996740ff4880f1bad43768c814 Date: 2023-07-04T13:39:48.236Z (1 wk ago) Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.80.0 Chrome/108.0.5359.215 Electron/22.3.14 Safari/537.36

Windows version (stable): Version: 1.80.0 Commit: 660393deaaa6d1996740ff4880f1bad43768c814 Date: 2023-07-04T15:06:02.407Z (1 wk ago) Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.80.0 Chrome/108.0.5359.215 Electron/22.3.14 Safari/537.36

Windows version (insiders): Version: 1.81.0-insider Commit: 2f1013a310bbd74410e74fad99497841edad0eda Date: 2023-07-13T05:33:32.822Z (2 hrs ago) Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code-Insiders/1.81.0-insider Chrome/108.0.5359.215 Electron/22.3.14 Safari/537.36

Currently experiencing this issue. I can overcome it temporarily following a suggestion elsewhere where I add or remove “json.schemaDownload.enable”: true to my settings.json file. I keep adjusting the file to see if there is something in there ausing the issue. Even old, known settings are causing the error to kick in regularly. I put a single setting in there and the error comes up unless it’s empty

Version: 1.80.0 (user setup) Commit: 660393deaaa6d1996740ff4880f1bad43768c814 Date: 2023-07-04T15:06:02.407Z (1 wk ago) Electron: 22.3.14 ElectronBuildId: 21893604 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045

For me too

For me the message showed up in 1.80.0

The message is still there for me in 1.80.0.

I just upgraded to the regular 1.80.0 version and it also seems to be fixed there as expected ^^.

In my case I think I found the culprit:

...
    "[svelte]": {
        "editor.defaultFormatter": "svelte.svelte-vscode"
    },
...

The property above gives a “Value is not accepted” error even though it’s a valid value that works when the Svelte plugin is enabled (it’s currently disabled). As soon as I delete this property, the “Unable to load schema” error goes away. Weird.

Update: I spoke too soon – after reloading VS Code, the “Unable to load schema” error is back 😓