Visual Studio Code. Error while turning on Settings Sync: Authentication failed

Viewed 6429

I am getting Error while turning on Settings Sync: Authentication failed. when I try:

Settings Sync: Turn On... > Sign in & Turn on > {account name} (GitHub) Last Used with sync.

Settings Sync: Show Log shows:

[settingssync] [info] Using settings sync service https://vscode-sync.trafficmanager.net/
[settingssync] [info] Auto Sync is disabled.
[settingssync] [info] Request failed {"url":"https://vscode-sync.trafficmanager.net/v1/manifest","status":401,"execution-id":"bbf1a818-0556-46db-aa3b-2da51e10ef6f"}
[settingssync] [info] Settings Sync auth token failed github false
[settingssync] [info] Request failed {"url":"https://vscode-sync.trafficmanager.net/v1/resource/settings","status":401}
[settingssync] [info] Settings Sync auth token failed github true
[settingssync] [info] Request failed {"url":"https://vscode-sync.trafficmanager.net/v1/resource/keybindings","status":401}
[settingssync] [info] Settings Sync auth token failed undefined true
[settingssync] [info] Request failed {"url":"https://vscode-sync.trafficmanager.net/v1/resource/snippets","status":401}
[settingssync] [info] Settings Sync auth token failed undefined true
[settingssync] [info] Request failed {"url":"https://vscode-sync.trafficmanager.net/v1/resource/extensions","status":401}
[settingssync] [info] Settings Sync auth token failed undefined true
[settingssync] [info] Request failed {"url":"https://vscode-sync.trafficmanager.net/v1/resource/globalState","status":401}
[settingssync] [info] Settings Sync auth token failed undefined true
[settingssync] [info] Request failed {"url":"https://vscode-sync.trafficmanager.net/v1/resource/machines/latest","status":401}
[settingssync] [info] Settings Sync auth token failed undefined true
[settingssync] [info] Request failed {"url":"https://vscode-sync.trafficmanager.net/v1/manifest","status":401,"execution-id":"b3162617-22cb-4db6-8604-d43771bb972d"}
[settingssync] [info] Settings Sync auth token failed github true

How can I fix this error or remove syncing with GitHub account to be able to re-configure sync.

Settings Sync: Turn On... > Sign in & Turn on > Sign in with GitHub instead {account name} (GitHub) Last Used with sync.

Reinstalling VSCode with removing user preferences %AppData%\Code did not help.

6 Answers

This just happened to me on a fresh install on a fresh machine. I intentionally tried to sync first thing, before installing anything locally to keep it 'clean' and consistent. It had been working fine on 3 other machines. Whether coincidence or not, I was also using my GitHub linked account. Here is how I fixed:

  1. With account set to 'GitHub: Logged In' in a broken state, I went to 'Setting Sync: Configure' and de-selected 'Settings, Key Bindings'.
  2. Wait a few mins and my sync of Extensions (and other) succeeded, the logs showed a clean operation.
  3. Re-enabled 'Settings' and it succeeded after a couple minutes as well. I verified this both in logs and by looking at my 'Preferences: Open Settings.json' which had been empty and was now populated from sync.'

Wild theory, something about the settings.json coming in first, before the extensions was blowing up VS trying to sync settings for extensions not installed... but this makes no real sense obviously, it shouldn't care about json config nodes for extensions that are not yet installed.

##Also, sidenote:

As a final step, I tried Re-enabling 'Key Bindings' (of which I have no special config afaik) and it may still be erroring out? It is according to the logs.

But leaving it with all sync settings enabled seemed to be working aside from some noise in the logs.

Seems like a bug of some sort here with the 'Sync Settings' feature, but I can't identify it well enough to report =(

I had same issue and it was solved by installing gnome-keyring. Hope it works for you.

Make sure settings.json is empty, and try again. This worked for me!

Check settings.json. It might have some extra "{}". Removing that did help solve the issue and now sync is working as expected.

Just head over to settings(which is at bottom left corner) and sign in again(by clicking on the sync now button). It solved my issue.

For me it worked when I first unchecked the box "Settings" when being asked the first time what to sync (you find it in "Settings Sync: Configure"). Then only "Keyboard Shortcuts", "User Snippets"..."UI State" get synced.

After this was successful, I went again to "Settings Sync: Configure" and ticked the box to also sync "Settings". Now also the settings got synced successfully.

Related