vscode: Allow safestorage api to detect presence of libsecret or kwallet if the desktop environment is unknown
Does this issue occur when all extensions are disabled?: Yes
- Version: 1.80.0-insider
- Commit: 6545c4c2671127c323182225963fcd732e1fbcc5
- Date: 2023-06-15T05:34:31.245Z
- Electron: 22.5.7
- Chromium: 108.0.5359.215
- Node.js: 16.17.1
- V8: 10.8.168.25-electron.0
- OS: Linux x64 6.1.0-9-amd64
- Distro: Debian sid/unstable
Steps to Reproduce:
- Open vscode
- Authenticate on github
- Close vscode
- Open vscode again
vscode will ask again for authentication.
Description
Latest insiders version seems to have problems handling the github session storage on the keyring, It asks for login every time the application is opened.
I have checked this guide: https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues
Everything works fine in the stable version. If I delete the keyring the stable version asks to create a new one, the insiders version does not.
Also have tried wiping all the insiders version config files and start from scratch without any luck.
Logs
Github authentication logs when opening vscode:
2023-06-15 13:02:34.802 [info] Reading sessions from keychain...
2023-06-15 13:02:34.802 [info] Getting sessions for all scopes...
2023-06-15 13:02:34.802 [info] Getting sessions for user:email...
2023-06-15 13:02:34.802 [info] Getting sessions for user:email...
2023-06-15 13:02:34.802 [info] Getting sessions for read:user...
2023-06-15 13:02:34.802 [info] Getting sessions for read:user...
2023-06-15 13:02:34.802 [info] Got 0 sessions for ...
2023-06-15 13:02:34.802 [info] Got 0 sessions for user:email...
2023-06-15 13:02:34.802 [info] Got 0 sessions for user:email...
2023-06-15 13:02:34.802 [info] Got 0 sessions for read:user...
2023-06-15 13:02:34.802 [info] Got 0 sessions for read:user...
2023-06-15 13:02:34.802 [info] Getting sessions for all scopes...
2023-06-15 13:02:34.802 [info] Got 0 sessions for ...
2023-06-15 13:02:34.942 [info] Getting sessions for read:user...
2023-06-15 13:02:34.942 [info] Got 0 sessions for read:user...
2023-06-15 13:02:34.942 [info] Getting sessions for user:email...
2023-06-15 13:02:34.942 [info] Got 0 sessions for user:email...
2023-06-15 13:02:35.011 [info] Getting sessions for all scopes...
2023-06-15 13:02:35.011 [info] Got 0 sessions for ...
After logging in:
2023-06-15 14:05:40.593 [info] Logging in for the following scopes: user:email
2023-06-15 14:05:40.594 [info] Trying without local server... (user:email)
2023-06-15 14:05:41.790 [info] Exchanging code for token...
2023-06-15 14:05:42.145 [info] Token exchange success!
2023-06-15 14:05:42.149 [info] Getting user info...
2023-06-15 14:05:42.481 [info] Got account info!
2023-06-15 14:05:42.482 [info] Storing 1 sessions...
2023-06-15 14:05:42.487 [error] Setting token failed: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.
2023-06-15 14:05:42.487 [info] Stored 1 sessions!
2023-06-15 14:05:42.487 [info] Login success!
2023-06-15 14:05:42.492 [info] Getting sessions for user:email...
2023-06-15 14:05:42.492 [info] Got 1 sessions for user:email...
2023-06-15 14:05:42.493 [info] Getting sessions for user:email...
2023-06-15 14:05:42.493 [info] Got 1 sessions for user:email...
2023-06-15 14:05:42.497 [info] Getting sessions for user:email...
2023-06-15 14:05:42.497 [info] Got 1 sessions for user:email...
2023-06-15 14:05:42.497 [info] Getting sessions for user:email...
2023-06-15 14:05:42.497 [info] Got 1 sessions for user:email...
2023-06-15 14:05:42.513 [info] Getting sessions for user:email...
2023-06-15 14:05:42.513 [info] Got 1 sessions for user:email...
2023-06-15 14:05:42.514 [info] Getting sessions for read:user...
2023-06-15 14:05:42.514 [info] Got 0 sessions for read:user...
2023-06-15 14:05:42.527 [info] Getting sessions for user:email...
2023-06-15 14:05:42.527 [info] Got 1 sessions for user:email...
Never seen this error before:
[error] Setting token failed: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 3
- Comments: 30 (16 by maintainers)
Commits related to this issue
- First move off of keytar (#185077) * First move off of keytar Since keytar is now deprecated, we need a solution going forward. That solution is the electron safeStorage API. This PR: * Uses the El... — committed to microsoft/vscode by TylerLeonhardt a year ago
- Only delete credentials from the old place if the new place is persisted storage ref #185212 — committed to microsoft/vscode by TylerLeonhardt a year ago
- Only delete secrets from the old place if the new place is persisted storage (#185260) Only delete credentials from the old place if the new place is persisted storage ref #185212 — committed to microsoft/vscode by TylerLeonhardt a year ago
- Notify user once when Encryption isn't available And point to troubleshooting doc. ref https://github.com/microsoft/vscode/issues/185212 — committed to microsoft/vscode by TylerLeonhardt a year ago
- Notify user once when Encryption isn't available (#185390) And point to troubleshooting doc. ref https://github.com/microsoft/vscode/issues/185212 — committed to microsoft/vscode by TylerLeonhardt a year ago
@TylerLeonhardt the desktop env is
X-Generic
from https://github.com/microsoft/vscode/issues/185212#issuecomment-1605261078@Krohitkrishna12 the flow you are seeing is expected in your case as the runtime is unable to detect the storage backend, I have kept this issue open to see if it can be addressed on the runtime side.
You have two options as workaround in your scenario,
@deepak1556 no but i did see the password store set to basic_text which i updated to gnome and everything seems to work as before now. Thank you for the help. i will remove and try when i update to see if the issue gets fixed.
To clarify, before opting to use the weaker encryption. Did you try
"password-store": "gnome"
option ?If you had opted to use the weaker encryption, then if you open the runtime settings file via
Configure Runtime Arguments
there will be an entry"password-store": "basic_text"
. You can unset this entry when this issue gets closed to get a proper fix.If VSCode updates to use a different storage backend then your persisted sessions will be cleared and VSCode will ask you to re-authenticate. So you don’t need to do any work to clear them out.
@deepak1556 i can continue using Weaker encryption as long as its okay to use and creds are fairly safe 😉. is there any way to reset or undo using weaker encryption so i can see if future update would fix the issue? Also any way to clear the creds that vsccode currently stores with weaker encryption?
i use Debian Linux 11 container in Chrome os Stable @TylerLeonhardt. I Currently overwrote the desktop environment variable from X-generic to Gnome to see if it helps. But sadly no. i dont know if reverting it back would gain anything.
Same problem here on latest insiders, however I do have
XDG_CURRENT_DESKTOP
set in my environment:I use
gnome-keyring-daemon
, and this all worked fine until the recentcode-insiders
change.Currently I get the expected (automatic) login behavior if I do:
UPDATE: After a little reading here, I realized
sway
might not be an appropriate setting for this variable.Yes atleast from reading through the implementation, this will allow the runtime to use the text fallback without any need for restart or user intervention. I will confirm and get back.
Yes I’m using gnome-keyring, and it works fine with previous insiders release and with the stable release.
Rolled back to version 1.80.0-1686734381 and everything works fine again. So I’m staying in that version meanwhile. If anyone needs the previous version it can be found here: packages.microsoft.com/repos/code/pool/main/c/code-insiders/code-insiders_1.80.0-1686734381_amd64.deb