Repository navigation
Conversation
Since v1.18.5, the SDK attaches a grpc-trace-bin binary metadata header
to every outgoing gRPC call. The sidecar forwards InvokeBinding call
metadata verbatim into the output binding component's metadata (e.g.
Azure Blob x-ms-meta-*, Service Bus application properties), which
must be valid UTF-8. The binary header broke Blob request signing
(403 AuthenticationFailed) and violated Service Bus's UTF-8
requirement.
Strip any binary ("-bin" suffixed) gRPC metadata from the call options
right before invoking InvokeBinding, leaving the shared trace-context
helper used by every other Dapr client untouched. traceparent/tracestate
are still sent since they're valid UTF-8 text.
Author
|
For reference, the runtime-side fix is now up for review: dapr/dapr#10388 (fixes dapr/dapr#10387 by skipping -bin\ suffixed metadata keys in InvokeBinding's forwarding loop). This client-side change remains useful as defense-in-depth once that merges - protects users on older runtimes and avoids sending metadata that serves no purpose on this call. |
Contributor
|
This PR is astonishingly similar to #1901 but the other adds a null check on the headers, so I'm going to take it. Thank you for taking the time to contribute this though! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1897
InvokeBindingAsync was sending the binary grpc-trace-bin header (added in #1858) on every call. The sidecar forwards a call's incoming metadata verbatim into the invoked binding component's metadata, and components like Azure Blob Storage and Service Bus require that metadata to be valid UTF-8 text. Since grpc-trace-bin's bytes come from the random trace/span ID, this caused intermittent failures - Blob request signing broke (403 AuthenticationFailed) and Service Bus rejected the message outright (
ot a valid UTF-8 string).
This strips any binary (-bin suffixed) gRPC metadata from the call options right before invoking InvokeBinding, so it can't be forwarded into binding component metadata regardless of source. raceparent/ racestate are still sent since they're plain text and don't cause this issue.
Root cause is really in the runtime (InvokeBinding shouldn't forward binary metadata into component metadata at all) - tracked in dapr/dapr#10387. This is a client-side mitigation so .NET SDK users aren't affected while that's being worked on.
Checklist