temporalio / cli

Command-line interface for running Temporal Server and interacting with Workflows, Activities, Namespaces, and other parts of Temporal
https://docs.temporal.io/cli
MIT License
241 stars 32 forks source link

[Bug] nil pointer when running commands #605

Open dimankus opened 1 week ago

dimankus commented 1 week ago

What are you really trying to do?

Trying to run temporal commands with custom env file temporal --env cloud ...

Describe the bug

[signal SIGSEGV: segmentation violation code=0x2 addr=0x88 pc=0x105a3c5d0]

goroutine 1 [running]:
github.com/temporalio/cli/temporalcli.Execute({0x106e34f50?, 0x14000066dc0?}, {{0x0, 0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, 0x0, ...})
    /home/runner/work/cli/cli/temporalcli/commands.go:328 +0x100
main.main()
    /home/runner/work/cli/cli/cmd/temporal/main.go:15 +0x64

Minimal Reproduction

something wrong with the env yaml file causing an error scenario but it is mishandled causing a nil pointer exception

env:
    cloud:
    address: something.tmprl.cloud:7233
    namespace: something
        tls:
            tls-cert: /path/client.pem
            tls-key: /path/client.key

Environment/Versions

Additional context

https://github.com/temporalio/cli/blob/main/temporalcli/commands.go#L328 is using cctl but if err is not nil cctl is nil https://github.com/temporalio/cli/blob/main/temporalcli/commands.go#L82