No logs for Google Cloud Endpoints on Cloud Run

971 views
Skip to first unread message

freder...@ml6.eu

unread,
Jan 20, 2020, 3:58:14 AM1/20/20
to Google Cloud Endpoints
After following the Endpoints on Cloud Run tutorial, I don't see any traffic metrics 
in GCP > Endpoints > Services. However, the authentification layer words, I can 
`curl` the identified paths on my service, but the monitoring / logging layer seems to 
be broken somehow.

I deployed my container using the ENV VAR, so not baking in the endpoints
service config into the docker image, but my colleague did do so with the same results. 

Can anyone provide any pointers on how to fix the broken telemetry? 

Frederik Bode
ML6

Teju Nareddy

unread,
Jan 20, 2020, 1:56:42 PM1/20/20
to Google Cloud Endpoints
Hi Frederik,

You are using ESPv2 Beta, correct? It is highly suggested you bake the service config into the docker image, but it should work if you just place the service name in the correct var.

Could you share the exact command you ran to deploy ESPv2 Beta on Cloud Run?

Also, could you take a look at the ESPv2 application logs for any errors or warnings? My initial guess is that the service account ESPv2 is using does not have permission to call Google Service Control. These logs should show up in the "logs" tab of the Cloud Run service with ESPv2 Beta. You can also view them directly in Stackdriver Logging if you prefer.

freder...@ml6.eu

unread,
Jan 20, 2020, 2:20:33 PM1/20/20
to Google Cloud Endpoints

im.png


Seems like you were right. What are the steps to allow the esp container access to write to the logging service? 

The command: ```  gcloud run deploy "${ESP_NAME}" \
    --allow-unauthenticated \
    --platform=managed \
    --project="${PROJECT_NAME}" \
    --region=europe-west1 ``` ESP_NAME and PROJECT_NAME are just text ENV VARs.

freder...@ml6.eu

unread,
Jan 20, 2020, 2:22:13 PM1/20/20
to Google Cloud Endpoints
Edit: My image was not well formatted. The full line says: 

`Failed to call report, error: INTERNAL:Failed to call service control, str body: \010\007\022#The caller does not have permission`

Teju Nareddy

unread,
Jan 20, 2020, 9:14:57 PM1/20/20
to Google Cloud Endpoints
Yup. Can you try doing the full tutorial, including the part where you build the service config into the docker image (step 4)? I'm unsure if you are providing the service name via env var correctly, as it's not reflected in the deploy command. We can at least verify that this works first (since it's officially supported).


Also, please make sure that you enabled the Endpoints Service. This automatically happens when you run ` gcloud endpoints services deploy ${SERVICE_NAME} `. But if your user has permission errors, then this automatic step might fail and you can run it manually.

Find the endpoint service name in the portal and run: ` gcloud services enable "${SERVICE_NAME}" `

Remember that $ESP_NAME (from your deploy command) is different than the $SERVICE_NAME in the above.

freder...@ml6.eu

unread,
Jan 21, 2020, 4:45:55 AM1/21/20
to Google Cloud Endpoints
I figured it out. The logs say failed to call 'Service Control', but this API was not yet enabled 
on the GCP project. It is mentioned in the tutorial, but the following line:

 In most cases, the gcloud endpoints services deploy command enables these required services.

Is quite misleading, as I didn't use Terraform nor explicitly disabled that API. Maybe 
we can update the tutorial to just include something like the following: 

To be sure that all you APIs are enabled, run following three commands: 
```
gcloud services enable servicemanagement.googleapis.com
gcloud services enable servicecontrol.googleapis.com
gcloud services enable endpoints.googleapis.com
```
Then there is a nice copy-and-paste solution that guarantees that it will work without having to check 
if it's already enabled or not. 



On Monday, 20 January 2020 09:58:14 UTC+1, freder...@ml6.eu wrote:

Teju Nareddy

unread,
Jan 21, 2020, 1:25:36 PM1/21/20
to Google Cloud Endpoints
Thanks for sharing, I will simplify that section of documentation. Glad it worked out!
Reply all
Reply to author
Forward
0 new messages