K3d: [Bug] Panic when creating the cluster with k3d

Created on 15 Oct 2020  路  2Comments  路  Source: rancher/k3d

INFO[0000] Created network 'k3d-serverless'
INFO[0000] Created volume 'k3d-serverless-images'
INFO[0001] Creating node 'k3d-serverless-server-0'
INFO[0014] Creating LoadBalancer 'k3d-serverless-serverlb'
INFO[0015] (Optional) Trying to get IP of the docker host and inject it into the cluster as 'host.k3d.internal' for easy access
ERRO[0015] Failed to start exec process in node 'k3d-serverless-server-0'
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x47d6e79]

goroutine 1 [running]:
github.com/rancher/k3d/v3/pkg/runtimes/docker.Docker.ExecInNodeGetLogs(0x4d155e0, 0xc000122000, 0xc0003efcc0, 0xc0018a8930, 0x3, 0x3, 0x4a64240, 0xc0000d4501, 0xc0018a8930)
github.com/rancher/k3d/v3/pkg/runtimes/docker/node.go:311 +0x79
github.com/rancher/k3d/v3/pkg/cluster.resolveHostnameFromInside(0x4d155e0, 0xc000122000, 0x4d25380, 0x52ff700, 0xc0003efcc0, 0x4bde2f7, 0x14, 0x41f9305, 0xc00014c040, 0x4bc1040, ...)
github.com/rancher/k3d/v3/pkg/cluster/host.go:79 +0x17a
github.com/rancher/k3d/v3/pkg/cluster.GetHostIP(0x4d155e0, 0xc000122000, 0x4d25380, 0x52ff700, 0xc000442800, 0x0, 0x0, 0x0, 0x0, 0x0)
github.com/rancher/k3d/v3/pkg/cluster/host.go:60 +0x17e
github.com/rancher/k3d/v3/pkg/cluster.ClusterCreate(0x4d155e0, 0xc000122000, 0x4d25380, 0x52ff700, 0xc000442800, 0x0, 0x0)
github.com/rancher/k3d/v3/pkg/cluster/cluster.go:360 +0x1935
github.com/rancher/k3d/v3/cmd/cluster.NewCmdClusterCreate.func1(0xc000428dc0, 0xc00041dc30, 0x1, 0x1)
github.com/rancher/k3d/v3/cmd/cluster/clusterCreate.go:83 +0x14c
github.com/spf13/cobra.(Command).execute(0xc000428dc0, 0xc00041dc10, 0x1, 0x1, 0xc000428dc0, 0xc00041dc10)
github.com/spf13/[email protected]/command.go:846 +0x2c2
github.com/spf13/cobra.(
Command).ExecuteC(0x52bfd40, 0xc000136010, 0x3, 0x3)
github.com/spf13/[email protected]/command.go:950 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:887
github.com/rancher/k3d/v3/cmd.Execute()
github.com/rancher/k3d/v3/cmd/root.go:91 +0x5a
main.main()
github.com/rancher/k3d/v3/main.go:27 +0x25

bug

Most helpful comment

Just to include more information about this problem, I had the same issue in the specific configuration:

k3d command you executed

k3d cluster create test

Linux, Windows, MacOS / amd64, x86, ...?

Darwin Kernel Version 19.6.0 x86_64

output of k3d version

k3d version v3.1.5

output of docker version and docker info

Docker version 18.09.2, build 6247962

Updating to the latest docker version (19.03.13) it works as expected

All 2 comments

Hi @alonlong , thanks for opening this issue!
Can you please add the details requested in the bug issue template?

  • k3d command you executed
  • Linux, Windows, MacOS / amd64, x86, ...?
  • output of k3d version
  • output of docker version and docker info

UPDATE: Still found a missing nil-check in the code and fixed it in dcef0b1, which will be in the next release.
Thanks for reporting!

UPDATE 2: Would anyway be interested in finding out about your setup and what else went wrong there, that the exec process failed like this :thinking:

Just to include more information about this problem, I had the same issue in the specific configuration:

k3d command you executed

k3d cluster create test

Linux, Windows, MacOS / amd64, x86, ...?

Darwin Kernel Version 19.6.0 x86_64

output of k3d version

k3d version v3.1.5

output of docker version and docker info

Docker version 18.09.2, build 6247962

Updating to the latest docker version (19.03.13) it works as expected

Was this page helpful?
0 / 5 - 0 ratings