Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better error output when docker isn't/can't log in #575

Closed
squillace opened this issue May 31, 2019 · 17 comments
Closed

better error output when docker isn't/can't log in #575

squillace opened this issue May 31, 2019 · 17 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@squillace
Copy link

What would you like to be added:
The ability get better error output in the non-default case when creating a new cluster and not specifying the default kind create cluster.

Why is this needed:
I stumbled around for the better part of a week trying to understand why this didn't work, below. only when I ran it as the default command did it appear to output the error -- it's picking up my docker login and I'd changed the password but had not re-logged in. After logging in properly, it is creating properly.

╭─ralph at surfacebook in ~/work/go/bin using
╰─○ kind create cluster --image=kindest/node:v1.14.0 --name kindly
Creating cluster "kindly" ...
 ✓ Ensuring node image (kindest/node:v1.14.0) 🖼
 ✓ Preparing nodes 📦
 ✓ Creating kubeadm config 📜
 ✗ Starting control-plane 🕹️
Error: failed to create cluster: failed to init node with kubeadm: exit status 1
╭─ralph at surfacebook in ~/work/go/bin using
╰─○ kind create cluster
Creating cluster "kind" ...
 ✓ Ensuring node image (kindest/node:v1.14.2) 🖼
ERRO[17:42:25] Unable to find image 'kindest/node:v1.14.2@sha256:33539d830a6cf20e3e0a75d0c46a4e94730d78c7375435e6b49833d81448c319' locally
ERRO[17:42:25] docker: Error response from daemon: Get https://registry-1.docker.io/v2/kindest/node/manifests/sha256:33539d830a6cf20e3e0a75d0c46a4e94730d78c7375435e6b49833d81448c319: unauthorized: incorrect username or password.
ERRO[17:42:25] See 'docker run --help'.
 ✗ Preparing nodes 📦
ERRO[17:42:25] docker run error: exit status 125
Error: failed to create cluster: docker run error: exit status 125
@squillace squillace added the kind/feature Categorizes issue or PR as related to a new feature. label May 31, 2019
@BenTheElder
Copy link
Member

cc @amwat exactly the kind of self-diagnosis I was talking about earlier ^^

xref: #39
/priority important-longterm

@k8s-ci-robot k8s-ci-robot added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label May 31, 2019
@squillace
Copy link
Author

@BenTheElder this was why it was failing on my machine at KubeCon. :-)

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 29, 2019
@philips
Copy link

philips commented Aug 29, 2019

Hit this issue on a debian machine where I didn't have access to the docker socket.

@BenTheElder
Copy link
Member

/remove-lifecycle stale

Yep, error handling / reporting / logging is something I'm back at reshaping right now, it's subpar :(

We do at least have a note about the docker socket in the known issues guide now..

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 30, 2019
@BenTheElder
Copy link
Member

/assign
/lifecycle active

@k8s-ci-robot k8s-ci-robot added the lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. label Aug 30, 2019
@aojea
Copy link
Contributor

aojea commented Oct 30, 2019

I think that @BenTheElder fixed this with the new logging mechanism
Currently, the error that kind shows is meaningful

./kind create cluster
ERROR: failed to list clusters: command "docker ps -q -a --no-trunc --filter label=io.k8s.sigs.kind.cluster=kind --format '{{.Names}}'" failed with error: exec: "docker": executable file not found in $PATH

/close

@k8s-ci-robot
Copy link
Contributor

@aojea: Closing this issue.

In response to this:

I think that @BenTheElder fixed this with the new logging mechanism
Currently, the error that kind shows is meaningful

./kind create cluster
ERROR: failed to list clusters: command "docker ps -q -a --no-trunc --filter label=io.k8s.sigs.kind.cluster=kind --format '{{.Names}}'" failed with error: exec: "docker": executable file not found in $PATH

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@estensen
Copy link

estensen commented Mar 8, 2020

IMO, as a beginner, this is not beginner-friendly:

$ kind create cluster
ERROR: failed to list clusters: command "docker ps -q -a --no-trunc --filter label=io.x-k8s.kind.cluster=kind --format '{{.Names}}'" failed with error: exit status 1

There should be a hint that Docker is not running

@aojea
Copy link
Contributor

aojea commented Mar 8, 2020

IMO, as a beginner, this is not beginner-friendly:

$ kind create cluster
ERROR: failed to list clusters: command "docker ps -q -a --no-trunc --filter label=io.x-k8s.kind.cluster=kind --format '{{.Names}}'" failed with error: exit status 1

There should be a hint that Docker is not running

the problem is that it may be caused by another reasons, not just that Docker is not running, so it can be wrong to always return an error saying "Docker is not running"

@BenTheElder
Copy link
Member

What aojea said.

Sorry, we know this isn't friendly, there's just a LOT to do and initially we were targeting kubernetes (literally kubernetes itself) developers. There's a lot to do. I have a sketch for more sophisticated help in the command but we've got some deep rework that needs doing to fix e.g. host reboot support first.

@BenTheElder
Copy link
Member

I recommend running again with -v 1 on the latest release when you encounter errors until that rework is published.

@BenTheElder BenTheElder reopened this Jun 23, 2021
@BenTheElder BenTheElder removed the lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. label Jun 23, 2021
@BenTheElder BenTheElder removed their assignment Jun 23, 2021
@BenTheElder
Copy link
Member

BenTheElder commented Jun 23, 2021

Especially now that we auto-detect between multiple backends (podman, docker), it would be helpful to write some code specifically to probe for "is the host capable of hosting a cluster"

We have some of this now related to e.g. cgroupsv2 and rootless where we will throw more descriptive errors, but not for this case yet.

This also has some overlap with #39, i would love a command to diagnose problems with the host.

@linuxem
Copy link

linuxem commented Jun 9, 2023

Still having this error
Docker is running I can run docker ps
But kine create cluster gives an error

image

Error

image

even the docker gives error when running this
docker ps -q -a --no-trunc --filter label=io.k8s.sigs.kind.cluster --format {{.Names}}
see this:
image

image

"just information about this docker installation it is Docker Desktop 4.20.0"
Any suggestions?

@linuxem
Copy link

linuxem commented Jun 9, 2023

update to the newest kind fixed the problem.

image

/close

@stmcginnis
Copy link
Contributor

Based on the previous comment, going to reclose this issue. I think further improvements can be tracked somewhat with #39.

/close

@k8s-ci-robot
Copy link
Contributor

@stmcginnis: Closing this issue.

In response to this:

Based on the previous comment, going to reclose this issue. I think further improvements can be tracked somewhat with #39.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

No branches or pull requests

9 participants