Buffers running out of space
Version
Microsoft Windows [Version 10.0.19044.2546]
WSL Version
- [X] WSL 2
- [ ] WSL 1
Kernel Version
Linux version 5.15.79.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Wed Nov 23 01:01:46 UTC 2022
Distro Version
NixOS-23.05.20230207.7479275
Other Software
$ code --version
1.75.1
441438abd1ac652551dbe4d408dfcec8a499b8bf
x64
Repro Steps
- Start WSL terminal
- Start VSCode with WSL as remote
- Edit files, commit and push stuff. Working normally.
Expected Behavior
- Try to open new tab or VSCode remote connection
- Connection opens without error
Actual Behavior
PS C:\Users\ariel.richtman> wsl
An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.
Error code: Wsl/Service/0x80072747
Diagnostic Logs
If resource limits are being exceeded you'll get this kind of error messages. Is your system running out of memory?
Not that I saw, it was idling at ~20/32 GiB. CPU was similarly low with no spikes. It's a laptop i7 if that helps. That said it could be the VM it's running on not getting enough share of non-compressible resources.
Also getting this after using Jetbrains IDEs to connect to WSL, no abnormal resource usage, but WSL memory usage is quite high at 8GB when the issue happens.
For what it's worth I stopped using VSCode and haven't had the issue reoccur.
I'm at 52% of my ram which totals 32GB and I keep getting this error. Not sure if related but did a windows update recently-ish and updated PHPStorm.
There is free space on my hard drives
Could it be related to too many files in /var/run/WSL ? 395 files in this directory.
sudo ls -alh /var/run/WSL | wc
395 3548 21510
I do notice there seem to be a lot of wslhost.exe's running not sure if its normal.
wsl --update Checking for updates. The most recent version of Windows Subsystem for Linux is already installed.
I've had the exact same issue when using PhpStorm (link to issue raised on Jetbrains issue tracker here).
For me, this issue only occurs when trying to use the git executable inside of the WSL filesystem from PhpStorm. If I use a git.exe within the Windows filesystem, this issue does not occur.
Ah, right, so I did have some ssh-agent stuff in my ~/.bash_profile for some reason.
I also had a cd in here.
After updating phpstorm recently, it had stopped working with git due to ssh-agent outputing some numbers into stdout. Making it output to dev/null fixed that, but then it still couldn't work with git commands due to the cd, like it was using relative paths not absolute.
# Run ssh-agent silently.
#eval $(ssh-agent > /dev/null);
#ssh-add > /dev/null 2>&1
So every time PHP Storm goes to do something with git or running tests I'm thinking it makes a new connection. And there has been a long standing bug where it does not remove previous /var/run/WSL handles/sockets?
So thats why I wondered if it was the problem.
Removing the ssh-agent for now in my bash profile has seemed to reduce the issue, but it could have just been rebooting my pc.
Ah good find, I think that's sorted my issue as I had a similar thing in my .profile to run ssh-agent. We used it for adding the current ssh-agent into an environment variable for use within docker containers but can do it manually if it prevents this issue.
So ssh-agent sets some environment variables and runs in the background. I suspect we can extract the details that would be evaulated into a temporary sh file in /tmp.
Then if file exists, and process id of ssh-agent in background? is same/existing we don't need to re-run ssh-agent but can just eval the values in new shell login.
Then it shouldn't be a problem right? :)
But it does make me wonder why wsl couldn't just run the ssh-agent once and apply the value to all shells? Does it have to be separate per linux user? Does it normally run under systemd or some initscript in normal linuxs?
I suspect the PhpStorm sessions are non-interactive but opened with --login as my ~/.profile is still executed and has similar commands to load the SSH agent; so I just tested for interactivity and it greatly reduced the number of WSL handles opened by ssh-agent:
if test "$PS1"; then
eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa
fi
Hope this helps!
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.
Thank you!