vmware-tanzu-labs / educates-training-platform

A platform for hosting interactive workshop environments in Kubernetes, or on top of a local container runtime.
https://docs.educates.dev
Apache License 2.0
63 stars 14 forks source link

Improve error message when Docker is not running #467

Closed jorgemoralespou closed 5 days ago

jorgemoralespou commented 1 week ago

Describe the bug

I restarted my machine and Docker Desktop was not started. I then run educates delete-cluster as I wanted to delete the current cluster I was working on before rebooting, but got the following error message:

$ educates delete-cluster
Error: unable to get list of clusters: failed to list clusters: command "docker ps -a --filter label=io.x-k8s.kind.cluster --format '{{.Label "io.x-k8s.kind.cluster"}}'" failed with error: exit status 1

Then, I was trying to list the running containers with Docker:

$ docker ps -a
Cannot connect to the Docker daemon at unix:///Users/jomorales/.docker/run/docker.sock. Is the docker daemon running?

And this is when I noticed Docker was not running.

We need to add a check in the scenarios where a Docker command is executed to validate Docker is running, otherwise provide proper error message.

Additional information

No response

jorgemoralespou commented 5 days ago

This error message is being generated by Kind's code, and we only surface it. In many other scenarios, we check for the existence of the container before, so we see somthing like this:

$ educates deploy-workshop
Error: Cluster is not available or not reachable

I'm going to close this issue with WONT FIX, as this is the only scenario where we see weird error and it's not easy to capture to handle better error.