Skip to content
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

error logging in 'writing login information to the keychain failed with error 'not enough memory resources are available to process this command' #130893

Closed
apsoftwaredev opened this issue Aug 16, 2021 · 95 comments · Fixed by microsoft/vscode-docs#5606 or #175695
Assignees
Labels
authentication Issues with the Authentication platform bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded windows VS Code on Windows issues
Milestone

Comments

@apsoftwaredev
Copy link

Does this issue occur when all extensions are disabled?: Yes/No
unable to start container without extensions enabled

  • VS Code Version:
  • Version: 1.60.0-insider (user setup)
    Commit: 9dd4f31
    Date: 2021-08-16T05:21:19.431Z
    Electron: 13.1.8
    Chrome: 91.0.4472.164
    Node.js: 14.16.0
    V8: 9.1.269.39-electron.0
    OS: Windows_NT x64 10.0.22000
  • OS Version:

Steps to Reproduce:

VSCode Insiders Edition on Windows Insider gives error every time when logging in to GitHub and other sites 'writing login information to the keychain failed with error 'not enough memory resources are available to process this command'. Also, have set up ssh, but still requires web authentication for extensions every time I open VSCode. It gives the error, but then continues to login after the error and does not save login information.
after opening VSCode insiders

  1. click login to github
  2. displays error and does not save login information
  3. then tested on current VSCode and doesn't require login every time and no issues with memory
    (working) Version: 1.59.0 (system setup)
    Commit: 379476f
    Date: 2021-08-04T23:13:12.822Z
    Electron: 13.1.7
    Chrome: 91.0.4472.124
    Node.js: 14.16.0
    V8: 9.1.269.36-electron.0
    OS: Windows_NT x64 10.0.22000

Regular Edition does not give the error and I do not have to login to github everytime the app starts.
https://www.loom.com/share/b7b2411e8c3147a88b2fec7e1eaa03f3

@vscodebot
Copy link

vscodebot bot commented Aug 16, 2021

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@apsoftwaredev
Copy link
Author

image
did not fix the issue

Snapshot of the error message:
image

@apsoftwaredev
Copy link
Author

image

@TylerLeonhardt
Copy link
Member

@apsoftwaredev there was an issue with the last insiders build. Can you update to the latest one and let us know if you're still seeing this?

@TylerLeonhardt TylerLeonhardt added the info-needed Issue requires more information from poster label Aug 17, 2021
@apsoftwaredev
Copy link
Author

Thank you.
I installed the update, but unfortunately, it is still doing it. I did a full memory diagnostic and it did not find any issues with memory, and there is plenty of it available.

Version: 1.60.0-insider (user setup)
Commit: c089133
Date: 2021-08-19T05:15:46.693Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.22000

image

image

@apsoftwaredev
Copy link
Author

image

@apsoftwaredev
Copy link
Author

Just updated again. Issue remains. Thank you.

Version: 1.60.0-insider (user setup)
Commit: 89bbd37
Date: 2021-08-20T17:51:50.560Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.22000

image

@TylerLeonhardt
Copy link
Member

This is likely an issue with the library we use for storing secrets called keytar but it's impossible for me to reproduce... so it'll be hard for me to make progress here.

@TylerLeonhardt TylerLeonhardt added authentication Issues with the Authentication platform bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Nov 9, 2021
@TylerLeonhardt TylerLeonhardt added this to the Backlog milestone Nov 9, 2021
@marcodafonseca
Copy link

marcodafonseca commented Dec 9, 2021

+1
I am now getting this issue on my laptop

Where can I find logs or what information do you need that would assist in resolving the issue?

@leonid1721
Copy link

+1 I am now getting this issue on my laptop

Where can I find logs or what information do you need that would assist in resolving the issue?

Hey did you manage to fix this? Same problem..

@Kazarrackt
Copy link

Third that Same issue also...

@pjlplourde
Copy link

I am also getting the same issue as well, both trying to sign in with my Microsoft Account for Settings Sync and with GitHub for Settings Sync, GitLens, or LiveShare. Visual Studio 2022 is also having problems connecting to GitHub, and since the new connection successful screen doesn't display the token information, I cannot even connect it manually.

@TylerLeonhardt
Copy link
Member

@apsoftwaredev do you see this only when using a Remote SSH/Remote Container connection? Your original video that it was a Remote connection.

To the others in the thread, do you also experience this when using Remote?

@pjlplourde
Copy link

@TylerLeonhardt I see it when using the Accounts -> Sign In commands in the bottom left. Whether I use it to sign in to use Settings Sync or LiveShare (with either Microsoft Account or GitHub), or using GitHub for GitLens. I now get the token information with the instructions:

  1. Copy the token.
    
  2. Switch back to VS code.
    
  3. Click Signing in to github.com... in the status bar.
    
  4. Paste the token and hit enter.5. 
    

But, there is no "Signing in to github.com..." in the status bar, just the error message noted.

@TylerLeonhardt
Copy link
Member

Are you using a Remote? Like Remote SSH, Remote WSL, Remote Containers?

@pjlplourde
Copy link

@TylerLeonhardt no, just launching VS Code and attempting to sign in. Seems to be a problem with saving the token on the redirect.

@ember-ana
Copy link

ember-ana commented Apr 8, 2022

I solved this by changing my pagefile settings by doing:
System Properties -> Advanced -> Performance -> Advanced -> Virtual Memory -> Change -> uncheck 'Automatically manage paging file size for all drives' -> check 'System managed size' -> OK -> Reboot

edit: I'm not sure why the pagefile would affect it though. I have 128GB of RAM.

@pjlplourde
Copy link

Thank you @PrincessRavy , that seems to have fixed it for me as well.

@TylerLeonhardt TylerLeonhardt added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Apr 11, 2022
@thmasq
Copy link

thmasq commented Apr 26, 2022

I solved this by changing my pagefile settings by doing: System Properties -> Advanced -> Performance -> Advanced -> Virtual Memory -> Change -> uncheck 'Automatically manage paging file size for all drives' -> check 'System managed size' -> OK -> Reboot
Thanks a lot it worked for me

@karl-lunarg
Copy link

I solved this by changing my pagefile settings by doing: System Properties -> Advanced -> Performance -> Advanced -> Virtual Memory -> Change -> uncheck 'Automatically manage paging file size for all drives' -> check 'System managed size' -> OK -> Reboot
Thanks a lot it worked for me

Sadly, this did not work for me and I share the doubt about how a page file setting can affect this. I even tried it with the paging file completely disabled.

Any other ideas?

@lovettchris
Copy link
Member

lovettchris commented Feb 28, 2023

So far so good, I installed the insider build, played with some different git repo folders, and I have only 2 entries in the Credential Manager:

image

The second one seems to be fore github copilot.

@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label Feb 28, 2023
@TylerLeonhardt
Copy link
Member

My change hasn't gone in yet 😅

@IllusionMH
Copy link
Contributor

IllusionMH commented Feb 28, 2023

I haven't seen this problem for about a week on Insiders build, after several attempts to remove all credentials manually or with script. Problem re-emerged few times, but works as expected after another run of the script.

Hope update would fix it for everyone and it won't re-emerge again.

P.S. I haven't use a lot of workspaces lately (as mentioned in PR), will try to get into bad state before update once again.

@lovettchris
Copy link
Member

Looking at your fix, I might be more aggressive about deleting all the chunks even if one of those deletes fails, for example, could 2 vscode instances be trying to delete the same chunks at the same time? Do you know what the user scenario is that results in very large passwords that need chunking? That might help me test it better...

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Mar 1, 2023

@lovettchris

could 2 vscode instances be trying to delete the same chunks at the same time?

This isn't possible because deletes are now handled sequentially thanks to that PR.

Do you know what the user scenario is that results in very large passwords that need chunking?

Microsoft Auth via Settings Sync. The limit in CredMan is a measly 2500 characters. A refresh token that gets stored in Cred Man is usually way larger than that. That refresh token also gets updated every reload of a window (every time Microsoft Auth extension is activated) hence the issue with multiple windows writing at the same time when a VS Code update happens.

@plwalsh
Copy link

plwalsh commented Mar 1, 2023

@TylerLeonhardt Your suspected behavior written up in the PR definitely tracks with my usage patterns and observations. I'm looking forward to the fix!

Should we clear out the hundreds of tokens inside CredMan ahead of your fix going live? Or will they get cleared/handled as part of your revised operations?

Thanks!

@TylerLeonhardt
Copy link
Member

@plwalsh you'll want to clear out CredMan.

@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Mar 2, 2023
@szmcdull
Copy link

szmcdull commented Mar 9, 2023

I just updated to 1.76.1. Now multiple vscode windows cannot sign in sync. A sign-in of one window will kick off others'.

@TylerLeonhardt
Copy link
Member

It's likely the same problem since this issue was addressed in 1.77 which is only in insiders and will be released in a few weeks.

@IllusionMH
Copy link
Contributor

IllusionMH commented Mar 13, 2023

@TylerLeonhardt I was able to reproduce on my PC with 1.76-insiders then before update and it "spammed" credentials.

After cleaning up credentials, updating, cleaning up again - 12+ days without issues. I think I was asked once (it might been for GHPR extension), but there is definitely no "spam" in credentials so far.
However, it took noticeable time to repro it in 1.76-insiders so hard to tell for sure

@TylerLeonhardt
Copy link
Member

Thanks for your report @IllusionMH. This one...... will be hard to verify.... and I think what you did is as close to a proper verification as we will get. I will mark this as verified and we will see what the 1.77 stable release gives us in a couple weeks. If anyone sees this issue in 1.77-insiders until then, please don't hesitate to reach out.

@shadowlmd
Copy link

This issue doesn't look the same as #177556, but I'll wait for 1.77 and reopen my bug report if the issue is not fixed.

@AngusMaiden
Copy link

AngusMaiden commented Mar 27, 2023

This issue doesn't look the same as #177556, but I'll wait for 1.77 and reopen my bug report if the issue is not fixed.

I have the exact same issue as #177556 and I agree that it doesn't appear the same as #130893.

I will also wait for the new fix and see if it fixes my problem.

@BladeMF
Copy link

BladeMF commented Apr 1, 2023

@TylerLeonhardt Now I am asked regularly to choose account so sync my settings from and when the list appears the Microsoft account appears as "(signed in)". I cleared the stored authentications a week ago (before the 1.77 update).

@TylerLeonhardt
Copy link
Member

Looks like folks still see this in 1.77 at least partially. I need a new issue because this one is just way to busy... so we'll keep going in #179202 (comment)

@TsingYi1263
Copy link

对于那些已经清除了凭证管理器中的大量凭证的人……你能检查一下这个数字是否再次增加了吗?

我怀疑你们中的一些人在我对这个空间进行重大更改的时候陷入了糟糕的状态......但现在已经解决了,vscode 的代码不再污染 cred 存储......这即将到来尽管我已经尝试了很多方法来解决这个问题,但我没有重现这个问题。

话虽如此,如果用户使用其他使用钥匙串的应用程序(如 Adob​​e 产品中提到的那样),用户仍然可能会进入这种不良状态。对于这种情况,我们至少应该在此处的钥匙串问题故障排除中包含文档:https ://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues

cmdkey /list | Select-String -Pattern "LegacyGeneric:target=(vscode.+)" | ForEach-Object { cmdkey.exe /delete $_.Matches.Groups[1].Value }

this is useful!

@yuanchen-zhu
Copy link

yuanchen-zhu commented Apr 8, 2023

Just want to report that on Windows, the keychain could get into a bad state due to this issue, after which even upgrading to the newer version of vscode doesn't help'. One would need to take the actions suggested in https ://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues, as mentioned above, which solved the issue for me.

@BladeMF
Copy link

BladeMF commented Apr 10, 2023

@TylerLeonhardt it is actually worse now. I am being asked to select the account to sync settings from repeatedly upon launching VS Code. The Microsoft accont I am using appears as "(Signed in)", so the token does not appear to be lost, just disacossiated. I can't see anything within the logs.

@paulej
Copy link

paulej commented Apr 10, 2023

@TylerLeonhardt it is actually worse now. I am being asked to select the account to sync settings from repeatedly upon launching VS Code. The Microsoft accont I am using appears as "(Signed in)", so the token does not appear to be lost, just disacossiated. I can't see anything within the logs.

Is it worse or did your Windows credentials just get full? That happens to me from time-to-time and it's annoying. This comment posted above provided a recipe for deleting all of the Windows credentials. This fixes it for a while, then I have to do it again.

@TylerLeonhardt
Copy link
Member

👋 folks, re-posting what I'm saying above:

Looks like folks still see this in 1.77 at least partially. I need a new issue because this one is just way to busy... so we'll keep going in #179202 (comment)

@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
authentication Issues with the Authentication platform bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded windows VS Code on Windows issues
Projects
None yet