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

14

27

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.

Campbellbannerman answered 12/1, 2022 at 6:29 Comment(0)
F
18

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 =(

Flickinger answered 19/7, 2022 at 15:39 Comment(3)
This worked for me. I assume there's some issue with syncing settings before there's been an initial sync.Coccidiosis
Removing the Keyboard shortcuts worked for me too.Dragelin
Synching with Microsoft account worked for me. Disabled Keyboards at first sync then re-adding Keyboards settings worked on my endKnownothing
O
15

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

Outdate answered 26/7, 2022 at 9:49 Comment(2)
Cleared settings.json, closed and reopened app and it worked for me, thanksHymenopterous
For me, the solution was to sync from a new VS Code WIndow without any local configuration (en therefore no settings.json).Threequarter
E
8

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

Expurgate answered 9/3, 2022 at 10:5 Comment(4)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Cherimoya
Thanks. This fixed it, in my case. However, I had to install 2 additional packages: gnome-keyring libsecret libgnome-keyringElectrophotography
thanks for the answer, but i have this problem on windowsCampbellbannerman
Worked for me with Arch Linux!Remindful
R
3

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

Ragman answered 30/1, 2022 at 19:7 Comment(1)
I completely reinstalled VSCode with a complete removal of all settings, including settings.json. This is not my case. settings.json is empty but the problem remains.Campbellbannerman
L
2

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.

Latrena answered 8/9, 2022 at 9:18 Comment(1)
Just tried this as well and it solved my issue, thanks!Eklund
A
2

On VSCode 1.78, I made a settings change, and the button Turn Settings Sync On showed up, which is strange, because I had Settings Sync working flawlessly for years. So I clicked on the button, selected everything, synched with GitHub, and got this error:

Settings sync cannot be turned on because the current version (1.78.0, 252e5463d60e63238250799aef7375787f68b4ee) is not compatible with the sync service. Please update before turning on sync.

Google gave me this SO question as the first result. I tried very hard with many proposed solutions but I kept getting that same error. The only thing I could understand with trial and error was that the error depended on whether the Extensions option was ticked for synching (sync failed) or not (sync succeeded).

What worked for me

Do not follow these steps if you are not OK with loosing your sync data

  1. make sure you already uninstalled the deprecated / unsupported / original Settings Sync extension (whose functionalities were integrated into VSCode)
  2. run the command Settings Sync: Show Synced Data (from the Commands Palette)
  3. run the command Clear Data in Cloud... (from the Views and More Actions... button, that with ···)
  4. sync again
Allinclusive answered 22/8, 2023 at 8:9 Comment(0)
I
1

I resolved this issue by logging out of Visual Studio Code, turning on settings sync then following the instructions to login in that order (I login with github). I was prompted with a merge conflict following which everything worked.

Logging in then attempting to turn on settings sync wouldn't work for whatever reason, something appears broken.

  1. Select "Accounts" (bottom left user icon).
  2. In the pop up menu if you are logged in select "Sign Out".
  3. Select "Settings" (bottom left cog icon).
  4. In the pop up menu select "Turn on Settings Sync...".
  5. You will be asked to login, I used my GitHub account.
  6. Resolve merge issues if any.
  7. You should be logged in with settings sync turned on.

Hope it works for someone else.

Isabellisabella answered 12/4, 2023 at 14:19 Comment(0)
A
0

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.

Acknowledge answered 25/8, 2022 at 8:11 Comment(0)
S
0

Just today, with version 1.74 on a Slackware64 15.0 it's been enough to disable the GitHub Authenticator extension and choosing GitHub from Microsoft login options. The same is for the Insider release on the same linubox. Cheers :)

Edit: uninstalled the GitHub Authenticator extension

Shadrach answered 9/1, 2023 at 20:44 Comment(0)
C
0

Just had the same issue. Adding another option that worked for me:

Check if following extensions are enabled. In Extensions View, type following:

@builtin microsoft-authentication

@builtin github-authentication

Cowes answered 12/7, 2023 at 14:15 Comment(1)
This also worked for me. All I did was 1. disable GitHub Authentication built in extension 2. reload 3. enable GitHub Authentication 4. turn on settings sync and it worked.Liberec
S
0

What worked for me.

I opened Settings.json (user), found the warning line. removed it. and everything went smoothly.


BTW, the lines were

    "python.formatting.autopep8Args": [
        "--max-line-length=120"
    ],

VSCode was warning about this plugin being depricated.

Shrewd answered 23/9, 2023 at 10:33 Comment(0)
M
0

I'm using Microsoft account for VS Code Settings Sync. And this happened when I accidently logined in with Github account first. VS Code just refuse sync with Microsoft account, even I logged out Github one, it just answering with Error while turning on Settings Sync: Authentication failed. Reinstall don't help, delete things in setting.json also not work for me.

Here's my solution:

Don't follow if you can't lose your present local settings

  1. Log out all your account, then exit VS Code.
  2. Go to C:\Users\{Your Username}\AppData\Roaming\Code
  3. Delete all things in there
  4. Re-launch VS Code. Now it should be like new installed, and you can log in and sync with your Microsoft account successfully.

It seems that the VS Code has downloaded the settings from Github account, even though it is blank for me, and the blank settings made VS Code refuse to sync with Microsoft account.
I'm not sure if this works for ones that use Github account for sync, but I think it would help, if this question happens.

Meader answered 9/10, 2023 at 19:9 Comment(0)
I
0

Here's how I fixed the problem.

  1. Go to C:\Users\username\AppData\Roaming.
  2. Delete Code directory. (or you can move it to another location to be safe)
  3. Restart vscode.
  4. Sign in sync setting.

Made some attempts,

  1. log out and log in, turn on and turn off sync -> won't work
  2. clear settings.json -> won't work
  3. sync while de-selected 'settings', 'keyboard short', or all options -> won't work

I think vscode remember my previous account data, even after I reinstall the application. The keypoint is to locate the related data and deleted it.

Indophenol answered 4/11, 2023 at 4:17 Comment(0)
B
0

For me it was a corrupt settings.json, but it was really subtle, I had used a period instead of a comma in a list.

Bearnard answered 26/6 at 11:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.