vscode: Linux: An OS keyring couldn't be identified for storing the encryption related data in your current desktop environment

Does this issue occur when all extensions are disabled?: Yes

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

This is the error part of my log after running code-insiders --verbose --vmodule="*/components/os_crypt/*=1":

[314774:0707/210405.156953:INFO:CONSOLE(627)] "%cTRACE color: #888 [mainThreadSecretState] Setting password for vscode.github-authentication extension:  github.auth", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210405.157113:INFO:CONSOLE(627)] "%cTRACE color: #888 [NativeSecretStorageService] Notifying user that secrets are not being stored on disk.", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210405.158116:INFO:CONSOLE(627)] "%cTRACE color: #888 DialogService#prompt An OS keyring couldn't be identified for storing the encryption related data in your current desktop environment.", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.420345:INFO:CONSOLE(627)] "%cTRACE color: #888 [secrets] encrypting secret for key: {"extensionId":"vscode.github-authentication","key":"github.auth"}", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[main 2023-07-08T02:04:09.420Z] [EncryptionMainService] Encrypting value.
[main 2023-07-08T02:04:09.422Z] Error: Error while encrypting the text provided to safeStorage.encryptString. Encryption is not available.
    at e.$U2b.encrypt (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:42:11004)
    at Object.call (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:25:4844)
    at R.s (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:23:5128)
    at R.q (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:23:4644)
    at o.value (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:23:4051)
    at y.w (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:18:1906)
    at y.x (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:18:1976)
    at y.fire (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:18:2192)
    at o.value (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:16:38681)
    at y.w (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:18:1906)
    at y.fire (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:18:2123)
    at o.value (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:16:38875)
    at y.w (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:18:1906)
    at y.fire (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:18:2123)
    at se (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:16:41018)
    at IpcMainImpl.f (/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-main/main.js:19:96358)
    at IpcMainImpl.emit (node:events:513:28)
    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:80979)
    at EventEmitter.emit (node:events:513:28)
[314774:0707/210409.425211:INFO:CONSOLE(627)] "%c  ERR color: #f33 Error: Error while encrypting the text provided to safeStorage.encryptString. Encryption is not available.", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.425442:INFO:CONSOLE(627)] "%cTRACE color: #888 Settings Sync: Getting accounts for github", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.425641:INFO:CONSOLE(627)] "%c INFO color: #33f Settings Sync: Updated current session 8103a56381b60bac", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.425835:INFO:CONSOLE(627)] "%cTRACE color: #888 Settings Sync: Getting accounts for github", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.426026:INFO:CONSOLE(627)] "%cTRACE color: #888 Settings Sync: Updated accounts for github", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.426214:INFO:CONSOLE(627)] "%cTRACE color: #888 Settings Sync: Getting accounts for microsoft", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.426428:INFO:CONSOLE(627)] "%cTRACE color: #888 Settings Sync: Updated accounts for github", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.426630:INFO:CONSOLE(627)] "%cTRACE color: #888 Settings Sync: Getting accounts for microsoft", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.426816:INFO:CONSOLE(627)] "%cTRACE color: #888 Settings Sync: Updated accounts for microsoft", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.426981:INFO:CONSOLE(627)] "%cTRACE color: #888 Settings Sync: Updating the token for the account Android789515", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.427124:INFO:CONSOLE(627)] "%cTRACE color: #888 Settings Sync: Token updated for the account Android789515", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.427693:INFO:CONSOLE(627)] "%cTRACE color: #888 Settings Sync: Updated accounts for microsoft", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.427861:INFO:CONSOLE(627)] "%cTRACE color: #888 Settings Sync: Updating the token for the account Android789515", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
[314774:0707/210409.428010:INFO:CONSOLE(627)] "%cTRACE color: #888 Settings Sync: Token updated for the account Android789515", source: vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (627)

Version: 1.81.0-insider Commit: ad791ef3d26b99963da31636af697afd86575435 Date: 2023-07-07T19:47:36.821Z Electron: 22.3.14 ElectronBuildId: 21893604 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Linux x64 6.4.1-arch2-1

I have gnome-keyring installed and it’s not using it for some reason. Must be the update to 1.80.

Manually configuring the keyring to use results in this:

code-insiders --password-store="gnome"
Warning: 'password-store' is not in the list of known options, but still passed to Electron/Chromium.

It seems to work.

I figured this is a bug since I had gnome-keyring installed, it wasn’t being used, and I had to manually configure it.

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 48
  • Comments: 108 (12 by maintainers)

Most upvoted comments

Same happening on Arch with awesomewm. Adding "password-store": "gnome" to ~/.vscode/argv.json fixed the issue.

I’ve just tried setting “gnome-libsecret” instead of “gnome” and everything works again! @Android789515 can you try it too?

I tried to setup the runtime args according to the support article I listed: image

Same issue on Sway and my gnome-keyring-daemon is correctly set-up.

Launching code with code --password-store="gnome" as suggested here works.

Same happening for me just after upgrading to 1.86.0. Fixed by setting gnome-libsecret instead of gnome!

Hey @pavelxdd, your suggestion worked for me. Thank you!

However, I find it strange that the VS Code docs say this:

gnome: This option will first try the gnome-libsecret option implementation and then if that fails, it will fallback to the gnome-keyring option implementation.

This implies that the default behavior should work, but it doesn’t seem to.

I am also seeing this on Arch with XMonad using gnome-keyring.

This did not fix it:

❯ code --password-store "gnome" .
Warning: 'password-store' is not in the list of known options, but still passed to Electron/Chromium.

This did:

❯ cat ~/.vscode/argv.json
{
	"enable-crash-reporter": true,
	"crash-reporter-id": "<snip>",
	"password-store": "gnome"
}

System info:

❯ pfetch                  
       /\         jess@grace
      /  \        os     Arch Linux
     /\   \       host   x86_64
    /      \      kernel 6.4.2-arch1-1
   /   ,,   \     uptime 5h 8m
  /   |  |  -\    pkgs   537
 /_-''    ''-_\   memory 4205M / 64118M

❯ yay -Q --info gnome-keyring
Name            : gnome-keyring
Version         : 1:42.1-3
Description     : Stores passwords and encryption keys
Architecture    : x86_64
URL             : https://wiki.gnome.org/Projects/GnomeKeyring
Licenses        : GPL  LGPL
Groups          : gnome
Provides        : org.freedesktop.secrets
Depends On      : gcr  gcr-4  pam  openssh
Optional Deps   : None
Required By     : seahorse
Optional For    : git  github-cli  google-chrome  libsecret  microsoft-edge-stable-bin  slack-desktop  visual-studio-code-bin
Conflicts With  : None
Replaces        : None
Installed Size  : 3.55 MiB
Packager        : Balló György <bgyorgy@archlinux.org>
Build Date      : Wed 07 Jun 2023 03:41:13 AM PDT
Install Date    : Thu 08 Jun 2023 09:51:51 AM PDT
Install Reason  : Explicitly installed
Install Script  : Yes
Validated By    : Signature

For reference, if helpful, in such systems it’s common to start xmonad in this manner (this is my .xinitrc):

❯ cat .xinitrc 
#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

# Start window manager, which manages the rest of the startup sequence.
# Compiled by `cabal install` in `~/.xmonad`.
exec /home/jess/.cabal/bin/xmonad

Finally, gnome-keyring is initialized on login via PAM:

❯ cat /etc/pam.d/login
#%PAM-1.0

auth       required     pam_securetty.so
auth       requisite    pam_nologin.so
auth       include      system-local-login
auth       optional     pam_gnome_keyring.so            <- here
account    include      system-local-login
session    include      system-local-login
session    optional     pam_gnome_keyring.so auto_start <- here

Can this be fixed for the infinite number of users having this problem? Seems like every time someone installs vscode he has to open this thread

Same for me. i3wm on Manjaro 23.0.0

Same issue with an i5, and "password-store": "gnome" fixes it.

Version: 1.80.0 Commit: 660393deaaa6d1996740ff4880f1bad43768c814 Date: 2023-07-04T13:39:48.236Z Electron: 22.3.14 ElectronBuildId: 21893604 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Linux x64 5.15.108-18910-gab0e1cb584e1

Also getting this, even though it seems to be working: Property password-store is not allowed. in argv.json image

If you are in a situation where "password-store": "gnome" in argv.json no longer works, sorry for the breakage there was a behavior change in the runtime that got missed in the runtime update. Both gnome and gnome-keyring values are removed in favor of gnome-libsecret. We will prepare a candidate fix for 1.86.1 release.

For those with NixOS, I spotted that there’s now a fix in master while investigating this (Thanks @BlankParticle): https://github.com/NixOS/nixpkgs/commit/ed2f5f18292f238762fde3a2076ee727c029e917

(Also, hint for others can be to check your LD_LIBRARY_PATH, turned out mine was messed up so I had to fix that too)

Anyone able to make it work on NixOS?

home.file.".vscode/argv.json" = {
    force = true;
    text = ''
      {
      	// "disable-hardware-acceleration": true,
      	"enable-crash-reporter": true,
      	// Unique id used for correlating crash reports sent from this instance.
      	// Do not edit this value.
      	"crash-reporter-id": "YOUR_CRASH_ID_HERE",
        "password-store": "gnome"
      }
    '';
  };

I just write the argv.json and call it a day

mann why do none of those work for me… what pkg do you have for vs code on arch guys? I use code code-features and code-marketplace

I am using visual-studio-code-bin 1.81.0-1 from AUR and setting:

	"password-store": "gnome"

in argv.json works. Of course, for this to work, you need to install and setup gnome-keyring-daemon. The guide I used.

Same happening for me on Sway after upgrade to 1.86.0 I have “password-store”: “gnome” in argv.json which no longer works.

Solution if you’re using a non-popular window manager

1. install `gnome-keyring libsecret`. On arch you can run `sudo pacman -S gnome-keyring libsecret`

2. open vscode by terminal `code --password-store="gnome"`

3. If this solution works for you, you can persist the value of password-store by opening the Command Palette (Ctrl+Shift+P) and running the Preferences: Configure Runtime Arguments command. This will open the argv.json file where you can add the setting "password-store":"gnome" (this step is from https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues).

This is no longer working for me.

My config:

{
	// Use software rendering instead of hardware accelerated rendering.
	// This can help in cases where you see rendering issues in VS Code.
	// "disable-hardware-acceleration": true,
	"password-store": "gnome",
	// Allows to disable crash reporting.
	// Should restart the app if the value is changed.
	"enable-crash-reporter": false,
	// Unique id used for correlating crash reports sent from this instance.
	// Do not edit this value.
	...
}

What I see: image

Can confirm that manually adding "password-store": "gnome" to the argv.json file worked (on Arch Linux, BSPWM, VSCode 1.80.1).

Had to add the arg manually after running code with code --password-store="gnome" failed to work.

Same happening on Ubuntu 22.04 with i3wm. Adding "password-store": "gnome" to ~/.vscode/argv.json fixed the issue.

Also happens on Chromebook. The password-store workaround did the trick.

Same issue on Debian 11 (ChromeOS)/aarch64 with version 1.80

argv.json password-store: gnome workaround successful.

From #187436.

I’m using archlinux with hyprland as desktop environment. To manage my keyring I have installed kwallet.

The pop-up disappear when I set password-store to kwallet5.


Additionally I’ve configured dbus to start the service automatically by creating the file /usr/share/dbus-1/services/org.freedesktop.secrets.service with the content:

[D-BUS Service]
Name=org.freedesktop.secrets
Exec=/usr/bin/kwalletd5

I don’t know if it’s possible for vscode to use the service configured in org.freedesktop.secrets as keyring manager 🤔

I’m seeing this issue as well on Arch running XMonad.

Looks like an update has fixed the issue for me.

My config is still:

"password-store": "gnome-libsecret"

For users who had "password-store": "gnome" stopped working, can you please help test whether it works again in the following build

VS Code Build: 59fb280

linux-arm64 linux-armhf linux-x64

Steps to test:

  • Extract and run the build with code-insiders --user-data-dir /tmp/test-argv-check
  • Set "password-store": "gnome" in argv.json
  • Confirm that authentication works as expected.

Can confirm that this build fixed the issue for me.

Solution if you’re using a non-popular window manager

  1. install gnome-keyring libsecret. On arch you can run sudo pacman -S gnome-keyring libsecret
  2. open vscode by terminal code --password-store="gnome"
  3. If this solution works for you, you can persist the value of password-store by opening the Command Palette (Ctrl+Shift+P) and running the Preferences: Configure Runtime Arguments command. This will open the argv.json file where you can add the setting “password-store”:“gnome” (this step is from https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues).

@sashap8 can you open a separate issue? It’s probably not related to Linux.

When you open it, please follow the troubleshooting steps to make sure that you include the necessary information.

Ask 10 Persons, and you get 15 answers…here we go:

export DESKTOP_SESSION=xfce
code

on i3 will also do the job. Just checked on my Arch Linux i3 Desktop.

I had This Issue for a while on the Linux Mint . This worked: you can make the flag permanent by editing the code-flags.conf file in your .config directory. To do this, open your terminal type nano ~/.config/code-flags.conf, and press enter. This will open the file in a text editor. In the file, add a new line with the flag --password-store=“gnome” and save the file by pressing Ctrl+O and then Ctrl+X.

That didn’t work for me, as well as many people in this thread, if the solution was that simple, I wouldn’t have gone through the trouble of trying 20 previous versions until I found a working one.

Same issue with sway on Arch Linux. According to this doc it seems we indeed need to setup the keyring. What I did:

  • install gnome-keyring (since it wasn’t installed by default with sway)
  • add either "password-store"="gnome" in .vsode/argv.json or --password-store=gnome in .config/code-flags.conf
  • launch VSCode and setup a password for gnome-keyring

Quite annoying to have to install gnome-keyring (or whatever supported keyring).

Came here, to say thank you for the workaround, facing the same issue on Arch + Sway.

Adding "password-store": "gnome" to ~/.vscode/argv.json worked for me on Fedora 37 with i3wm.

Fedora/i3wm, same issue.

It seems that last VsCode update broke everything for everyone not using a “standard” Linux distribution.

Same issue with Manjaro/i3 here, and the flag fixed it for me but is not satisfying

Got the same error in Xfce4, using gnome-keyring


Adding "password-store": "gnome" to ~/.vscode/argv.json solved it.

I am using:

❯ neofetch --stdout
zaid@archlinux
--------------
OS: Arch Linux x86_64
Host: 20DSS02V00 ThinkPad L450
Kernel: 6.1.38-1-lts
Uptime: 7 mins
Packages: 534 (pacman)
Shell: bash 5.1.16
Resolution: 1366x768
DE: Xfce 4.18
WM: Xfwm4
WM Theme: Default
Theme: Adwaita-dark [GTK2/3]
Icons: elementary [GTK2], Adwaita [GTK3]
Terminal: alacritty
CPU: Intel i3-5005U (4) @ 2.000GHz
GPU: Intel HD Graphics 5500
Memory: 1813MiB / 7832MiB
❯ gnome-keyring version
gnome-keyring: 42.1

Same for me, using EndeavourOS 6.4.1-arch2-1 and qtile.