vscode: error logging in 'writing login information to the keychain failed with error 'not enough memory resources are available to process this command'
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: 9dd4f31a21d63deea5e1fc322cfc802413b31d95 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
- click login to github
- displays error and does not save login information
- 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: 379476f0e13988d90fab105c5c19e7abc8b1dea8 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
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 7
- Comments: 95 (35 by maintainers)
Commits related to this issue
- Only have a single window store the session Before this change, every single window was writing to the same secret at basically the same time because they would all refresh the token and then attempt... — committed to microsoft/vscode by TylerLeonhardt 2 years ago
- Only have a single window store the session (#169356) Before this change, every single window was writing to the same secret at basically the same time because they would all refresh the token and th... — committed to microsoft/vscode by TylerLeonhardt 2 years ago
- Sequence operations to credentials and clean up better when setting fixes #130893 — committed to microsoft/vscode by TylerLeonhardt a year ago
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.
this is useful!
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.
For the folks that have cleared the large list of credentials in their credential manager… can you please check to see if that number is increasing again?
My suspicion is that some of you got into a bad state around the time that I was making heavy changes in this space… but now that that has settled, vscode’s code isn’t polluting the cred store anymore… This is coming from my lack of reproduction of the issue even though I’ve tried numerous ways to do it.
With that said, users could still get into this bad state though, if they use other applications that use the keychain (like someone mentioned with Adobe products). For this case, we should at the very least include docs in the troubleshooting keychain issues here: https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues
I had the same issue - too many credentials (Windows 11: Start > Credential Manager > Windows Credentials). Mine included an obscene number of vscode entries, as noted above, so I deleted them all with a powershell line I cobbled together through Google:
for /F "tokens=1,2 delims= " %%G in ('cmdkey /list ^| findstr vscode') do cmdkey /delete %%H
.It still threw the error so I hand-pruned most of the remaining entries and it took.
Good luck!
(FWIW, Win 11, 8GB RAM + 24GB Page File)
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.
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 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 sureI 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.
My change hasn’t gone in yet 😅
Not sure related or not, but the latest version would cause lsass.exe consuming high CPU, especially when VS Code thinks I need to re-log in my account.
Thanks for the update. We’ll be doing more drastic work in this space this month and next and my hope is that this will be resolved then.
Yes, these two.
It’s not that this doesn’t happen, but it is diffucult to remember so far back.
I have confirmed that once there are too many credentials, the Windows call
CredWrite
fails withERROR_NOT_ENOUGH_MEMORY
. This issue doesn’t have to do with Electron or Node.NOTE: THIS IS AN OLD QUOTE. LOOK AT THE NEW LINE HERE
“Target” is localized. Need to chcp 437 first. I now clear my credentials and will try to reproduce.
Hi Tyler, I have not had any failures along the lines of the original problem (needing to login each time vscode is started) since I cleared the credentials back in July. Today, I see only about 5 hits from the
cmdkey
command you posted. And I think I saw about the same number when I checked at some point between July and now. I tend to agree with your suspicion.@karl-lunarg thanks for giving that a try. The content of
microsoft-authentication
is different than GitHub. It has a different secret storage schema (that I could get into … but lets call it as it is “legacy reasons”)Anyway, the fact that the script I suggested worked fine, but VS Code fails leads me to believe that this might have something to do with Electron and how
keytar
is loaded into that.Let me chat with @deepak1556 on this to see if he has anything thoughts
I can try this tomorrow.