client_secret_path: cli.initConfig: SIGSEGV #421

Closed
opened 2025-12-29 01:28:45 +01:00 by adam · 5 comments
Owner

Originally created by @almereyda on GitHub (Feb 4, 2023).

Bug description

When starting a 0.20.0 container (on SQLite), it immediately throws:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb0 pc=0x102e75f]

goroutine 1 [running]:
github.com/juanfont/headscale/cmd/headscale/cli.initConfig()
	/go/src/headscale/cmd/headscale/cli/root.go:59 +0x21f
github.com/spf13/cobra.(*Command).preRun(...)
	/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:946
github.com/spf13/cobra.(*Command).execute(0x1cc3040, {0x1d075c0, 0x0, 0x0})
	/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:876 +0x563
github.com/spf13/cobra.(*Command).ExecuteC(0x1cc1f00)
	/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/juanfont/headscale/cmd/headscale/cli.Execute()
	/go/src/headscale/cmd/headscale/cli/root.go:101 +0x25
main.main()
	/go/src/headscale/cmd/headscale/headscale.go:42 +0x235

This is the container running on GKE on Co-OS nodes.

To Reproduce

Run the 0.20.0 container on Kubernetes.

Originally created by @almereyda on GitHub (Feb 4, 2023). **Bug description** When starting a `0.20.0` container (on SQLite), it immediately throws: ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0xb0 pc=0x102e75f] goroutine 1 [running]: github.com/juanfont/headscale/cmd/headscale/cli.initConfig() /go/src/headscale/cmd/headscale/cli/root.go:59 +0x21f github.com/spf13/cobra.(*Command).preRun(...) /go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:946 github.com/spf13/cobra.(*Command).execute(0x1cc3040, {0x1d075c0, 0x0, 0x0}) /go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:876 +0x563 github.com/spf13/cobra.(*Command).ExecuteC(0x1cc1f00) /go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd github.com/spf13/cobra.(*Command).Execute(...) /go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968 github.com/juanfont/headscale/cmd/headscale/cli.Execute() /go/src/headscale/cmd/headscale/cli/root.go:101 +0x25 main.main() /go/src/headscale/cmd/headscale/headscale.go:42 +0x235 ``` This is the container running on GKE on Co-OS nodes. **To Reproduce** Run the 0.20.0 container on Kubernetes.
adam added the bug label 2025-12-29 01:28:45 +01:00
adam closed this issue 2025-12-29 01:28:45 +01:00
Author
Owner

@almereyda commented on GitHub (Feb 4, 2023):

This also happens with 0.19.0, and then with pc=0x102e31f. The rest is the same.

With 0.18.0 it now also appears at 0x102cdbf.

I'm able to reproduce the exact same errors locally.

As this happens in cli.initConfig(), this is most likely a parsing error of the configuration file? Let's inspect it.

@almereyda commented on GitHub (Feb 4, 2023): This also happens with 0.19.0, and then with `pc=0x102e31f`. The rest is the same. With 0.18.0 it now also appears at `0x102cdbf`. I'm able to reproduce the exact same errors locally. As this happens in `cli.initConfig()`, this is most likely a parsing error of the configuration file? Let's inspect it.
Author
Owner

@almereyda commented on GitHub (Feb 4, 2023):

This has something to do with client_secret_path. The error does not occur when this directive is not used, but client_secret given instead.

@almereyda commented on GitHub (Feb 4, 2023): This has something to do with `client_secret_path`. The error does not occur when this directive is not used, but `client_secret` given instead.
Author
Owner

@almereyda commented on GitHub (Feb 21, 2023):

Related #1127

@almereyda commented on GitHub (Feb 21, 2023): Related #1127
Author
Owner

@traxys commented on GitHub (Jul 29, 2023):

Happened to me, it seems it was due to invalid permissions on the client_secret_path, changing the owner of that file fixed it.

@traxys commented on GitHub (Jul 29, 2023): Happened to me, it seems it was due to invalid permissions on the client_secret_path, changing the owner of that file fixed it.
Author
Owner

@almereyda commented on GitHub (Jul 29, 2023):

Thank you!

I believe we can close here, then.

This is not a use case I need to support anymore.

@almereyda commented on GitHub (Jul 29, 2023): Thank you! I believe we can close here, then. This is not a use case I need to support anymore.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#421