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

"KDE envrionment but OS keyring is not available for encryption" while using keepassxc #187842

Closed
hasezoey opened this issue Jul 13, 2023 · 10 comments
Assignees
Labels
electron Issues and items related to Electron upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@hasezoey
Copy link

Type: Bug

Message You're running in a KDE environment but the OS keyring is not available for encryption. Ensure you have kwallet running. keeps showing up with no discernible way to disable it, using keepassxc

Steps to reproduce:

  • have a KDE system (manjaro kde in my case)
  • have kwallted fully disabled
  • have keepassxc installed and Secret Service Integration enabled
  • start vscode while having some sort of secret (like settings sync)

installed keepassxc version extra/keepassxc 2.7.5-2 (project link)

this message did not appear in vscode 1.77 (the version i upgraded from to 1.80)

VS Code version: Code 1.80.0 (660393d, 2023-07-04T13:39:48.236Z)
OS version: Linux x64 6.4.2-3-MANJARO
Modes:

System Info
Item Value
CPUs AMD Ryzen 7 5800X 8-Core Processor (16 x 4350)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 4, 4, 4
Memory (System) 15.53GB (8.63GB free)
Process Argv --unity-launch --crash-reporter-id 3159ccf7-dead-4761-b348-a6094ef14c0c
Screen Reader no
VM 0%
DESKTOP_SESSION plasmawayland
XDG_CURRENT_DESKTOP KDE
XDG_SESSION_DESKTOP KDE
XDG_SESSION_TYPE wayland
Extensions: none
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
py29gd2263:30784847
vscaac:30438847
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
3biah626:30602489
pyind779:30671433
89544117:30613380
pythonsymbol12:30671437
2i9eh265:30646982
showlangstatbar:30737416
vsctsb:30748421
pythonms35:30701012
03d35959:30757346
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixshowwlkth:30771522
hideindicator:30785051
pythongtdpath:30769146
i26e3531:30780429
pythonnosm12tcf:30779713
pythonidxpt:30784022
pythonnocebcf:30776496
e537b577:30786199

@hasezoey
Copy link
Author

also just noticed that if a key is retrieved from keepassxc, vscode 1.80 rejects it (not using it), whereas the previous 1.79.2 does accept it without problems

reverting to vscode 1.79.2 fixes all the issues (no message, settings sync key is not rejected)

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Jul 13, 2023

Can you try these steps to see if it works:

  • Run the vscode command Configure Runtime Arguments
  • in that JSON file, add "password-store": "gnome-libsecret" at the root of the JSON structure

Restart VS Code and see if it works.

In 1.79.2 we used keytar to store things in the keyring. It's been archived so we switched to using an Electron API built on Chromium features instead. My proposal should tell VS Code that you want to use libsecret aka the Secret Service to store secrets... but if it doesn't work we probably have some work to do in Chromium.

@TylerLeonhardt TylerLeonhardt added the info-needed Issue requires more information from poster label Jul 13, 2023
@hasezoey
Copy link
Author

hasezoey commented Jul 13, 2023

Adding it to the runtime arguments works, but then immediately it asks me to delete the old entry, and new undescriptive entries show up named Chrome Safe Storage Control and Chromium Safe Storage instead of the old vscodevscode.github-authentication/github.auth

Edit:
after a closer look at the entries, it seems like Chrome Safe Storage Control is a dummy entry for chrome to detect something
and Chromium Safe Storage seems to store something, but i am not sure what it is, it is smaller than the old vscodevscode.github-authentication/github.auth entry
also both are now request at startup instead of just one

@TylerLeonhardt
Copy link
Member

So the "Safe Storage" part is correct. The way Chromium does things is different than keytar. Rather than storing the entire secret in the keyring, it generates an encryption key, encrypts the secret, and stores the encryption key in the keyring. The secret is encrypted at this point, and can be stored anywhere. We store these encrypted secrets in VS Code's global user storage along with other application state.

So that explains why the size is much smaller than before. Now, I am slightly surprised that it's called Chromium Safe Storage and not Code Safe Storage. I use macOS and I see that it says Code Safe Storage (well Code - Insiders Safe Storage in my case since I'm using Insiders)... It's suppose to use the application name before Safe Storage . @deepak1556 any thoughts on this?

@hasezoey
Copy link
Author

just to fully make it clear, i am using https://aur.archlinux.org/packages/visual-studio-code-bin if that makes a difference

@TylerLeonhardt
Copy link
Member

@deepak1556 unrelated to that, I think since modern kwallet supports libsecret & since libsecret is agnostic of desktop environment, when we detect KDE I think it would be a good idea to also check libsecret.

@TylerLeonhardt TylerLeonhardt added upstream Issue identified as 'upstream' component related (exists outside of VS Code) electron Issues and items related to Electron and removed info-needed Issue requires more information from poster labels Jul 13, 2023
@deepak1556
Copy link
Collaborator

Now, I am slightly surprised that it's called Chromium Safe Storage and not Code Safe Storage

Chromium declares libsecret schema with application name as an attribute whereas the label of the entry is a static constant that currently cannot be configured by embedders. We can polish this but the current state does not cause any harm since entries will be unique per application name.

I will merge this to #187338

@spirillen
Copy link

I'm getting this error despite putting that line into ~/.vscode/argv.json

and new undescriptive entries show up named Chrome Safe Storage Control and Chromium Safe Storage instead of the old vscodevscode.github-authentication/github.auth

And for us who have been studying democracy?? we do not have any google/chromium spyware.

@irfanhakim-as
Copy link

irfanhakim-as commented Aug 2, 2023

I'm having the exact same issue:

You're running in a KDE environment but the OS keyring is not available for encryption. Ensure you have kwallet running.

I do use kwallet on KDE Plasma though and not keepassxc. Is this expected behaviour, for me to get this bug too?

Is there any workaround, and are we expecting a fix for this? It's really time consuming for me to reauthenticate to GitHub through the browser each time I spawn a new repo/VS Code session.

@TylerLeonhardt
Copy link
Member

@irfanhakim-as that is not expected. Can you open a new issue with the output of the command mentioned here in our docs?

https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
electron Issues and items related to Electron upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

5 participants