microsoft / vscode

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

Git Commit Ament caused "Git: connect ENOENT" error #193108

Open dzavodnikov opened 1 year ago

dzavodnikov commented 1 year ago

Type: Bug

  1. Work with IDE some period of time.
  2. Try to make Git Commit Amend.
  3. Got "Git: connect ENOENT /var/folders/_x/pjn2dmxx0tl9dgnhgryk54n80000gp/T/vscode-git-299f631f9b.sock".

VS Code version: Code 1.82.1 (6509174151d557a81c9d0b5f8a5a1e9274db5585, 2023-09-08T08:49:22.656Z) OS version: Darwin arm64 22.6.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M1 Pro (10 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)|3, 3, 3| |Memory (System)|32.00GB (0.79GB free)| |Process Argv|--crash-reporter-id 85479485-0e20-4bb1-8875-f05e0b4bf5e2| |Screen Reader|no| |VM|0%|
Extensions (31) Extension|Author (truncated)|Version ---|---|--- markdown-mermaid|bie|1.19.0 java-pmd|cra|0.6.3 xml|Dot|2.5.1 es7-react-js-snippets|dsz|4.4.3 prettier-vscode|esb|10.1.0 go|gol|0.39.1 rest-client|hum|0.25.1 Kotlin|mat|1.7.1 git-graph|mhu|1.30.0 vscode-docker|ms-|1.26.0 black-formatter|ms-|2023.4.1 python|ms-|2023.16.0 remote-containers|ms-|0.309.0 fabric8-analytics|red|0.7.0 java|red|1.22.1 vscode-yaml|red|1.14.0 rust-analyzer|rus|0.3.1657 vscode-checkstyle|she|1.4.2 code-spell-checker|str|3.0.1 code-spell-checker-russian|str|2.1.0 even-better-toml|tam|0.19.2 pdf|tom|1.2.2 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.2.30 vscode-gradle|vsc|3.12.7 vscode-java-debug|vsc|0.54.0 vscode-java-dependency|vsc|0.23.1 vscode-java-pack|vsc|0.25.14 vscode-java-test|vsc|0.39.1 vscode-maven|vsc|0.42.0 volar|Vue|1.8.11
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 vscoreces:30445986 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 vsclangdc:30486549 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 vscccc:30803845 2e4cg342:30602488 89544117:30613380 showlangstatbar:30737416 962ge761:30835153 03d35959:30757346 pythonfmttext:30731395 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 pythonnosmt12:30797651 pythonidxpt:30805730 pythonnoceb:30805159 dsvsc013:30795093 dsvsc014:30804076 diffeditorv2:30821572 dsvsc015cf:30829746 ```
yoyo837 commented 1 year ago

Same here, It can only be restored to works by restarting vscode, and still occurs several times a day.

> git -c user.useConfigOnly=true commit --quiet
→ No staged files match any configured task.
Error: connect ENOENT /var/folders/_v/rdq8cmks24jgvtkk5sypbgw00000gn/T/vscode-git-0698a41bdc.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'connect',
  address: '/var/folders/_v/rdq8cmks24jgvtkk5sypbgw00000gn/T/vscode-git-0698a41bdc.sock'
}
error: There was a problem with the editor '"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/git-editor.sh"'.
Please supply the message using either -m or -F option.
dzavodnikov commented 1 year ago

Same problem in 1.82.2

Tazmondo commented 1 year ago

I've noticed, for me at least, the error only occurs if you leave the commit message blank. If you write a new commit message before pressing amend it works.

So maybe the error happens with the file that opens where it prompts you to edit the previous commit message?

daenamkim commented 1 year ago

It seems no issue anymore in Version: 1.83.0 according to tested myself and it looks gone

rami3l commented 1 year ago

It seems no issue anymore in Version: 1.83.0 according to tested myself and it looks gone

I'm sad to find out that it is not fixed on my side with macOS 14.0:

Version: 1.83.0
Commit: e7e037083ff4455cf320e344325dacb480062c3c
Date: 2023-10-03T16:13:10.518Z (5 days ago)
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 23.0.0

... and unfortunately I have not found out a stable way to reproduce this.

daenamkim commented 1 year ago

Oh that's interesting. You are totally same environment with me 😭

> code --version
Version: 1.83.0
Commit: e7e037083ff4455cf320e344325dacb480062c3c
Date: 2023-10-03T16:13:10.518Z (5 days ago)
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 23.0.0
unional commented 1 year ago

Same issue on WSL:

Error: connect ENOENT /run/user/1000/vscode-git-b1cb36cc26.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'connect',
  address: '/run/user/1000/vscode-git-b1cb36cc26.sock'
}
error: There was a problem with the editor '"/home/homa/.vscode-server/bin/f1b07bd25dfad64b0167beb15359ae573aecd2cc/extensions/git/dist/git-editor.sh"'.
code --version
1.83.1
f1b07bd25dfad64b0167beb15359ae573aecd2cc
x64

Reload Window does not help. I have to restart the computer (or maybe somehow kill wsl).

First time seeing this, in 1.83.1

rami3l commented 1 year ago

@unional In my case quitting and relaunching VSCode helps.

unional commented 1 year ago

@unional In my case quitting and relaunching VSCode helps.

Thanks. I only encounter this once but will keep that in mind and try that next time.

unional commented 1 year ago

@unional In my case quitting and relaunching VSCode helps.

Just encounter this again. And quitting VScode does not fix it.

even running wsl --shutdown does not fix it.

unional commented 1 year ago

Encounter it again. Seems like it happens quite often.

Version: 1.83.1 (user setup)
Commit: f1b07bd25dfad64b0167beb15359ae573aecd2cc
Date: 2023-10-10T23:48:05.904Z
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22621
Roang-zero1 commented 11 months ago

I had the same issue and the problem on my side was that $XDG_RUNTIME_DIR did not exist. For some reason the WSL Ubuntu set it to a non-existent /run/user/1000. I fixed the error by creating the directory like this:

sudo mkdir /run/user/1000/
sudo chown 1000:1000 /run/user/1000/

and issuing a Reload Window.

I think there is some error in some clean-up logic that accidentally removes the folder instead of the socket, which would explain why it breaks intermittently. Just a theory, I didn't have the time to investigate.

Wizard-one commented 11 months ago

same problem in

Version: 1.84.2 (user setup)
Commit: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
Date: 2023-11-09T10:51:52.184Z
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22621
dr1nf3rn0 commented 10 months ago

Changing permissions on /run/user/1000 fixed error for me

dzavodnikov commented 8 months ago

I did not see that problem anymore in 1.86.2.

yoyo837 commented 8 months ago

I did not see that problem anymore in 1.86.2.

Yes, I think this issue may have been fixed.

hakula139 commented 8 months ago

I'm still facing the same problem in 1.87.1. Restarting VS Code does fix it, but I really hate restarting it with lots of workspaces open once every several hours. It seems I can easily reproduce it when I put my laptop (macOS) to sleep, and after a while wake it up. Since I've been experiencing this problem for at least several months, I think the bug still exists and requires a fix.

DanielSchmidt-Precitec commented 5 months ago

I also encountered this problem with VS Code 1.90.0 on Debian 12.

There was a different .sock file in /run/user/1000/ than the one VS Code expected. Reloading the VS Code window fixed it for me.

kmowledge commented 5 months ago

As @Tazmondo mentioned, in my case as well it occurred in correlation with editing last commit with "amend" (it happened once, I haven't used this option since so it's an unconfirmed info). Can we have it fixed to use "amend" safely? Or some workaround?

galenhwang commented 3 months ago

running below fixes it for me

pkill -f 'code'

Reload Window or Quit Visual Code Studio isn't always sufficient

in my case, i confirmed the /run/user/1001/vscode-ipc-...d61.sock file didn't even exist. so i think actually force killing all vscode processes forces vscode to recreate the socket connection file

hippietrail commented 3 weeks ago

Just ran into this. Not making learning git any less challenging:

Version: 1.94.2 Commit: 384ff7382de624fb94dbaf6da11977bba1ecd427 Date: 2024-10-09T16:08:44.566Z Electron: 30.5.1 ElectronBuildId: 10262041 Chromium: 124.0.6367.243 Node.js: 20.16.0 V8: 12.4.254.20-electron.0 OS: Darwin arm64 24.0.0