Skip to content

type_url resolution fails when packing wrapper.proto messages into any.proto  #35

@jackwootton

Description

@jackwootton

I'm using wrapper.proto and packing various messages such as StringValue and Int32Value into any.proto. For example

from google.protobuf import wrappers_pb2
from google.protobuf import any_pb2

my_string_value = wrappers_pb2.StringValue(value='My String')
any = any_pb2.Any()
any.pack(my_string_value)

However, the ESP Proxy fails to resolve the type_url defined in message Any:

message Any {
  // A URL/resource name whose content describes the type of the
  // serialized protocol buffer message.
  //
  // For URLs which use the scheme `http`, `https`, or no scheme, the
  // following restrictions and interpretations apply:
  //
  // * If no scheme is provided, `https` is assumed.
  // * The last segment of the URL's path must represent the fully
  //   qualified name of the type (as in `path/google.protobuf.Duration`).
  //   The name should be in a canonical form (e.g., leading "." is
  //   not accepted).
  // * An HTTP GET on the URL must yield a [google.protobuf.Type][]
  //   value in binary format, or produce an error.
  // * Applications are allowed to cache lookup results based on the
  //   URL, or have them precompiled into a binary to avoid any
  //   lookup. Therefore, binary compatibility needs to be preserved
  //   on changes to types. (Use versioned type names to manage
  //   breaking changes.)
  //
  // Schemes other than `http`, `https` (or the empty scheme) might be
  // used with implementation specific semantics.
  //
  string type_url = 1;

  // Must be a valid serialized protocol buffer of the above specified type.
  bytes value = 2;
}

Instead, my client receives a 200 OK response of:

code: 13
details: [{@type: "type.googleapis.com/google.rpc.DebugInfo", stackEntries: [], detail: "internal"}]
message:"Type 'type.googleapis.com/google.protobuf.StringValue' cannot be found."

I'm testing this in a local ESP proxy. The following is the only message logged:

[libprotobuf WARNING external/protobuf_git/src/google/protobuf/util/internal/json_objectwriter.cc:53]
JsonObjectWriter was not fully closed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions