microsoft / vscode

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

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

Closed sashap8 closed 3 months ago

sashap8 commented 9 months ago

Type: Bug

Reproduction Steps:

  1. Log in to Github.
  2. On VS Code launch, select the Sign In button from the Sign in to use GitHub Copilot pop up window.
  3. Click Allow to the The extension 'GitHub Copilot' wants to sign in using GitHub. window.
  4. From the Open Visual Studio Code? pop up window in your browser select "Open Visual Studio Code".

On redirect to VS Code the expected result is: A successful log in.

The actual result is: A pop up window with the text: An OS keying couldn't be identified for storing the encryption related data in your current desktop environment.

The same issue occurs with any Github login via VS Code ie with the Github Actions VS Code extension using the Sign in to GitHub to access your repositories and GitHub Actions workflows. pop up

VS Code version: Code 1.85.1 (Universal) (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:48:06.308Z) OS version: Darwin arm64 21.2.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M1 (8 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|6, 4, 3| |Memory (System)|16.00GB (0.10GB free)| |Process Argv|--crash-reporter-id 07b68133-6167-4ef3-adf0-83bfea69d0f4| |Screen Reader|no| |VM|0%|
Extensions (27) Extension|Author (truncated)|Version ---|---|--- aws-toolkit-vscode|ama|2.4.0 jsoncrack-vscode|Ayk|2.0.2 vscode-eslint|dba|2.4.2 gitlens|eam|14.6.1 prettier-vscode|esb|10.1.0 vscode-jest-runner|fir|0.4.71 copilot|Git|1.143.0 copilot-chat|Git|0.11.1 vscode-github-actions|git|0.26.2 vscode-graphql|Gra|0.8.20 vscode-graphql-syntax|Gra|1.2.2 graphql-for-vscode|kum|1.15.3 vscode-fix-checksums|leh|1.1.0 dotenv|mik|1.0.1 vscode-docker|ms-|1.28.0 playwright|ms-|1.0.20 black-formatter|ms-|2023.6.0 python|ms-|2023.22.1 vscode-pylance|ms-|2023.12.1 remote-containers|ms-|0.327.0 vsliveshare|ms-|1.0.5900 vsliveshare-pack|ms-|0.4.0 reload|nat|0.0.6 postman-for-vscode|Pos|0.17.0 vscode-yaml|red|1.14.0 partial-diff|ryu|1.4.3 vscode-icons|vsc|12.6.0
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 py29gd2263:30899288 vsclangdf:30486550 c4g48928:30535728 dsvsc012cf:30540253 azure-dev_surveyonecf:30548226 f6dab269:30613381 showlangstatbar:30737416 962ge761:30917236 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixt:30902429 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 2e7ec940:30885897 pythontbext0:30879054 accentitlementsc:30887149 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 aa_t_chat:30882232 cp7184t:30925682 ```
TylerLeonhardt commented 9 months ago

Can you close vscode entirely and run this:

code --verbose --vmodule="*/components/os_crypt/*=1"

More info in the troubleshooting steps:

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

MrAlex94 commented 9 months ago

I am having the same issues. When I try to sign in to sync or Copilot, it will sign me in, but if the window is reloaded, I will not be signed in again.

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

code --verbose --vmodule="*/components/os_crypt/*=1"
2024-01-03 13:26:55.481 Electron[54111:5656755] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
[main 2024-01-03T13:26:55.530Z] [File Watcher (node.js)] Request to start watching: /Users/akontos/Library/Application Support/Code/User (excludes: <none>, includes: <all>, correlationId: <none>),/Users/akontos/Library/Application Support/Code/User/settings.json (excludes: <none>, includes: <all>, correlationId: <none>)
[main 2024-01-03T13:26:55.535Z] Sending env to running instance...
[main 2024-01-03T13:26:55.537Z] [File Watcher (node.js)] Started watching: '/Users/akontos/Library/Application Support/Code/User'
[main 2024-01-03T13:26:55.537Z] [File Watcher (node.js)] Started watching: '/Users/akontos/Library/Application Support/Code/User/settings.json'
[main 2024-01-03T13:26:55.545Z] Sent env to running instance. Terminating...
[main 2024-01-03T13:26:55.545Z] Lifecycle#kill()
[main 2024-01-03T13:26:55.545Z] Lifecycle#onWillShutdown.fire()
TylerLeonhardt commented 9 months ago

@MrAlex94

Sending env to running instance...

Please make sure you close VS Code entirely. On macOS, make sure the process isn't still running even though there are no windows

MrAlex94 commented 9 months ago

@MrAlex94

Sending env to running instance...

Please make sure you close VS Code entirely. On macOS, make sure the process isn't still running even though there are no windows

I think I know the issue - after making sure every process related to VSCode was terminated, I was prompted to enter my local macOS account password so VSCode could access my keychain upon launch.

I had done so on the previous session, but it would be surprising to find out that access may be time limited? I would assume once a process is granted privilege it remains until the process is terminated.

deepak1556 commented 9 months ago

I had done so on the previous session,

Did you choose Always Allow in the prompt ?

luke-lacroix-healthy commented 9 months ago

I seem to be having the same issue except that I'm not getting prompted on VSCode start for the password for the keychain. This is with VSCode 1.85.1 and MacOS Sonoma 14.2.1 (23C71). I ended up deleting the "Code Safe Storage" password from Keychain Access. This did not immediately have an effect but, after restarting MacOS, the password was created again and VSCode was able to store the github logins again.

The new key has the following access:

image

While the old key had the "Allow all applications to access this item" item checked and the application list at the bottom was empty.

RashawnXue commented 7 months ago

I had encountered the same question. After I tried to delete the github password stored in my MacOS system settings, it seems that everything goes smoothly. 🧐

MrAlex94 commented 6 months ago

I had done so on the previous session,

Did you choose Always Allow in the prompt ?

I don't get the option. When it happens again, I'll add a screenshot.

vscodenpa commented 4 months ago

Hey @deepak1556, this issue might need further attention.

@sashap8, you can help us out by closing this issue if the problem no longer exists, or adding more information.

vscodenpa commented 3 months ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!