From 32c4460e25c535881a9663769985da5cb5de149c Mon Sep 17 00:00:00 2001 From: Mukul Date: Sat, 18 Jul 2026 23:43:14 +0530 Subject: [PATCH] Send invoke/publish status messages to stderr to keep stdout pipeable dapr invoke printed the app response to stdout and then appended 'App invoked successfully' to the same stream, so piping the response into a parser (e.g. jq) failed. Move the success banners and the unix-domain-socket preview warnings in invoke and publish to stderr, consistent with the errors-to-stderr policy from #748. E2E assertions are unaffected: the test spawner captures CombinedOutput. Fixes #1671 Signed-off-by: Mukul --- cmd/invoke.go | 4 ++-- cmd/publish.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/invoke.go b/cmd/invoke.go index fe34664ca5..68aa850762 100644 --- a/cmd/invoke.go +++ b/cmd/invoke.go @@ -74,7 +74,7 @@ dapr invoke --unix-domain-socket /tmp --app-id target --method sample --verb GET print.FailureStatusEvent(os.Stderr, "The unix-domain-socket option is not supported on Windows") os.Exit(1) } else { - print.WarningStatusEvent(os.Stdout, "Unix domain sockets are currently a preview feature") + print.WarningStatusEvent(os.Stderr, "Unix domain sockets are currently a preview feature") } } @@ -88,7 +88,7 @@ dapr invoke --unix-domain-socket /tmp --app-id target --method sample --verb GET if response != "" { fmt.Println(response) } - print.SuccessStatusEvent(os.Stdout, "App invoked successfully") + print.SuccessStatusEvent(os.Stderr, "App invoked successfully") }, } diff --git a/cmd/publish.go b/cmd/publish.go index 6485c2bd40..ed16ad3ff8 100644 --- a/cmd/publish.go +++ b/cmd/publish.go @@ -73,7 +73,7 @@ dapr publish --publish-app-id myapp --pubsub target --topic sample --data '{"key print.FailureStatusEvent(os.Stderr, "The unix-domain-socket option is not supported on Windows") os.Exit(1) } else { - print.WarningStatusEvent(os.Stdout, "Unix domain sockets are currently a preview feature") + print.WarningStatusEvent(os.Stderr, "Unix domain sockets are currently a preview feature") } } @@ -92,7 +92,7 @@ dapr publish --publish-app-id myapp --pubsub target --topic sample --data '{"key os.Exit(1) } - print.SuccessStatusEvent(os.Stdout, "Event published successfully") + print.SuccessStatusEvent(os.Stderr, "Event published successfully") }, }