Skip to content

[BUG] GRPCFeatureClient sends invalid header keys that are incompatible with Python gRPC (metadata was invalid) #165

@AryAgarwal

Description

@AryAgarwal

🐛 Describe the bug

The current Python implementation of GRPCFeatureClient uses uppercase and hyphenated gRPC metadata headers:

HEADER_CALLER_ID = "ONLINE-FEATURE-STORE-CALLER-ID"
HEADER_CALLER_TOKEN = "ONLINE-FEATURE-STORE-AUTH-TOKEN"

When these are passed to the grpcio Python client, it results in the following error:

E0000 00:00:1751799888.906104 110369931 filter_stack_call.cc:402] validate_metadata: INTERNAL:Illegal header key
Error persisting features: metadata was invalid: [('ONLINE-FEATURE-STORE-CALLER-ID', 'demo'), ('ONLINE-FEATURE-STORE-AUTH-TOKEN', 'demo_token'), ('job-id', 'demo'), ('job-token', 'demo_token')]

This is a known gRPC Python restriction — header keys must be lowercase ASCII without hyphens due to HTTP/2 requirements:

https://stackoverflow.com/questions/45071567/how-to-send-custom-header-metadata-with-python-grpc

Python clients should be able to use GRPCFeatureClient without modifying the SDK or subclassing it just to avoid metadata violations.

Where This Happens

py-sdk/grpc_feature_client/grpc_feature_client/client.py, during metadata construction for gRPC calls.

Would love it if someone could help solve my error.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions