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] Unable to create cluster on Mac #371

Closed
kahou82 opened this issue Oct 6, 2020 · 13 comments
Closed

[BUG] Unable to create cluster on Mac #371

kahou82 opened this issue Oct 6, 2020 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@kahou82
Copy link

kahou82 commented Oct 6, 2020

What did you do

  • How was the cluster created?

    • k3d cluster create k3d-rancher
  • What did you do afterwards?

What did you expect to happen

Expect a cluster will be created

Screenshots or terminal output

kahoulei@kahous-mbp ~ % k3d --version
k3d version v3.1.0
k3s version latest (default)
kahoulei@kahous-mbp ~ % k3d cluster create k3d-rancher
INFO[0000] Created network 'k3d-k3d-rancher'
INFO[0000] Created volume 'k3d-k3d-rancher-images'
INFO[0001] Creating node 'k3d-k3d-rancher-server-0'
INFO[0001] Creating LoadBalancer 'k3d-k3d-rancher-serverlb'
ERRO[0004] Failed to get HostIP
ERRO[0004] Logs from failed access process:
Server:		127.0.0.11
Address:	127.0.0.11:53

Non-authoritative answer:
Name:	host.docker.internal
Address: 192.168.65.2

** server can't find host.docker.internal: NXDOMAIN

ERRO[0004] Failed to create cluster >>> Rolling Back
INFO[0004] Deleting cluster 'k3d-rancher'
INFO[0004] Deleted k3d-k3d-rancher-server-0
INFO[0004] Deleted k3d-k3d-rancher-serverlb
INFO[0004] Deleting cluster network 'f60ecc4a31f58517f88d89419d966e26ce08f6cc87c4260671b9f0cdac7769bd'
FATA[0004] Cluster creation FAILED, all changes have been rolled back!

Which OS & Architecture

  • MacOS

Which version of k3d

kahoulei@kahous-mbp ~ % k3d --version
k3d version v3.1.0
k3s version latest (default)

Which version of docker

  • Docker version 19.03.13, build 4484c46d9d
@kahou82 kahou82 added the bug Something isn't working label Oct 6, 2020
@retr0h
Copy link

retr0h commented Oct 6, 2020

Having same issue. Worked fine on 3.0.1, but after upgrade to 3.1.0, I encounter the error above.

@iwilltry42
Copy link
Member

Hi, thanks for opening this issue.
This is clearly a bug in the access process.
Please use the --no-hostip flag for now as a workaround 👍

@kahou82
Copy link
Author

kahou82 commented Oct 7, 2020

Cool it works. Thanks.

@iwilltry42
Copy link
Member

Hey @retr0h & @kahou82 , can you please give https://github.com/rancher/k3d/releases/tag/v3.1.1 a try and let me know, if it works for you without the --no-hostip flag?
If no, can you please paste the logs of a run with enabled trace logging (--trace) here?

@brootware
Copy link

Just tested this out, it's currently working with the flag for me.

@iwilltry42
Copy link
Member

@Brucius

Just tested this out, it's currently working with the flag for me.

Does it still not work with v3.1.1 (without the --no-hostip flag)?

@sasumaki
Copy link

sasumaki commented Oct 7, 2020

INFO[0007] (Optional) Trying to get IP of the docker host and inject it into the cluster as 'host.k3d.internal' for easy access 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x416a38b]

goroutine 1 [running]:
bufio.(*Reader).Read(0x0, 0xc000357000, 0x1000, 0x1000, 0x30, 0x30, 0x4b851e0)
        bufio/bufio.go:206 +0xab
bufio.(*Scanner).Scan(0xc000829268, 0x4d155c0)
        bufio/scan.go:214 +0xa9
github.com/rancher/k3d/v3/pkg/cluster.resolveHostnameFromInside(0x4d155c0, 0xc0000360a0, 0x4d25320, 0x52ff700, 0xc0003c9b80, 0x4bde536, 0x14, 0x41f9765, 0xc000130040, 0x4bc1260, ...)
        github.com/rancher/k3d/v3/pkg/cluster/host.go:83 +0x21e
github.com/rancher/k3d/v3/pkg/cluster.GetHostIP(0x4d155c0, 0xc0000360a0, 0x4d25320, 0x52ff700, 0xc000418700, 0x0, 0x0, 0x0, 0x0, 0x0)
        github.com/rancher/k3d/v3/pkg/cluster/host.go:60 +0x17e
github.com/rancher/k3d/v3/pkg/cluster.ClusterCreate(0x4d155c0, 0xc0000360a0, 0x4d25320, 0x52ff700, 0xc000418700, 0x0, 0x0)
        github.com/rancher/k3d/v3/pkg/cluster/cluster.go:363 +0x17b5
github.com/rancher/k3d/v3/cmd/cluster.NewCmdClusterCreate.func1(0xc000402b00, 0xc000404640, 0x0, 0x2)
        github.com/rancher/k3d/v3/cmd/cluster/clusterCreate.go:83 +0x14c
github.com/spf13/cobra.(*Command).execute(0xc000402b00, 0xc000404620, 0x2, 0x2, 0xc000402b00, 0xc000404620)
        github.com/spf13/[email protected]/command.go:846 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x52bfd40, 0xc0000320b0, 0x4, 0x4)
        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

with v3.1.1 and without --no-hostip flag. Works with the flag.

@iwilltry42
Copy link
Member

@sasumaki oh, sorry for that ugly bug and thanks for reporting!
Can you please try with https://github.com/rancher/k3d/releases/tag/v3.1.2-beta.0 ?

@sasumaki
Copy link

sasumaki commented Oct 7, 2020

Works now with v3.1.2-beta.0 :)

@iwilltry42
Copy link
Member

Thanks for testing @sasumaki ! :)
Does it show any warning or other log message saying, that getting the host IP failed? (Just curiosity)

@sasumaki
Copy link

sasumaki commented Oct 7, 2020

 k3d cluster create -a 2
INFO[0000] Created network 'k3d-k3s-default'            
INFO[0000] Created volume 'k3d-k3s-default-images'      
INFO[0001] Creating node 'k3d-k3s-default-server-0'     
INFO[0003] Pulling image 'docker.io/rancher/k3s:v1.18.9-k3s1' 
INFO[0007] Creating node 'k3d-k3s-default-agent-0'      
INFO[0008] Creating node 'k3d-k3s-default-agent-1'      
INFO[0009] Creating LoadBalancer 'k3d-k3s-default-serverlb' 
INFO[0011] Pulling image 'docker.io/rancher/k3d-proxy:v3.1.2-beta.0' 
INFO[0017] (Optional) Trying to get IP of the docker host and inject it into the cluster as 'host.k3d.internal' for easy access 
INFO[0024] Cluster 'k3s-default' created successfully!  
INFO[0024] You can now use it like this:                
kubectl cluster-info

@iwilltry42
Copy link
Member

Thanks @sasumaki !
I also added additional log output now (coming in the next version) to make it clear if it worked or not 👍

Thanks a lot for your feedback here folks" 👍

@brootware
Copy link

@Brucius

Just tested this out, it's currently working with the flag for me.

Does it still not work with v3.1.1 (without the --no-hostip flag)?

I am on v3.1.0

k3d version v3.1.0
k3s version latest (default)

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

5 participants