Skip to content

GRPC-JS Error: Metadata key contains illegal characters #527

@daaain

Description

@daaain

Environment 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

  1. Send logs via this logger
  2. Wait
  3. 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: grpc/grpc-node#519

Metadata

Metadata

Labels

api: loggingIssues related to the googleapis/nodejs-logging API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions