<#2506 [BUG] [flytectl] segfault when config file ...
# flyte-github
a
#2506 [BUG] [flytectl] segfault when config file is missing Issue created by wild-endeavor Describe the bug flytectl segfaults apparently when the config file is missing. User reported when creating and listing projects. Issue went away when we created a sandbox style config.yaml in the .flyte directory.
Copy code
INFO[0000] [0] Couldn't find a config file []. Relying on env vars and pflags. 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xfef5a3]
​
goroutine 1 [running]:
github.com/flyteorg/flytectl/cmd/core.CommandContext.AdminClient(...)
        /home/runner/work/flytectl/flytectl/cmd/core/cmd_ctx.go:48
github.com/flyteorg/flytectl/cmd/create.createProjectsCommand({0x23461e8, 0xc000050110}, {0x1ffffffffffffff?, 0x39?, 0x8?}, {0x0, {0x0, 0x0}, {0x0, 0x0}, ...})
        /home/runner/work/flytectl/flytectl/cmd/create/project.go:62 +0xe3
github.com/flyteorg/flytectl/cmd/core.generateCommandFunc.func1(0xc000454c80?, {0xc00027e800, 0x0, 0x8})
        /home/runner/work/flytectl/flytectl/cmd/core/cmd.go:65 +0x625
github.com/spf13/cobra.(*Command).execute(0xc000454c80, {0xc00027e780, 0x8, 0x8})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:852 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0xc00055b900)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x39c
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897
github.com/flyteorg/flytectl/cmd.ExecuteCmd()
        /home/runner/work/flytectl/flytectl/cmd/root.go:134 +0x1e
main.main()
        /home/runner/work/flytectl/flytectl/main.go:12 +0x1d
Copy code
{
 "App": "flytectl",
 "Build": "c06589e",
 "Version": "0.5.25",
 "BuildTime": "2022-05-17 18:15:50.341414608 -0400 EDT m=+0.024193929"
}{
 "App": "controlPlane",
 "Build": "072ce74",
 "Version": "v1.1.2",
 "BuildTime": "2022-05-16 16:49:17.16516979 +0000 UTC m=+0.185367550"
}
Expected behavior A nice error message telling the user to run
config init
maybe? Additional context to reproduce No response Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte