Skip to content
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

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

Open
jackwootton opened this issue Oct 17, 2017 · 1 comment
Assignees

Comments

@jackwootton
Copy link

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.
@jackwootton jackwootton changed the title Packing wrapper.proto messages into any.proto type_url resolution fails when packing wrapper.proto messages into any.proto Oct 17, 2017
@jackwootton
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants