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

Segfault when running headscale nodes list --output json when backend is not running. #652

Closed
rcmcdonald91 opened this issue Jun 17, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@rcmcdonald91
Copy link

When running headscale nodes list --output json against a server that is offline, a segfault is encountered. headscale nodes list fails gracefully with Could not connect..... This segfault is problematic for frontends that consume json output exclusively.

$ headscale nodes list --output json
panic: runtime error: invalid memory address or nil pointer dereference
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xb1feab]

goroutine 1 [running]:
google.golang.org/grpc.(*ClientConn).Close(0x0)
        google.golang.org/[email protected]/clientconn.go:998 +0x4b
panic({0x1124f80, 0x1c52bc0})
        runtime/panic.go:838 +0x207
google.golang.org/grpc.(*ClientConn).Invoke(0x80203cf18?, {0x1464490?, 0xc00054ec60?}, {0x1292a76?, 0x0?}, {0x118afc0?, 0xc00054c040?}, {0x118b080?, 0xc00054c180?}, {0x0, ...})
        google.golang.org/[email protected]/call.go:32 +0x5e
github.com/juanfont/headscale/gen/go/headscale/v1.(*headscaleServiceClient).ListMachines(0xc00007a780, {0x1464490, 0xc00054ec60}, 0xc0002f4420?, {0x0, 0x0, 0x0})
        github.com/juanfont/headscale/gen/go/headscale/v1/headscale_grpc.pb.go:195 +0xce
github.com/juanfont/headscale/cmd/headscale/cli.glob..func16(0x1c666e0?, {0x125c23c?, 0x2?, 0x2?})
        github.com/juanfont/headscale/cmd/headscale/cli/nodes.go:168 +0x2d0
github.com/spf13/cobra.(*Command).execute(0x1c666e0, {0xc000550980, 0x2, 0x2})
        github.com/spf13/[email protected]/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x1c68260)
        github.com/spf13/[email protected]/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/[email protected]/command.go:902
github.com/juanfont/headscale/cmd/headscale/cli.Execute()
        github.com/juanfont/headscale/cmd/headscale/cli/root.go:85 +0x25
main.main()
        github.com/juanfont/headscale/cmd/headscale/headscale.go:42 +0x235

To Reproduce

  1. Invoke headscale with --output json against a backend that is not running.

Context info

  • Version of headscale used: v0.16.0-beta4 (and v0.15.0)
  • Version of tailscale client: N/A
  • OS (e.g. Linux, Mac, Cygwin, WSL, etc.) and version: FreeBSD 13.1-RELEASE
@rcmcdonald91 rcmcdonald91 added the bug Something isn't working label Jun 17, 2022
@luckman212
Copy link

@theonemcdonald Does this mean headscale is coming someday to pfSense? 👀

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