-
Notifications
You must be signed in to change notification settings - Fork 27.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting Sync: failed because of Unauthorized (401) #133201
Comments
Sure. Microsoft Authentication pane:
I do not see anything unusual in the Dev Console but I'll post the output after the next repro |
Just got a new repro.
Dev Console content: |
Quick update: I have used "Clear Data in Cloud" one more time and apparently sync is stable now, it has been running for over 30 minutes which is much longer than it used to |
I spoke too soon 😒
Anyway this time there is no json error in the Authentication output:
This is the full Dev Tools console output from this Iniders instance: |
While I do still see the error |
Thanks for providing all this useful data @carlocardella I will try to investigate as much as I can this week. |
I have also been experiencing this same issue with similar logs, using an @microsoft.com account. |
Stable 1.61 is, well... stable... I do still see the |
I am still having machines fail with this: Version: 1.61.2 (system setup) I was able to fix one by signing in to LiveShare instead. |
For me, signing out and in didn't resolve this issue either - I still get this: |
I've added a ton more logging on the Microsoft Auth side in that☝️ commit and I did move a few other things around... let's see how it goes for you all. Please try out Insiders tomorrow. If you still see the issue, please add the Microsoft Authentication Output channel here. |
Looks like Stable has regressed on all my machines, the behavior and logs looks the same as what I previously shared above. |
We'll have a new stable next week so we'll be able to really test things out then. |
Adding logs from today's Insiders, though I am using the Stable settings sync service:
and settings sync logs:
|
Just got another error, this is the Settings Sync with log level as trace:
The account picker is identical as my prevoius screenshot. Microsoft Authentication log
|
|
I'm able to repro this and I'm filling the codebase with log statements since attaching a debugger doesn't work in this instance. It just takes over an hour to get a repro... figure out I'm missing X log statement... then rerun the whole experiment. I am actively working on this - just want you all to know. |
Watching. For business reasons, I'm not using the Insider versions, but I'm looking forward to this being fixed. Thanks to @TylerLeonhardt and @sandy081 for working on it. |
Here are some fun learnings... This value comes from a cracked open JWT used in the Microsoft Authentication extension
This value comes from the response of the API call that gave me said JWT
So if the docs say:
and
Who is right? 🙃 We currently refresh at a rate of 30 seconds before I talked to @connor4312 about this and he says:
In our case, we don't need to use a timestamp so the "refresh every 2/3rds of So at the end of the day, a simple 1 line change of The commit: |
Today's Insiders has been running smoothly with Settings Sync enabled for over four hour, it never lasted this long without errors. Looks very promising |
Marked as a candidate so that the change can be included in a 1.62.3 (if we do one) |
Also been having the issue on the latest stable release as of the date of this comment. It's been happening on both a personal Microsoft Account and a work Microsoft Account (attached to Active Directory). My logging output looks the same as what everyone else has posted. Since there's a fix in the works, I'll try insiders and see if that fixes the issue for me. If that doesn't fix it, I'll pull together some logs and leave a comment here. |
fixed in #137083 . Will be included in 1.62.3 coming later this week. |
verification steps:
You should not be logged out of Settings Sync |
It might be something my end but this had been working fine for me for months (no need to login every few hours). Then I had this problem a few times each day for the past week or so. I updated VSCode yesterday to the latest (non-Insider) v1.62.3 and still getting the same issue. In the log below I needed to sign in again at 17:22. Two instances of VSCode were open during all of this time. Version: 1.62.3 (system setup) [2021-11-19 15:53:05.143] [settingssync] [info] Using settings sync service https://vscode-sync.trafficmanager.net/ |
@Jimbo99 I don't think this is related but I'm not sure. Can you open a new issue (since this one is way to long)? And also attach the following:
|
Thanks Tyler. Will do! |
I ran the command The problem still exists with the "Unexpected token in JSON at position 0."
|
This is expected and this error is caught and handled. Look at the next log statements:
Are you seeing the 401 that this error talks about in the latest version of VS Code? |
I'm seeing some weird behavior in this area after upgrading to v1.63 and relying on Save functionality of HyperV to stop/restore VM where VSCode is. Since the upgrade - first Save/Restore got me back into the original bug's state. I re-logged in, then saved VM again - and this morning (PST) I'm completely logged out from all accounts. This pattern of usage was regular for me before 1.63 and so far all interim fixes were indeed fixing the issue. [Info - 23:41:39.153] Reading sessions from keychain... |
@TylerLeonhardt My problem, although not related to this problem, is confusing after some tests:
Conclusion: |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
I can reproduce this problem on three different machines, both with the latest Stable and Insiders. The problem started last month for me but we were just a few days away from the August release so I decided to wait and see if the problem went away with the new version (it happened in the past). It didn't.
Setting Sync Log:
Things I tried (all with no luck):
One additional pointer: I sync both Stable and Insiders on the Stable channel.
I remember at least one occurrence in the past where the two versions could not be sync'ed in the same channel because of some temporary incompatibility, is this still the case?
The text was updated successfully, but these errors were encountered: