vscode: “Unable to write program user data” when invoking VS Code as git editor
- VSCode Version: 1.31.0
- OS Version: Ubuntu 18.04.1 LTS
Steps to Reproduce:
- Enter a git-tracked directory
- Run
GIT_EDITOR='code --wait' git commit --allow-empty - Observe an error dialog appears:
Unable to write program user data.
Please make sure the directory /home/mat/.config/Code is writeable
Just to make sure, I did recursively make that directory world-writable, but it didn’t help.
I tried it with today’s code-insiders build and the issue persists.
Does this issue occur when all extensions are disabled?: Yes
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 24 (7 by maintainers)
Commits related to this issue
- better error message for #68744 — committed to microsoft/vscode by bpasero 5 years ago
SOLVED by deleting the Code directory from /home/MyUserDirectory/.config and then re-starting VScode from the menu.
To be clear: $ code
::Pop up with Unable to write program user data::
$ cd /home/YourUserDirectory/.config $ sudo rm -rf Code [enter your password as needed] $ [no news is good news…so you should only get a prompt back - meaning, the directory and all its contents got deleted] $ code [or launch from the menu] took an extra moment… and then VSCode came right up!
Before this I had tried installing with Anaconda-Navigator, which is where the ‘cannot write’ error started… uninstalled… re-installed Anaconda… no improvement. Then manually uninstalled and re-installed. Still no help… Searched on the error message and found this article… scrolled all the way down… only to find @AHermann94 explaining that manually deleting the folders after uninstalling worked… so I thought I would see what would happen if I just deleted the offending folder… And it WORKED! I figured the program might re-create the folder if it couldn’t find it… looks like it did.
Happy coding!
Curious. I also first installed it with anaconda (after installing anaconda, it asks you if you want to also install vscode). So probably an error in the way anaconda installs it.
This dialog is from us when we get an error of type
EACCESSorEPERMon startup:https://github.com/Microsoft/vscode/blob/ce073b0076ac2f69faf2c609af72f9b81506c791/src/vs/code/electron-main/main.ts#L215L222
Update: I no longer have this problem on VS Code 1.31.1:
I am encountering a different bug, which is that the commit editor always opens in a new window, even when the commit is initiated from the integrated terminal, and even when
--reuse-windowis supplied as an option. I will open a separate issue for that.