414 error when trying to send bytes in SE protobuf request

Hi folks,

As a development tool, I’m trying to send a compressed bytes value in the grpc request message to my service extension. This is just compressed JSON text encoded as a byte string, and the size is ~5300 bytes. However, I immediately get back a 414: The Request-URI is longer than the server is willing to interpret.

Here is the grpc protobuf:

  rpc InitializeThing (InitRequest) returns (Response) {
	option (permission.action) = CREATE;
	option (permission.resource) = "ADMIN:NAMESPACE:{namespace}:CLOUDSAVE:RECORD";
	option (google.api.http) = {
	  post: "/v1/admin/namespace/{namespace}/thing/init"
	};
	option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
	  summary: "Create or refresh thing state"
	  description: "Create or refresh thing state"
	  security: {
		security_requirement: {
		  key: "Bearer"
		  value: {}
		}
	  }
      };
  }

  message InitRequest {
	string namespace = 1;
	string id = 2;
	bool reset = 4;
	optional bytes definition = 100;
  }

Is this something configured on the AB server side, or a problem with my protobuf? This is using the generated Unity service extension API. Everything is up-to-date, SDK and extend SE framework and API codegen.

Thanks,
Chris

Hi @chrislambertus,

We have noted your issue and will discuss it internally. We will get back to you with more information as soon as possible.

Thank you for your patience.

1 Like

Hi @chrislambertus

I’ve notice that your protobuf might be missing body: "*" in rpc option for google.api.http.

Based on this description, this is required if you want to put any field other name namespace inside a post body.

Without this body options, it seems that “definition” field is translated into url query parameter and probably caused longer url, triggering HTTP 414.

I suggest you to separate the body content into different message and include this message inside InitRequest message. Similar to guild progress example here

Hope this help.

Thank you.

1 Like

Ahh this was exactly the functionality I was searching for (putting fields into the body instead of URL) but I couldn’t find it. Thank you, it’s working perfectly now!

Cheers, Chris