atom / node-keytar

Native Password Node Module
https://atom.github.io/node-keytar
MIT License
1.37k stars 193 forks source link

Setting a password throws strange Error: �ڴ���Դ���㣬�޷����������” #472

Open TylerLeonhardt opened 1 year ago

TylerLeonhardt commented 1 year ago

Description

hi 👋 I’m opening this on behalf of @buzzers they hit a bug in node-keytar while using VS Code.

Steps to Reproduce

I figured I would make it easy on them by having them use the @emacs-grammarly/keytar-cli

  1. npx @emacs-grammarly/keytar-cli set-pass testingvscode testingvscode testingvscode

Expected behavior:

Should set the password just fine.

Actual behavior:

02388876-42CE-4501-9E1A-C13FBF6E3E8E

Reproduces how often:

Always

Versions

VS Code Version: 1.71.0 (user setup) Commit: https://github.com/microsoft/vscode/commit/784b0177c56c607789f9638da7b6bf3230d47a8c DateTime: 2022-09-01T07:36:10.600Z Electron: 19.0.12 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS Version: Windows_NT x64 10.0.19044

But then also repro’d in node standalone using the CLI.

Additional Information

original issue in vscode: https://github.com/microsoft/vscode/issues/160500

buzzers commented 1 year ago

Debugging found that the error was caused by the WriteCred function returning code 8. This is due to Windows Credential Manager being filled with too many credentials to continue writing, after deleting some saved credentials this error went away. I think the problem that probably needs to be solved most here is the garbled error message. Also I found that just encoding the error message to utf8 displayed it correctly.

@TylerLeonhardt

TylerLeonhardt commented 1 year ago

@buzzers here is a doc we have for a similar issue. Glad you're unblocked.

https://code.visualstudio.com/docs/editor/settings-sync#_windows