Kind: improve error messaging for create cluster"

Created on 8 Feb 2019  路  23Comments  路  Source: kubernetes-sigs/kind

Hi there

I have set up a new Ubuntu server 16.04, installed Go, Golang and Docker however everytime I run
go get sigs.k8s.io/kind && kind create cluster

I get
Error: could not list clusters: failed to list nodes: exit status 1

What am I missing as I am new to Kubernetes

kinbug prioritimportant-soon

Most helpful comment

if you do:
go install sigs.k8s.io/kind
it will probably install in ~/go/bin

but then if you don't have this folder in PATH you can either:

  • add it to path using your preferred way on linux
  • move the ~/go/bin/kind binary to somewhere like /usr/local/bin

All 23 comments

we might have to pipe a better message.

could you please add --log-level=debug and try again?

/priority awaiting-more-evidence

kind create cluster --loglevel=debug

DEBU[13:29:52] Running: /usr/bin/docker [docker ps -q -a --no-trunc --filter label=io.k8s.sigs.kind.cluster --format {{.Names}}\t{{.Label "io.k8s.sigs.kind.cluster"}}]
Error: could not list clusters: failed to list nodes: exit status 1

what is the output of the following commands:

docker version

docker run hello-world

sudo docker version
[sudo] password for burf2000:
Client:
Version: 18.09.1
API version: 1.39
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:35:23 2019
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.1
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:02:44 2019
OS/Arch: linux/amd64
Experimental: false

sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:2557e3c07ed1e38f26e389462d03ed943586f744621577a99efb77324b0fe535
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:

  1. The Docker client contacted the Docker daemon.
  2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
  3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
  4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

Is it because I have to SUDO?

there shouldn't be a need for sudo.

and how about calling the problem command:

docker ps -q -a --no-trunc --filter label=io.k8s.sigs.kind.cluster --format {{.Names}}\t{{.Label "io.k8s.sigs.kind.cluster"}}

That was my issue, thank you I followed https://docs.docker.com/install/linux/linux-postinstall/ and removed the need for Sudo

i guess we still have to improve the message here.
could you please rename this issue to e.g. "improve error messaging for create cluster"
thanks.

/assign

also sudo kind create cluster works fine for me.

If I did sudo kind it could not find the command randomly

If I did sudo kind it could not find the command randomly

do you mean that you had to pass the full path to the kind binary to sudo?

/remove-priority awaiting-more-evidence
/priority important-soon
/kind bug

@neolit123: Those labels are not set on the issue: priority/awaiting-more-evidence

In response to this:

If I did sudo kind it could not find the command randomly

do you mean that you had to pass the full path to the kind binary to sudo?

/remove-priority awaiting-more-evidence
/priority important-soon
/kind bug

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.

that's possibly because you have to do:
go install sigs.k8s.io/kind and have the GOPATH/bin folder in path.

If I do sudo kind create cluster
I get sudo: kind: command not found

if you do:
go install sigs.k8s.io/kind
it will probably install in ~/go/bin

but then if you don't have this folder in PATH you can either:

  • add it to path using your preferred way on linux
  • move the ~/go/bin/kind binary to somewhere like /usr/local/bin

going back to this ticket.

i'm a bit confused what we are trying to document: sudo vs PATH.
adding binaries to PATH is something that should be known to all users and the paths vary between OSes. also Windows handles super users in a different way. not sure we want to document these aspects.

/close
/unassign

please, reopen if i'm missing something.

@neolit123: Closing this issue.

In response to this:

going back to this ticket.

i'm a bit confused what we are trying to document: sudo vs PATH.
adding binaries to PATH is something that should be known to all users and the paths vary between OSes. also Windows handles super users in a different way. not sure we want to document these aspects.

/close
/unassign

please, reopen if i'm missing something.

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.

Another fix for this is to add your own user to the docker group.

I am still thinking about how this should be written. I want to point out directly that it is a question of permissions. #714

I am still thinking about how this should be written. I want to point out directly that it is a question of permissions. #714

"PermissionDenied error when trying to list nodes. Is your user authorized to run docker?"

"PermissionDenied error when trying to list nodes. Is your user authorized to run docker?"

Thanks.
But in fact there may be a lot of situations, such as no permissions, such as Docker does not start etc. And I think we don't need to add a lot of redundant code for these situations...

We have already written some instructions in the documentation, although not all of them are covered. https://kind.sigs.k8s.io/docs/user/known-issues/#docker-permission-denied

a CLI message can potentially link to the user docs / known issues too.

This error message also displays when the Docker daemon is not running. Any way to detect this and have the error message state to start the dameon?

Running: /usr/bin/docker [docker ps -q -a --no-trunc --filter label=io.k8s.sigs.kind.cluster --format {{.Names}}\t{{.Label "io.k8s.sigs.kind.cluster"}}]
Error: could not list clusters: failed to list nodes: exit status 1
Was this page helpful?
0 / 5 - 0 ratings

Related issues

neolit123 picture neolit123  路  62Comments

nilebox picture nilebox  路  40Comments

senthilrch picture senthilrch  路  53Comments

mitar picture mitar  路  49Comments

nicks picture nicks  路  31Comments