Nesta página, apresentamos as técnicas de solução de problemas quando o Extensible Service Proxy (ESP) é implantado em uma máquina virtual (VM, na sigla em inglês) do Compute Engine.
Como exibir registros na instância da VM
É possível solucionar problemas consultando o registro do ambiente de execução do Endpoints na instância de VM.
Para ver o registro:
Use ssh para se conectar à sua máquina virtual:
gcloud config set project YOUR_PROJECT_ID
gcloud compute ssh INSTANCE_NAME
Substitua YOUR_PROJECT_ID e
INSTANCE_NAME pelo ID do projeto do Google Cloud
e pelo nome da instância da máquina virtual, respectivamente.
Visualize o registro de erros nginx:
Se você estiver executando "endpoints-runtime" em uma VM bruta:
tail-f/var/log/nginx/error.log
Se você estiver executando endpoints-runtime no Docker:
docker ps
docker logs CONTAINER_NAME
Substitua CONTAINER_NAME pelo nome do contêiner.
Como exibir o status do ESP
Para exibir o status do ESP:
Use ssh para se conectar à sua máquina virtual:
gcloud config set project YOUR_PROJECT_ID
gcloud compute ssh INSTANCE_NAME
Substitua YOUR_PROJECT_ID e
INSTANCE_NAME pelo ID do projetoGoogle Cloud e pelo nome da instância da máquina virtual, respectivamente.
Recupere o nome do contêiner do ESP. Normalmente, o nome do contêiner é esp:
docker ps
Consiga um shell bash no contêiner:
docker exec -it ESP_CONTAINER_NAME /bin/bash
Substitua ESP_CONTAINER_NAME pelo nome do contêiner do ESP da etapa anterior.
Como conseguir o código de configuração do serviço
Se você definiu rollout_strategy como managed quando iniciou o ESP e precisa localizar o código de configuração que uma instância do ESP está usando, a saída próxima ao final do comando curl http://localhost:8090/endpoints_status é semelhante ao seguinte:
O valor no rolloutId é o código de configuração do serviço a ser usado pelo ESP. Esse código de configuração precisa corresponder à configuração implantada mais recentemente.
É possível conferir o histórico de implantação na página Endpoints > Serviços no
console Google Cloud e conferir as alterações feitas na configuração do serviço. Consulte
Como comparar arquivos de configuração.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-18 UTC."],[[["\u003cp\u003eThis guide provides troubleshooting steps for the Extensible Service Proxy (ESP) when deployed on a Compute Engine virtual machine (VM).\u003c/p\u003e\n"],["\u003cp\u003eYou can view logs by connecting to the VM via \u003ccode\u003essh\u003c/code\u003e and checking the \u003ccode\u003enginx\u003c/code\u003e error log (\u003ccode\u003e/var/log/nginx/error.log\u003c/code\u003e) or using \u003ccode\u003edocker logs CONTAINER_NAME\u003c/code\u003e if ESP is within Docker.\u003c/p\u003e\n"],["\u003cp\u003eThe status of ESP can be displayed by connecting to the VM, finding the ESP container name, and then executing \u003ccode\u003ecurl http://localhost:8090/endpoints_status\u003c/code\u003e within the container.\u003c/p\u003e\n"],["\u003cp\u003eTo get the service configuration ID used by ESP when \u003ccode\u003erollout_strategy\u003c/code\u003e is set to \u003ccode\u003emanaged\u003c/code\u003e, examine the \u003ccode\u003erolloutId\u003c/code\u003e value in the output of \u003ccode\u003ecurl http://localhost:8090/endpoints_status\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Troubleshooting Cloud Endpoints on Compute Engine\n\nOpenAPI \\| [gRPC](/endpoints/docs/grpc/troubleshoot-gce-deployment \"View this page for the Cloud Endpoints gRPC docs\")\n\n\u003cbr /\u003e\n\nThis page presents troubleshooting techniques when the\nExtensible Service Proxy (ESP) is deployed on a Compute Engine virtual\nmachine (VM).\n\nViewing logs on the VM instance\n-------------------------------\n\nYou can troubleshoot problems by looking at the Endpoints\nRuntime log on the VM instance.\n\nTo view the log:\n\n1. Use `ssh` to connect to your virtual machine:\n\n ```\n gcloud config set project YOUR_PROJECT_ID\n\n gcloud compute ssh INSTANCE_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eYOUR_PROJECT_ID\u003c/var\u003e and\n \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e with your Google Cloud\n project ID and virtual machine instance name, respectively.\n2. View the `nginx` error log:\n\n If you are running endpoints-runtime on a raw VM: \n\n tail -f /var/log/nginx/error.log\n\n If you are running `endpoints-runtime` within Docker: \n\n ```\n docker ps\n\n docker logs CONTAINER_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eCONTAINER_NAME\u003c/var\u003e with the name of your\n container.\n\nDisplaying ESP status\n---------------------\n\nTo display ESP status:\n\n1. Use `ssh` to connect to your your virtual machine:\n\n ```\n gcloud config set project YOUR_PROJECT_ID\n\n gcloud compute ssh INSTANCE_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eYOUR_PROJECT_ID\u003c/var\u003e and\n \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e with your\n Google Cloud project ID and virtual machine instance name, respectively.\n2. Retrieve the name of the ESP container (typically\n the container name is `esp`):\n\n docker ps\n\n3. Get a bash shell in the container:\n\n ```\n docker exec -it ESP_CONTAINER_NAME /bin/bash\n ```\n\n Replace \u003cvar translate=\"no\"\u003eESP_CONTAINER_NAME\u003c/var\u003e with the name of the\n ESP container from the previous step.\n4. Install [`curl`](https://curl.haxx.se/download.html).\n\n5. Enter the following:\n\n curl http://localhost:8090/endpoints_status\n\n### Getting the service configuration ID\n\nIf you set `rollout_strategy` to `managed` when you started ESP,\nand you need to find the configuration ID that an instance of\nESP is using, near the end of the output from the\n`curl http://localhost:8090/endpoints_status` command, the output is similar to\nthe following: \n\n \"serviceConfigRollouts\": {\n \"rolloutId\": \"2017-08-09r27\",\n \"percentages\": {\n \"2017-08-09r26\": \"100\"\n }\n }\n\nThe value in the `rolloutId` is the service configuration ID that\nESP is using. This configuration ID should match the latest deployed configuration.\nYou can view the deployment history on the **Endpoints** \\\u003e **Services** page in the\nGoogle Cloud console and view changes made to the service configuration. See\n[Comparing configuration files](/endpoints/docs/openapi/config-file-compare)."]]