Troubleshooting Cloud Endpoints on Compute Engine

This document presents troubleshooting techniques for Google Cloud Endpoints deployments on Compute Engine.

Deploying on Compute Engine without Docker

If you are having problems deploying Cloud Endpoints on Compute Engine, you may need to reinstall the Cloud Endpoints package. To do this, follow these steps:

  1. SSH into your virtual machine instance:

    gcloud config set project [YOUR_PROJECT_ID]
    
    gcloud compute ssh [INSTANCE_NAME]
    

    Replace [YOUR_PROJECT_ID] and [INSTANCE_NAME] with your project ID and virtual machine instance name, respectively. Do not include the square brackets.

  2. Run the following commands:

    export CLOUD_ENDPOINTS_REPO="google-cloud-endpoints-$(lsb_release -c -s)"
    
    echo "deb http://packages.cloud.google.com/apt $CLOUD_ENDPOINTS_REPO main" |
    
    sudo tee /etc/apt/sources.list.d/google-cloud-endpoints.list
    
    curl --silent https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo
    
    apt-key add -
    
    sudo apt-get update
    
    sudo apt-get install endpoints-runtime
    
    PORT=80
    
    sudo service nginx restart
    

You have installed the Cloud Endpoints and restarted the Extensible Service Proxy service.

Deploying on Compute Engine with Docker

If you are having problems deploying Cloud Endpoints in a Docker container on Compute Engine, follow these steps to start the Docker container from the command line:

  1. SSH into your virtual machine:

    gcloud config set project [YOUR_PROJECT_ID]
    
    gcloud compute ssh [INSTANCE_NAME]
    

    Replace [YOUR_PROJECT_ID] and [INSTANCE_NAME] with your project ID and virtual machine instance name, respectively. Do not include the square brackets.

  2. Start the Docker container:

    sudo docker run -d -p 80:8080 --link=echo:echo
    
    gcr.io/endpoints-release/endpoints-runtime:latest -s ${SERVICE_NAME} -v ${SERVICE_VERSION} -a echo:8081
    

You have started a Docker container that is running Cloud Endpoints.

Viewing logs

You can troubleshoot problems by looking at the Cloud Endpoints Runtime log. To view the log, follow these steps:

  1. SSH into your virtual machine

    gcloud config set project [YOUR_PROJECT_ID]
    
    gcloud compute ssh [INSTANCE_NAME]
    

    Replace [YOUR_PROJECT_ID] and [INSTANCE_NAME] with your project ID and virtual machine instance name, respectively. Do not include the square brackets.

  2. View the nginx error log

    If you are running endpoints-runtime on a raw VM:

    tail -f /var/log/nginx/error.log
    

    If you are running endpoints-runtime within Docker:

    docker ps
    
    docker logs [CONTAINER_NAME]
    

    Replace [CONTAINER_NAME] with the name of your container. Do not include the square brackets.

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Cloud Endpoints with OpenAPI