Skip to content

[userDataSync] [error] TypeError: Cannot convert undefined or null to object #105622

@Mellbourn

Description

@Mellbourn
  • VSCode Version: 1.48.2
  • OS Version: macOS Catalina 10.15.6

I have also reproduced the problem on 1.49.0-insider (recurred after selecting the Stable settings)

Steps to Reproduce:

  1. Start VS Code
  2. Run the command Settings Sync: Show Log
  3. It shows
[2020-08-28 22:42:28.859] [userDataSync] [info] Auto Sync: Triggered by Activity
[2020-08-28 22:42:29.101] [userDataSync] [info] Settings: No changes found during synchronizing settings.
[2020-08-28 22:42:29.109] [userDataSync] [info] Keybindings: No changes found during synchronizing keybindings.
[2020-08-28 22:42:29.113] [userDataSync] [info] Snippets: No changes found during synchronizing snippets.
[2020-08-28 22:42:29.121] [userDataSync] [error] TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at e.format (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:462:573)
    at e.generateSyncPreview (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:459:728)
    at async e.doGenerateSyncResourcePreview (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:442:532)
[2020-08-28 22:42:29.121] [userDataSync] [error] globalState: Cannot convert undefined or null to object
[2020-08-28 22:42:29.225] [userDataSync] [info] Extensions: No changes found during synchronizing extensions.
[2020-08-28 22:42:29.225] [userDataSync] [info] Sync done. Took 158ms

Also:

  1. I do Settings Sync: Show Synced Data
  2. in the tree SYNC ACTIVITY (REMOTE) I chose Ui State
  3. and click on the latest globalState.json
  4. instead of showing a diff, a blank diff window shows briefly and then disappears
  5. In the lower right corner I get the error Unable to open 'globalState.json (Remote) ↔ globalState.json (Local)': Cannot convert undefined or null to object.

Also, I tried to disable and then enable the entire settings sync:

  1. I did the command Settings Sync: Turn Off...
  2. I restarted VS Code
  3. I did the command Settings Sync: Turn On...
  4. In the lower right corner I get the message Error while starting Sync: Cannot convert undefined or null to object and the Settings sync is not turned on!
  5. If I try to turn on Settings Sync again, but this time I choose to exclude UI State, then I can successfully turn on settings sync.
  6. I can then choose Settings Sync: Configure... and check ? UI State, which "works", but then I get the above error in the logs again.

This seems similar to #94175

I just started using Settings Sync for the first time today. I did look at the logs, and for the first few hours, there were no errors.
Just about the time the problem started, I tried to do a Restore on globalState.json to a previous version.

Things I tried that did not help:

  • Restarting vscode
  • Disabling and then enabling UI sync
  • Restore to a previous version
  • Disabling and then enabling Setting Sync - see above

The problem has propagated to other computers that are synced. :/

Does this issue occur when all extensions are disabled?: Yes

What finally fixed it:

  • On the 1.49.0-insider build, I did a Restore to a really old (more than an hour) version of globalState.json. Then the error stopped being reported. This fix propagated to the stable installation as well.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugsettings-syncverifiedVerification succeeded

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions