GRPC-JS Error: Metadata key contains illegal characters
See original GitHub issueEnvironment details
- OS: Debian (using
node:10.15.0
Docker image) - Node.js version: v10.15.0
- npm version: 6.4.1 (using yarn 1.12.3 though)
@google-cloud/logging-winston
version: 1.1.0
Steps to reproduce
- Send logs via this logger
- Wait
- Get error caught by a reporting library, like Sentry in our case
I’ve been seeing this error coming up sporadically, with different characters in the key each time:
Error: Metadata key "�é" contains illegal characters
File "app:///../node_modules/@grpc/grpc-js/build/src/client.js", line 101, col 45, in Http2CallStream.call.on
const error = Object.assign(new Error(status.details), status);
File "events.js", line 187, col 15, in Http2CallStream.emit
File "domain.js", line 459, col 23, in Http2CallStream.EventEmitter.emit
File "app:///../node_modules/@grpc/grpc-js/build/src/call-stream.js", line 71, col 22, in process.nextTick
this.emit('status', status);
File "internal/process/next_tick.js", line 61, col 11, in process._tickCallback
It only appeared once we had a deployment with logging using this library, so I’m pretty sure it’s the logging transport, but can’t be 100% as the stack trace starts in the grpc-js
dependency.
Since I don’t know where it is coming from, I don’t really know how debug it. I’m guessing because the work is offloaded to the next tick I wouldn’t even be able to catch the library error in my client code either 🤷♀
I found this related upstream issue: https://github.com/grpc/grpc-node/issues/519
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Metadata key contains illegal characters · Issue #415 - GitHub
I'm assuming the error could somewhere downstream (in grpc-js itself) that was updated as a sub-dependency. We're on the latest version of ...
Read more >Class Metadata.Key<T> - gRPC on GitHub
Key for metadata entries. Allows for parsing and serialization of metadata. Valid characters in key names. Only the following ASCII characters are allowed ......
Read more >Metadata key contains illegal characters - Bountysource
Metadata key contains illegal characters. ... We've started noticing a new error in production (and in staging env also) that happens ~50 ...
Read more >Sending metadata in gRPC message - Google Groups
Regarding disallowed characters: Normal metadata fields are allowed ASCII codepoints 32 through 126 inclusive (so, control characters and DEL are disallowed).
Read more >metadata.go - Google Git
package metadata // import "google.golang.org/grpc/metadata". import ( ... Only the following ASCII characters are allowed in keys: // - digits: 0-9.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @daaain,
We have released google-gax v1.1.5 that pulls @grpc/grpc-js v0.5.2 in which the invalid headers (that are coming from Node.js http2 module) are printed in a warning, but do not throw exception. Please upgrade your dependencies, it should fix the problem for you.
Thank you for opening this issue. I’m transferring the issue to nodejs-logging since interactions with the logging API are not done by this library but are instead done using the
nodejs-logging
library. As such, I don’t think this issue is specific to thenodejs-logging-winston
library.