k3d-io / k3d

Little helper to run CNCF's k3s in Docker
https://k3d.io/
MIT License
5.42k stars 460 forks source link

[BUG] #1193

Open borgdrone7 opened 1 year ago

borgdrone7 commented 1 year ago

What did you do

Versions used can be seen below in k3d info output.

What did you expect to happen

I expected the new node will join the cluster without an error. This bug should have been fixed in 5.0 version (if it is the same bug) as you can see here: https://github.com/k3d-io/k3d/issues/695

Screenshots or terminal output

`INFO[0027] Updating loadbalancer config to include new server node(s) panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa30205]

goroutine 35 [running]: github.com/k3d-io/k3d/v5/pkg/runtimes/docker.Docker.ReadFromNode({}, {0xf49520, 0xc00042a540}, {0xdded0a, 0x16}, 0x0) /home/runner/work/k3d/k3d/pkg/runtimes/docker/util.go:160 +0xc5 github.com/k3d-io/k3d/v5/pkg/client.GetLoadbalancerConfig({0xf49520, 0xc00042a540}, {0xf57d68?, 0x1528898?}, 0xc0000b4100) /home/runner/work/k3d/k3d/pkg/client/loadbalancer.go:132 +0x336 github.com/k3d-io/k3d/v5/pkg/client.UpdateLoadbalancerConfig({0xf49520, 0xc00042a540}, {0xf57d68?, 0x1528898?}, 0x1?) /home/runner/work/k3d/k3d/pkg/client/loadbalancer.go:61 +0x17f github.com/k3d-io/k3d/v5/pkg/client.NodeAddToCluster({0xf49520, 0xc00042a540}, {0xf57d68?, 0x1528898?}, 0xc000107ba0, 0xc0000b4100?, {0x1, 0x0, {0xc000046480, 0x2, ...}, ...}) /home/runner/work/k3d/k3d/pkg/client/node.go:261 +0x17bb github.com/k3d-io/k3d/v5/pkg/client.NodeAddToClusterMulti.func1() /home/runner/work/k3d/k3d/pkg/client/node.go:316 +0x57 golang.org/x/sync/errgroup.(Group).Go.func1() /home/runner/go/pkg/mod/golang.org/x/sync@v0.0.0-20220513210516-0976fa681c29/errgroup/errgroup.go:74 +0x64 created by golang.org/x/sync/errgroup.(Group).Go /home/runner/go/pkg/mod/golang.org/x/sync@v0.0.0-20220513210516-0976fa681c29/errgroup/errgroup.go:71 +0xa5`

Which OS & Architecture

Which version of k3d

Server: Docker Engine - Community Engine: Version: 20.10.22 API version: 1.41 (minimum version 1.12) Go version: go1.18.9 Git commit: 42c8b31 Built: Thu Dec 15 22:25:49 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.14 GitCommit: 9ba4b250366a5ddde94bb7c9d1def331423aa323 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0 `

`Client: Context: default Debug Mode: false Plugins: app: Docker App (Docker Inc., v0.9.1-beta3) buildx: Docker Buildx (Docker Inc., v0.9.1-docker) compose: Docker Compose (Docker Inc., v2.13.0) scan: Docker Scan (Docker Inc., v0.23.0)

Server: Containers: 4 Running: 2 Paused: 0 Stopped: 2 Images: 24 Server Version: 20.10.22 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: systemd Cgroup Version: 2 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc Default Runtime: runc Init Binary: docker-init containerd version: 9ba4b250366a5ddde94bb7c9d1def331423aa323 runc version: v1.1.4-0-g5fd4c4d init version: de40ad0 Security Options: apparmor seccomp Profile: default cgroupns Kernel Version: 5.15.0-56-generic Operating System: Ubuntu 22.04.1 LTS OSType: linux Architecture: x86_64 CPUs: 8 Total Memory: 15.59GiB Name: amir2204 ID: 7XH3:GM4D:B6KO:BISK:AXUI:AHDF:XWIE:ZCXI:2MSJ:RZRF:ZYXD:ODO3 Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false `

slonka commented 1 year ago

having the same error, works in 5.4.7, does not work in 5.4.8.

Reproducing:

k3d cluster create kuma-1
k3d node create second -c kuma-1 --k3s-node-label second=true
rohanlucifer commented 1 year ago

having the same error in 5.4.9, works in 5.4.7

INFO[0035] HostIP: using network gateway 1.2.3.4 address 
panic: runtime error: index out of range [-1]

goroutine 8 [running]:
github.com/k3d-io/k3d/v5/pkg/client.NodeAddToCluster({0xf6c198, 0xc0002b8050}, {0xf7b2b0?, 0x156de50?}, 0xc0000de1a0, 0xc0000e6100?, {0x1, 0x0, {0x0, 0x0, ...}, ...})
    /home/runner/work/k3d/k3d/pkg/client/node.go:200 +0x20c8
github.com/k3d-io/k3d/v5/pkg/client.NodeAddToClusterMulti.func1()
    /home/runner/work/k3d/k3d/pkg/client/node.go:346 +0x57
golang.org/x/sync/errgroup.(*Group).Go.func1()
    /home/runner/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
    /home/runner/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5