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

wizard.sh crashes on non systemd-based system #35

Closed
ghost opened this issue May 26, 2020 · 0 comments · Fixed by #49
Closed

wizard.sh crashes on non systemd-based system #35

ghost opened this issue May 26, 2020 · 0 comments · Fixed by #49
Assignees
Labels
documentation Improvements or additions to documentation kind/bug Something isn't working question Further information is requested

Comments

@ghost
Copy link

ghost commented May 26, 2020

[ec2-user@ip-172-31-27-163 crowdsec]$ uname -a
Linux ip-172-31-27-163 4.14.177-107.254.amzn1.x86_64 #1 SMP Thu May 7 18:30:14 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

System is amazon linux, latest version. The real culprit seems to be the empty configuration file.

The use of wizard.sh -i with all default entries result with:

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

goroutine 1 [running]:
main.initConfig()
	/data/work/crowdsec/cmd/crowdsec-cli/main.go:56 +0x304
github.com/spf13/cobra.(*Command).preRun(0xc0003fe580)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:868 +0x49
github.com/spf13/cobra.(*Command).execute(0xc0003fe580, 0xc0003fc540, 0x3, 0x3, 0xc0003fe580, 0xc0003fc540)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:804 +0x145
github.com/spf13/cobra.(*Command).ExecuteC(0xc000224580, 0xc0002dbf28, 0x1, 0x1)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:943 +0x317
github.com/spf13/cobra.(*Command).Execute(...)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:883
main.main()
	/data/work/crowdsec/cmd/crowdsec-cli/main.go:139 +0x93d
[26/05/2020:06:43:06][ERR] crowdsec_wizard: fail to install collection crowdsec/whitelists
[26/05/2020:06:43:08][INF] crowdsec_wizard: Installing patterns
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xd87374]

goroutine 1 [running]:
main.initConfig()
	/data/work/crowdsec/cmd/crowdsec-cli/main.go:56 +0x304
github.com/spf13/cobra.(*Command).preRun(0xc0003fedc0)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:868 +0x49
github.com/spf13/cobra.(*Command).execute(0xc0003fedc0, 0x173b730, 0x0, 0x0, 0xc0003fedc0, 0x173b730)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:804 +0x145
github.com/spf13/cobra.(*Command).ExecuteC(0xc000222580, 0xc0002d9f28, 0x1, 0x1)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:943 +0x317
github.com/spf13/cobra.(*Command).Execute(...)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:883
main.main()
	/data/work/crowdsec/cmd/crowdsec-cli/main.go:139 +0x93d
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xd87374]

goroutine 1 [running]:
main.initConfig()
	/data/work/crowdsec/cmd/crowdsec-cli/main.go:56 +0x304
github.com/spf13/cobra.(*Command).preRun(0xc000401340)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:868 +0x49
github.com/spf13/cobra.(*Command).execute(0xc000401340, 0x173b730, 0x0, 0x0, 0xc000401340, 0x173b730)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:804 +0x145
github.com/spf13/cobra.(*Command).ExecuteC(0xc000222580, 0xc0002dbf28, 0x1, 0x1)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:943 +0x317
github.com/spf13/cobra.(*Command).Execute(...)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:883
main.main()
	/data/work/crowdsec/cmd/crowdsec-cli/main.go:139 +0x93d
[26/05/2020:06:43:08][ERR] crowdsec_wizard: unable to register, skipping crowdsec api registration
[26/05/2020:06:43:08][INF] crowdsec_wizard: Crowdsec api registered
./wizard.sh: ligne462: systemctl : commande introuvable
[26/05/2020:06:43:08][ERR] crowdsec_wizard: unable to start crowdsec. exiting
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xd87374]

goroutine 1 [running]:
main.initConfig()
	/data/work/crowdsec/cmd/crowdsec-cli/main.go:56 +0x304
github.com/spf13/cobra.(*Command).preRun(0xc0003ff600)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:868 +0x49
github.com/spf13/cobra.(*Command).execute(0xc0003ff600, 0x173b730, 0x0, 0x0, 0xc0003ff600, 0x173b730)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:804 +0x145
github.com/spf13/cobra.(*Command).ExecuteC(0xc000222580, 0xc0002d9f28, 0x1, 0x1)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:943 +0x317
github.com/spf13/cobra.(*Command).Execute(...)
	/home/ec2-user/go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:883
main.main()
	/data/work/crowdsec/cmd/crowdsec-cli/main.go:139 +0x93d
@ghost ghost added kind/bug Something isn't working documentation Improvements or additions to documentation question Further information is requested labels May 26, 2020
@buixor buixor self-assigned this May 29, 2020
@buixor buixor mentioned this issue Jun 1, 2020
AlteredCoder pushed a commit that referenced this issue Jun 1, 2020
registergoofy pushed a commit that referenced this issue Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation kind/bug Something isn't working question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant