Docker-compose suddenly error, happen frequently

Hi,

Windows 10 home ed.
Ubuntu WSL2 20.04 LTS
Docker latest build

I been getting this error frequently

Failed to load docker configuration: open /home/happyboy/.docker/features.json: input/output error

The latest happening was after I remove everything with command below

docker-compose down

#remove container
docker rm -vf $(docker ps -a -q)

#remove image
docker rmi -f $(docker images -a -q)

#remove container
docker volume rm $(docker volume ls -q)

Then I want to resetup a project folder, run docker-compose build, then error show up again

Failed to load docker configuration: open /home/happyboy/.docker/features.json: input/output error

Then I check

docker -v  (success)
docker-compose --version  (fail with same error of unable to load docker configuration)

very troublesome…
everytime facing this, I have to uninstall and reinstall docker.

Hi,

Not sure where the error is coming from, but usually running wsl --shutdown and wsl commands in powershell solves it in case of the input/output error issue.

I strongly advise against wsl --shutdown - to use after having made a backup of your containers

Can you provide background information?

wsl --shutdown stops the wsl utility vm after terminating all wsl distributions. Of couse one could terminate a specific wsl distribution, instead of stopping the wsl utility vm. Though, what harm do you expect here? I never experienced any problems, neither with wsl --shutdown, nor with wsl --terminate <distribution name>