bored-table-20691
01/24/2022, 11:18 PMlocal.Command
(in pulumi-command
), I’m seeing some odd behavior in regards to stderr
when the command itself fails.
Specifically, if my command script fails (exits with a non-zero code), I get this reported on my status:
Diagnostics:
command:local:Command (my-script):
error: exit status 1
pulumi:pulumi:Stack (mystack-dev):
error: update failed
But stderr
is never set. Specifically, I’ve tried the following:
ctx.Export("stdout", cmd.Stdout)
ctx.Export("stderr", cmd.Stderr)
pulumi.All(cmd.Stdout, cmd.Stderr).ApplyT(func(args []interface{}) string {
stdout := args[0].(string)
stderr := args[1].(string)
fmt.Println("stdout", stdout)
fmt.Println("stderr", stderr)
return ""
})
But none of this prints out. I also tried just stdout and stderr individually, and no dice.
If, however, the command exits successfully (with a zero error code), then stdout/stderr complete successfully.
My main use case is one of debugging - I want to know why my script fails and that information exists in stderr
, but I cannot access it in the case I need it, which is when it fails 🙂 Am I doing something wrong?great-queen-39697
01/25/2022, 3:05 PMbored-table-20691
01/25/2022, 3:16 PM