microsoft / vscode

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

Updating a setting sometimes just silently fails and switches back #233230

Open amunger opened 1 week ago

amunger commented 1 week ago

I've had a couple instances of not being able to update settings until restarting vs code. It looks like a permissions error when trying to update the settings file.

Error while writing to User Settings. Unable to write file 'vscode-userdata:/c:/Users/aaron/AppData/Roaming/Code - Insiders/User/settings.json' (NoPermissions (FileSystemError): Error: EPERM: operation not permitted, rename 'c:\Users\aaron\AppData\Roaming\Code - Insiders\User\settings.json.vsctmp' -> 'c:\Users\aaron\AppData\Roaming\Code - Insiders\User\settings.json')

It's a very frustrating experience since it looks like the setting is updated, and if you navigate away from the settings UI, it just fails and silently switches back several seconds later.

I had 6 different windows open, including the Extension Dev host, though none of them had the settings json open.

This is on a Windows Arm machine.

sandy081 commented 4 days ago

Are you updating the setting from Settings Editor?

amunger commented 4 days ago

yes, I did not try through editing the .json directly

sandy081 commented 3 days ago

This is an Atomic write and I would ask @bpasero insights why the save is causing you perm issue.

bpasero commented 1 day ago

MS defender involved?