k3d-io / k3d

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

Invalid memory address runtime error when adding node to remote cluster #1485

Open briandlees opened 3 months ago

briandlees commented 3 months ago

I have been trying to add a control-plane server to an existing cluster on a different node. This resulted in the following runtime error; any suggestions on how to alleviate this would be welcome:

node001:~ # k3d node create -c "https://10.10.0.x:6443" --role server --token obfuscatedtoken k3d-aclcluster-server-1 INFO[0000] Adding 1 node(s) to the remote cluster 'https://10.10.0.x:6443'... panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xe69185]

goroutine 9 [running]: github.com/k3d-io/k3d/v5/pkg/client.patchServerSpec(...) /home/runner/work/k3d/k3d/pkg/client/node.go:737 github.com/k3d-io/k3d/v5/pkg/client.NodeCreate({0x13227c0, 0xc00009c0a0}, {0x1338368, 0x1b81fe0}, 0xc0005a2e00, {0x1, 0x0, {0x0, 0x0, 0x0}, ...}) /home/runner/work/k3d/k3d/pkg/client/node.go:628 +0x7c5 github.com/k3d-io/k3d/v5/pkg/client.NodeRun({0x13227c0, 0xc00009c0a0}, {0x1338368, 0x1b81fe0}, 0xc0005a2e00, {0x1, 0x0, {0x0, 0x0, 0x0}, ...}) /home/runner/work/k3d/k3d/pkg/client/node.go:420 +0x7a github.com/k3d-io/k3d/v5/pkg/client.NodeAddToClusterRemote({0x13227c0, 0xc00009c0a0}, {0x1338368, 0x1b81fe0}, 0xc0005a2e00, {0x7ffddc678624, 0x18}, {0x1, 0x0, {0x0, ...}, ...}) /home/runner/work/k3d/k3d/pkg/client/node.go:323 +0x951 github.com/k3d-io/k3d/v5/pkg/client.NodeAddToClusterMultiRemote.func1() /home/runner/work/k3d/k3d/pkg/client/node.go:374 +0x55 golang.org/x/sync/errgroup.(Group).Go.func1() /home/runner/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:78 +0x56 created by golang.org/x/sync/errgroup.(Group).Go in goroutine 1 /home/runner/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:75 +0x96

k3d version v5.7.3 k3s version v1.30.3-k3s1 (default) podman version 4.9.5

briandlees commented 3 months ago

I should have added that this is the status of the remote cluster:

NAME STATUS ROLES AGE VERSION k3d-aclcluster-server-0 Ready control-plane,etcd,master 48m v1.30.3+k3s1

jbQF commented 3 months ago

Getting the same error when trying to build out a distributed cluster.