-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PROTOCOL_ERROR after upgrading gRPC and Bigtable libraries #1247
Comments
My guess is this is likely #1219. To add the metadata, are you using metadata.FromContext in a client-side interceptor? If so, it will need to be changed to use FromOutgoingContext. |
I've tried explicitly to do: |
Do we know what the string added to metadata by Bigtable is? Does it contain special characters (like newline)? |
That would clear the outgoing metadata. To add an entry to the outgoing metadata, you should do something like this: md, _ := metadata.FromOutgoingContext(ctx)
md = metadata.Join(md, metadata.New(map[string]string{"key": "value"}))
ctx = metadata.NewOutgoingContext(ctx, md) |
@menghanl We're adding a string without special characters or newlines, and we leverage this code: Looks like @dfawley has a PR to fix this for us: What's the status of that? |
So if that is the case: Why does |
It sounds like it's something else in the context, not the metadata, then... Can you log the context? It may also be helpful if you could provide a reproducible test case so we can dig into it. |
So I had tried clearing both incoming and outgoing, but never both. This line is what ended up working for me. No idea why this works, but it does: newCtx := metadata.NewOutgoingContext(
metadata.NewIncomingContext(ctx, nil),
nil,
) |
Almost definitely what's happening here is the client interceptor that adds its metadata is reading your incoming metadata (because it is using In addition, it seems there's characters in the incoming metadata that isn't allowed in text-only outgoing metadata, and that's why we're getting the error we're getting. It would be interesting to know the nature of the redacted authorization/authority values (e.g. are there characters in there outside the range of the base64 encoding set?). Also, you said earlier that you have clients that are running both the latest grpc version and older versions, and only the older versions fail. Can you compare the incoming metadata at the server from those two clients and see if you can discern a difference between them? |
The fix to the bigtable client library was merged, so this should be resolved now. |
The issue was reported here: googleapis/google-cloud-go#628
The Bigtable libraries adds a string to the metadata but otherwise doesn't do much with contexts or metadata. Any ideas what could be going on?
The text was updated successfully, but these errors were encountered: