Skip to content

dapr invoke appends its success banner to stdout after the response body, corrupting piped output #1671

Description

@Mukuwul

Expected Behavior

stdout of dapr invoke carries only the app's response payload, so piping works (dapr invoke ... | jq); status and progress messages go to stderr, consistent with the project policy established in #748.

Actual Behavior

cmd/invoke.go prints the response to stdout and then prints ✅ App invoked successfully — also to stdout, immediately after the payload (cmd/invoke.go#L88-L91). Piping the response into any parser fails:

$ dapr invoke --app-id myapp --method getstate | jq .
{ ...valid json... }
✅  App invoked successfully      ← jq: parse error

The Unix-domain-socket preview warning has the same problem (cmd/invoke.go#L77), as do the equivalent banner and warning in dapr publish (cmd/publish.go#L95, cmd/publish.go#L76).

Steps to Reproduce the Problem

  1. dapr run --app-id myapp -- <any app exposing a method that returns JSON>
  2. dapr invoke --app-id myapp --method <method> | jq .
  3. jq fails to parse because the success banner is appended to the payload on stdout.

I have a fix ready and will open a PR right after filing this.

Release Note

RELEASE NOTE: FIX dapr invoke and dapr publish status messages now go to stderr, keeping stdout clean for the response payload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions