microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.05k stars 29.22k forks source link

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

Open Konglomneshued opened 1 year ago

Konglomneshued commented 1 year ago

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.

deepak1556 commented 9 months ago

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: 59fb28097d54d21729e591ed8af0e4de8fb53ea2

linux-arm64 linux-armhf linux-x64

Steps to test:

ItzDerock commented 9 months ago

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.

BlueskyFR commented 9 months ago

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

Android789515 commented 8 months ago

Looks like an update has fixed the issue for me.

My config is still:

"password-store": "gnome-libsecret"
als-creator commented 7 months ago

OS: ArcoLinux x86_64 DE: Xfce 4.18 it's work: yay -S gnome-keyring kate ~/.vscode/argv.json and paste "password-store": "gnome-libsecret" reboot sync settings vscode

but I’m wondering if it’s possible to get rid of this problem altogether, why do we need a keychain in this editor, and is it possible to somehow simplify this action? if this is only needed to sync settings, then there must be an easier way

jackokring commented 7 months ago

I'm using seahorse. Have you added the default "login" keystore? Not sure if it's needed. Added "password-store": "gnome-libsecret" and after collapsing the side nav bar it (the april release) no longer locks up and works (after overnight). VSCode should not be issuing git commands through the terminal session. VSCode should not be running /bin/python /home/jackokring/.vscode/extensions/ms-python.python-2024.4.0/python_files/printEnvVariablesToFile.py /home/jackokring/.vscode/extensions/ms-python.python-2024.4.0/python_files/deactivate/bash/envVars.txt in the terminal context. The terminal should behave like a system terminal and not be a proxy for lazy exec programming.

Chromebook. arm64.

nengxu commented 6 months ago

OS: Endeavouros 64 DE: Lxqt need to add "password-store": "gnome-libsecret" to ~/.vscode/argv.json to fix this problem.

als-creator commented 6 months ago

OS: Endeavouros 64 DE: Lxqt need to add "password-store": "gnome-libsecret" to ~/.vscode/argv.json to fix this problem.

i use "password-store": "basic", it's work after reboot on xfce 4.18

mathklk commented 2 months ago

I'm using Vscode 1.92.2 on Ubuntu 24.04 and had a similar issue where vscode would hang up when it tried to connect to the internet

This was the last line in the log before vscode hang up:

main 2024-08-26T14:13:58.031Z] [EncryptionMainService] Checking if encryption is available...

For me, "password-store": "basic" fixed it. Thanks @als-creator