compinit:501: no such file or directory: /usr/share/zsh/vendor-completions/_docker
- [x] I have tried with the latest version of my channel (Stable or Edge)
- [ ] I have uploaded Diagnostics
- Diagnostics ID:
Expected behavior
No issues with zsh completions and compinit when starting a new shell
Actual behavior
I installed Docker for Windows 2.3.0.4 on Windows 10 Version 2004 (build 19041.450) and enabled WSL integration. Then I turned off Docker for Windows because of resource consumptions. Now I get this error every time I start my zsh shell:
compinit:501: no such file or directory: /usr/share/zsh/vendor-completions/_docker
I noticed that the file /usr/share/zsh/vendor-completions/_docker is a link to a wsl mount:
$ ls -l /usr/share/zsh/vendor-completions/_docker
lrwxrwxrwx 1 root root 74 Sep 3 11:17 /usr/share/zsh/vendor-completions/_docker -> /mnt/wsl/docker-desktop/cli-tools/usr/share/zsh/vendor-completions/_docker
so I assume this file is present only when Docker for Windows is running, but I need to turn it off or my machine won't make it.
my ~/.zshrc file is:
plugins=(git docker zsh-completions)
source $ZSH/oh-my-zsh.sh
# zsh-completions
autoload -U compinit && compinit
Information
- Windows Version:
- Docker Desktop Version:
- Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM:
Steps to reproduce the behavior
- Configure oh-my-zsh plugins, add docker
- Install Docker For Windows
- Turn off Docker for Windows
- Open a shell
Any solution to this?
@simonferquel Have you seen this before?
I confirm this happens only with docker on windows turned off.
Yes, this is because completion scripts are symlinks to files in the cli-tools iso file. This iso file is mounted by Docker Desktop on startup. We could probably explore ways to remove the symlinks on a clean shutdown.
On removing Docker Desktop the symlinks still appear (On Windows 10, WSL2)
FYI This issue is in progress in our current sprint.
Reopening this ticket. It's fixed internally, but not yet released.
Hi Stephen, when will be the release? Thanks.
Provisionally scheduled for 2 Nov.
This also happens if you had WSL2 integration enabled (by checking Resources → WSL Integration → Enable integration with my default WSL distro) and then change your "default distro" back to WSL1 with wsl --set-version linux-distro 1.
any updates on this?
@LavHinsu Yes, look two comments above yours.
@brunosaboia in order to be safe, I checked it with wsl -l -v and got 2.
I was facing same issue, heres what I did
First I removed the symlink
sudo rm -rf /usr/share/zsh/vendor-completions/_docker
then I copied over the wsl completions
sudo cp /mnt/wsl/docker-desktop/cli-tools/usr/share/zsh/vendor-completions/_docker /usr/share/zsh/vendor-completions/
and made it non-writable
sudo chattr +i /usr/share/zsh/vendor-completions/_docker
now next time we launch wsl when docker is not running we wont get that error
the same problem, when I add docker in zsh plugins it's sloved:
plugins=(
docker
zsh-syntax-highlighting
zsh-autosuggestions
)
- Windows Version: 2004 (OS build 19041.572)
- Docker Desktop Version: 2.4.0.0(48506) [Channel stable]
- WSL2: Ubuntu-20.04
This was fixed in 2.5.0.0.
This was fixed in 2.5.0.0.
I'm on version 3.0.0 (50684) and getting this error when starting a WSL 2 instance with Docker for Windows not running. Is there something else that needs to be done manually?
This was fixed in 2.5.0.0.
Same as @ianmartorell I'm on last version, 3.0.0 (50684) and the error still occurs when starting WSL2 instance without a running Docker for Windows instance. Can you provide some manual procedure which can prevent this?
This was fixed in 2.5.0.0.
Same as @ianmartorell I'm on last version, 3.0.0 (50684) and the error still occurs when starting WSL2 instance without a running Docker for Windows instance. Can you provide some manual proceudre which can prevent this?
Starting the Docker Desktop fixed it for me. I suppose adding logic to .zshrc script to test the docker presence prior to loading the theme proposed above: by @pavanjadhaw would be a good fix. Or, maybe replacing the error message with a notification "Docker Desktop not running"
@bodzio4749 @pavanjadhaw The workaround works for me, thanks a lot I'll have to remember to do this at every Docker Desktop upgrade