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:

  1. Enter a git-tracked directory
  2. Run GIT_EDITOR='code --wait' git commit --allow-empty
  3. 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

Most upvoted comments

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.

Update: I no longer have this problem on VS Code 1.31.1:

$ code --version
1.31.1
1b8e8302e405050205e69b59abb3559592bb9e60
x64

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-window is supplied as an option. I will open a separate issue for that.