Google Long Running Operations on Service not working

136 views
Skip to first unread message

Kristian Drucker

unread,
Sep 15, 2020, 8:18:07 AM9/15/20
to Google Cloud Endpoints
Hi,

I'm trying to deploy my API to Google Cloud Endpoints that has been instrumented using https://google.aip.dev/151 as a reference. The API compiles into Go source code and also compiles gapic client source code without any issues. However when I try to push it into Cloud Endpoints I get the familiar error.
`ERROR: (gcloud.endpoints.services.deploy) INTERNAL: Failed to convert server response to JSON`

This happened to me before when I tried to instrument my API with AIP spec. Is there a solution to how to AIP instrumentation on Cloud Endpoints without nearly constantly running into issues with Failed to convert server response to JSON?

Thanks

Kristian

Kristian Drucker

unread,
Sep 15, 2020, 8:34:42 AM9/15/20
to Google Cloud Endpoints
If it helps anyone, here is x-debug-tracking-id 16959523288892406966;o=0

Oscar Söderlund

unread,
Sep 15, 2020, 10:39:28 AM9/15/20
to Google Cloud Endpoints
Hi Kristian!

You can get around this by scrubbing the LRO info annotations before submitting to Cloud Endpoints.

Try running the code in this gist on your descriptor file before submitting.

Kristian Drucker

unread,
Sep 15, 2020, 10:47:43 AM9/15/20
to Google Cloud Endpoints
Hey Oscar,

Thanks, the code works, however there is a small issue when I open the google cloud endpoints portal. 

  • API parse error: Error: ENOENT: no such file or directory, open '/tmp/google/api/client.proto'
I'm getting the following error, but I don't understand why. Is it mine or googles problem?

Kristian

Teju Nareddy

unread,
Sep 15, 2020, 11:18:52 AM9/15/20
to Kristian Drucker, Google Cloud Endpoints
There are two issues here, (1) is deploying to Cloud Endpoints, (2) is viewing your API in the Endpoints Management Portal.

For (1): It should work without scrubbing, I've successfully deployed protos that reference long running operations before. It's not clear how you compiled the descriptor, so we'd need more details. But Oscar's workaround works well if you don't mind the extra step.

(2) may be a known issue in the Endpoints Management Portal. I don't work on that piece of the product, but I've seen various other posts about it in the past. As a workaround, you can try modifying the script Oscar provided to also scrub out google/api/client.proto references.

--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-endpoints/38bf0c92-ad2b-4ed3-94a6-35c427bc072dn%40googlegroups.com.


--

Teju Nareddy

nare...@google.com

Software Engineer

Oscar Söderlund

unread,
Sep 15, 2020, 11:32:29 AM9/15/20
to Google Cloud Endpoints
Having the same issue - haven't managed to get the cloud endpoints portal to work for our API yet - have had that issue since day 1.

Oscar Söderlund

unread,
Sep 15, 2020, 11:34:29 AM9/15/20
to Google Cloud Endpoints
Thanks Teju! I'll add scrubbing google/api/client.proto annotations to our scrubbing script.

Kristian Drucker

unread,
Sep 16, 2020, 2:42:18 AM9/16/20
to Google Cloud Endpoints
Hey,

I wonder how you Teju got it to work without any scrubbing. I've followed AIP docs to the letter regarding LRO's and it's giving me the issue. Currently our "api build" pipeline is a hybrid with Bazel and Makefile. https://gist.github.com/kristiandrucker/347e9132d453798b22eaf1cdfc5b5d08. That's my proto spec, bazel build file and part of the makefile that builds and publishes the api spec. I can't see anything wrong in my implementation, but I don't understand why are these errors happening.

Kristian 

Kristian Drucker

unread,
Sep 16, 2020, 3:57:30 AM9/16/20
to Google Cloud Endpoints
Hey Oscar,

So I've added the scrubbing for the client, but it didn't work by just scrubbing the client. I have to scrub the Default Host service option too. Here is the code that works for me so far https://gist.github.com/kristiandrucker/9314ad1b4f36004ad72d061bdaf49340

Kristian

Oscar Söderlund

unread,
Sep 17, 2020, 11:42:05 AM9/17/20
to Google Cloud Endpoints
Thanks Kristian!

I tried it, and for our file descriptor set, we had to scrub even more to get it to work (everything related to client.proto, resource.proto and field_behavior.proto).

I've updated the code in the gist to what works for us.

Kristian Drucker

unread,
Sep 17, 2020, 1:39:37 PM9/17/20
to Google Cloud Endpoints
Hey,

Thanks, this is what I got so far with the adaptions you've made in yours. A bit cleaner I would say and works without any issues for us. Portal as well as ESPv2 have no errors, just tested it.


Kristian

Reply all
Reply to author
Forward
0 new messages