azure-dev icon indicating copy to clipboard operation
azure-dev copied to clipboard

[Issue] SIGSEGV when azure.yaml is empty

Open jongio opened this issue 6 months ago • 1 comments

  1. create azure.yaml (empty)
  2. run azd show

You get this, would be nice to have a friendly message.

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

goroutine 1 [running]:
github.com/azure/azure-dev/cli/azd/cmd.(*showAction).Run(0xc0000a6240, {0x55f7c78ed8e8, 0xc0003f1410})
        /mnt/vss/_work/1/s/cli/azd/cmd/show.go:106 +0x125
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction.func1({0x55f7c78ed8e8?, 0xc0003f1410?})
        /mnt/vss/_work/1/s/cli/azd/cmd/middleware/middleware.go:127 +0x2e8
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*TelemetryMiddleware).Run(0xc0002a8de0, {0x55f7c78ed8e8, 0xc000110810}, 0xc00007c940)
        /mnt/vss/_work/1/s/cli/azd/cmd/middleware/telemetry.go:85 +0x8b8
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction.func1({0x55f7c78ed8e8, 0xc000110810})
        /mnt/vss/_work/1/s/cli/azd/cmd/middleware/middleware.go:125 +0x2a2
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*ExperimentationMiddleware).Run(0x55f7c7168f7c?, {0x55f7c78ed8e8, 0xc000110810}, 0xc00007c940)
        /mnt/vss/_work/1/s/cli/azd/cmd/middleware/experimentation.go:64 +0x4d6
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction.func1({0x55f7c78ed8e8, 0xc000110810})
        /mnt/vss/_work/1/s/cli/azd/cmd/middleware/middleware.go:125 +0x2a2
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*DebugMiddleware).Run(0xc0000126d8, {0x55f7c78ed8e8, 0xc000110810}, 0xc00007c940)
        /mnt/vss/_work/1/s/cli/azd/cmd/middleware/debug.go:48 +0x311
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction.func1({0x55f7c78ed8e8, 0xc000110810})
        /mnt/vss/_work/1/s/cli/azd/cmd/middleware/middleware.go:125 +0x2a2
github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction(0xc000477050, {0x55f7c78ed8e8, 0xc000110810}, 0x55f7c765f380?, {0x55f7c78e2018?, 0xc0000a6240})
        /mnt/vss/_work/1/s/cli/azd/cmd/middleware/middleware.go:131 +0x226
github.com/azure/azure-dev/cli/azd/cmd.(*CobraBuilder).configureActionResolver.func1(0xc000464f00, {0x55f7c7fd72c0?, 0x0, 0x0})
        /mnt/vss/_work/1/s/cli/azd/cmd/cobra_builder.go:142 +0x4cf
github.com/spf13/cobra.(*Command).execute(0xc000464f00, {0x55f7c7fd72c0, 0x0, 0x0})
        /home/cloudtest/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x694
github.com/spf13/cobra.(*Command).ExecuteC(0xc000420a00)
        /home/cloudtest/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x38d
github.com/spf13/cobra.(*Command).Execute(...)
        /home/cloudtest/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(0x55f7c78ed8b0?, {0x55f7c78ed8b0?, 0x55f7c7fd72c0?})
        /home/cloudtest/go/pkg/mod/github.com/spf13/[email protected]/command.go:895 +0x47
main.main()
        /mnt/vss/_work/1/s/cli/azd/main.go:61 +0x1fe

jongio avatar Jan 31 '24 18:01 jongio