Cette page présente des solutions de dépannage lorsque le proxy Extensible Service Proxy (ESP) est déployé sur une machine virtuelle (VM) Compute Engine.
Afficher les journaux sur l'instance de VM
L'observation du journal d'exécution d'Endpoints sur l'instance de VM permet de résoudre certains problèmes.
Pour afficher le journal, procédez comme suit :
Utilisez ssh pour vous connecter à la machine virtuelle :
gcloud config set project YOUR_PROJECT_ID
gcloud compute ssh INSTANCE_NAME
Remplacez YOUR_PROJECT_ID et INSTANCE_NAME par, respectivement, l'ID de votre projet Google Cloudet le nom de l'instance de machine virtuelle.
Consultez le journal d'erreurs de nginx :
Si votre environnement d'exécution Cloud Endpoints est configuré sur une machine virtuelle brute :
tail-f/var/log/nginx/error.log
Si vous exécutez endpoints-runtime dans Docker :
docker ps
docker logs CONTAINER_NAME
Remplacez CONTAINER_NAME par le nom du conteneur.
Afficher l'état du proxy ESP
Pour afficher l'état du proxy ESP, procédez comme suit :
Utilisez ssh pour vous connecter à la machine virtuelle :
gcloud config set project YOUR_PROJECT_ID
gcloud compute ssh INSTANCE_NAME
Remplacez YOUR_PROJECT_ID et INSTANCE_NAME par, respectivement, l'ID de votre projetGoogle Cloud et le nom de l'instance de machine virtuelle.
Récupérez le nom du conteneur ESP (généralement appelé esp) :
docker ps
Obtenez une interface système bash dans le conteneur :
docker exec -it ESP_CONTAINER_NAME /bin/bash
Remplacez ESP_CONTAINER_NAME par le nom du conteneur ESP obtenu à l'étape précédente.
Si vous avez défini rollout_strategy sur managed lorsque vous avez démarré le proxy ESP, et que vous recherchez l'ID de configuration utilisé par une instance ESP, le résultat de la commande curl http://localhost:8090/endpoints_status ressemble à ce qui suit :
La valeur de rolloutId est l'ID de configuration de service utilisé par ESP. Cet ID de configuration doit correspondre à la dernière configuration déployée.
Vous pouvez afficher l'historique des déploiements sur la page Endpoints > Services de la console Google Cloud et consulter les modifications apportées à la configuration de service. Reportez-vous à la section Comparer des fichiers de configuration.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (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, or using \u003ccode\u003edocker logs\u003c/code\u003e for containerized deployments.\u003c/p\u003e\n"],["\u003cp\u003eThe ESP status can be displayed by accessing the container's bash shell and executing the \u003ccode\u003ecurl http://localhost:8090/endpoints_status\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eThe service configuration ID used by ESP can be found in the output of \u003ccode\u003ecurl http://localhost:8090/endpoints_status\u003c/code\u003e within the \u003ccode\u003erolloutId\u003c/code\u003e value.\u003c/p\u003e\n"]]],[],null,["# Troubleshooting Cloud Endpoints on Compute Engine\n\n[OpenAPI](/endpoints/docs/openapi/troubleshoot-gce-deployment \"View this page for the Cloud Endpoints OpenAPI docs\") \\| gRPC\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/grpc/config-file-compare)."]]