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

[BUG] signal SIGSEGV: segmentation violation on node creation #277

Closed
zewelor opened this issue Jun 12, 2020 · 5 comments
Closed

[BUG] signal SIGSEGV: segmentation violation on node creation #277

zewelor opened this issue Jun 12, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@zewelor
Copy link

zewelor commented Jun 12, 2020

What did you do?
k3d create node test -c cluster

  • How was the cluster created?

    • k3d create -x A -y B
  • What did you do afterwards?

    • k3d commands?
    • docker commands?
    • OS operations (e.g. shutdown/reboot)?

What did you expect to happen?

Concise description of what you expected to happen after doing what you described above.

Screenshots or terminal output

k3d version v3.0.0-rc.2
k3s version v1.18.3-k3s1 (default)
~  k3d create node test -c cluster  ✔
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xd5f9ae]

goroutine 1 [running]:
github.com/rancher/k3d/pkg/cluster.AddNodeToCluster(0x1155d00, 0xc000321e00, 0x1169f80, 0x1893b10, 0xc000422ea0, 0xc00044e500, 0xc000436c00, 0x0, 0x4, 0xc000239428)
/home/travis/gopath/src/github.com/rancher/k3d/pkg/cluster/node.go:43 +0x12ce
github.com/rancher/k3d/pkg/cluster.AddNodesToCluster(0x1155d40, 0xc000134010, 0x1169f80, 0x1893b10, 0xc000138b68, 0x1, 0x1, 0xc00044e500, 0xc000329600, 0x0, ...)
/home/travis/gopath/src/github.com/rancher/k3d/pkg/cluster/node.go:155 +0x1ea
github.com/rancher/k3d/cmd/create.NewCmdCreateNode.func1(0xc000439080, 0xc000437380, 0x1, 0x3)
/home/travis/gopath/src/github.com/rancher/k3d/cmd/create/createNode.go:50 +0xf6
github.com/spf13/cobra.(*Command).execute(0xc000439080, 0xc000437350, 0x3, 0x3, 0xc000439080, 0xc000437350)
/home/travis/gopath/src/github.com/rancher/k3d/vendor/github.com/spf13/cobra/command.go:846 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0x185a5e0, 0x405abf, 0xc000114058, 0x0)
/home/travis/gopath/src/github.com/rancher/k3d/vendor/github.com/spf13/cobra/command.go:950 +0x349
github.com/spf13/cobra.(*Command).Execute(...)
/home/travis/gopath/src/github.com/rancher/k3d/vendor/github.com/spf13/cobra/command.go:887
github.com/rancher/k3d/cmd.Execute()
/home/travis/gopath/src/github.com/rancher/k3d/cmd/root.go:79 +0x2d
main.main()
/home/travis/gopath/src/github.com/rancher/k3d/main.go:27 +0x20

Which OS & Architecture?

  • Linux amd64

Which version of k3d? v3.0.0-rc.2

  • output of k3d --version

Which version of docker?

  • output of docker version
@zewelor zewelor added the bug Something isn't working label Jun 12, 2020
@iwilltry42
Copy link
Member

Hi @zewelor, good catch, thank you! :)
This is a bug in the exception handling for when the chosen cluster does not exist.
Fixed in the linked commit 2d0ec0a 👍

@iwilltry42 iwilltry42 self-assigned this Jun 12, 2020
@iwilltry42 iwilltry42 added this to the v3.0 - FROM scratch milestone Jun 12, 2020
@zewelor
Copy link
Author

zewelor commented Jun 12, 2020

Hmm I've tried to connect to existing cluster, but on remote computer. I've also set K3S_URL and K3S_TOKEN , prior to this command.

EDIT: I've tested in on rc.3 and can confirm now works, but cannot connect to remote cluster. How it should be done ?

@iwilltry42
Copy link
Member

Oh okay, k3d v3 does not support this.
How did you set K3S_URL/K3S_TOKEN? 🤔
Currently, k3d v3 only supports connecting to other k3d clusters in the same docker evironment.

@zewelor
Copy link
Author

zewelor commented Jun 12, 2020

I've set cluster via k3d on one computer, then get token via k3d get cluster --token and did export K3S_ env vars on other computer. So it's not possible to join worker, via k3d, to already existing cluster ?

@iwilltry42
Copy link
Member

So there are several things to notice here:

  • k3d is spawning containerized k3s nodes, so they don't honor the K3S_* environment variables that one specifies on host level
  • k3d clusters (by default) have their own docker network and no ports exposed, so even traffic between different clusters/hosts may be limited
  • You can add new nodes to existing clusters on the same host, that's not a problem.
  • k3d v1.6 had an unsupported feature to add k3d nodes to existing (plain) k3s clusters, which seemed to work but was untested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants