Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Wenn Sie von einer Anfrage an Ihre Cloud Endpoints Frameworks API keine erfolgreiche Antwort erhalten, können Sie mit Cloud Logging in derGoogle Cloud Console Fehler beheben.
Logs ansehen
Rufen Sie in der Google Cloud Console die Seite Logging > Log-Explorer auf.
Wählen Sie in der Drop-down-Liste für Projekte oben auf der Seite dasGoogle Cloud -Projekt aus, in dem Sie die API erstellt haben.
Wählen Sie GAE-Anwendung und Alle Logs aus.
Passen Sie den Zeitraum an, bis Ihnen eine Zeile angezeigt wird, die einen Fehler enthält.
Klicken Sie auf Alle einblenden, um das gesamte Log für den Fehler anzusehen.
Der folgende Abschnitt enthält Informationen zur Fehlerbehebung für bestimmte Fehlermeldungen. Wenn Sie das Problem nicht beheben können, kopieren Sie einen der Logeinträge mit dem Fehler und fügen ihn in eine Textdatei ein. Leiten Sie das Log zusammen mit Ihrer Mitteilung an Google weiter.
503 Service Unavailable
Es kann einige Minuten dauern, bis App Engine erfolgreich auf Anfragen reagiert. Wenn Sie eine Anfrage senden und der Fehler 503 zurückgegeben wird, senden Sie die Anfrage nach ein paar Minuten noch einmal. Falls Sie noch immer keine erfolgreiche Antwort erhalten, prüfen Sie die Cloud Logging-Logs. Im Folgenden finden Sie einige Fehlermeldungen, die in den Cloud Logging-Logs angezeigt werden könnten.
Fehlermeldung
Fehlerbehebung
Der Dienst YOUR_PROJECT_ID.appspot.com wurde nicht gefunden oder die Berechtigung verweigert. Wenn dies ein neuer Endpoints-Dienst ist, prüfen Sie, ob Sie die Dienstkonfiguration mit gcloud bereitgestellt haben.
Endpoints Frameworks für Python protokolliert diesen Fehler, wenn die Dienstkonfiguration für den Dienst, den Sie in der Datei app.yaml angegeben haben, nicht geladen werden kann. Dieser Fehler kann auftreten, wenn Sie das OpenAPI-Dokument für Ihre API nicht mithilfe von gcloud endpoints services
deploy bereitgestellt haben oder die Service Management API nicht aktiviert ist. Wenn Sie das OpenAPI-Dokument für die API bereitstellen, aktiviert der gcloud-Befehl automatisch Folgendes:
Service Management API (servicemanagement.googleapis.com)
Cloud APIs (cloudapis.googleapis.com)
Wenn Sie einen dieser Dienste deaktiviert haben, müssen Sie ihn wieder aktivieren. Weitere Informationen finden Sie unter APIs aktivieren und deaktivieren.
Der Dienst YOUR_PROJECT_ID.appspot.com wurde gefunden, die Dienstkonfiguration für Version SERVICE_CONFIG_ID jedoch nicht.
Endpoints Frameworks Python protokolliert diesen Fehler, wenn die Dienstkonfiguration-ID, die Sie für ENDPOINTS_SERVICE_VERSION in der Datei app.yaml angegeben haben, nicht gefunden werden kann.
So beheben Sie diesen Fehler:
Bearbeiten Sie die Datei app.yaml und legen Sie ENDPOINTS_SERVICE_VERSION auf die Dienstkonfigurations-ID fest.
Stellen Sie die Anwendung noch einmal bereit:
gcloudappdeploy
404 Not Found
Wenn Sie kürzlich zu Endpoints Frameworks Version 2 migriert haben und Ihnen die Fehlermeldung 404 Not Found angezeigt wird, lesen Sie die folgenden Abschnitte, um das Problem zu beheben:
Bei einigen Versionen von Windows PowerShell funktioniert das Beispiel Invoke-WebRequest in den Anleitungen nicht. Wir haben auch einen Bericht erhalten, dass die Antwort eine Liste von Byte ohne Vorzeichen enthielt, die in Zeichen umgewandelt werden mussten. Wenn das Beispiel Invoke-WebRequest nicht das erwartete Ergebnis zurückgibt, versuchen Sie, die Anfrage mit einer anderen Anwendung zu senden. Hier einige Vorschläge dazu:
Starten Sie die Cloud Shell und halten Sie sich an die Schritte für Linux aus der Anleitung, die Sie verwendet haben, um die Anfrage zu senden.
Verwenden Sie eine Drittanbieteranwendung wie die Chrome-Browsererweiterung Postman (angeboten von www.getpostman.com). Beim Erstellen der Anfrage in Postman:
Wählen Sie POST als HTTP-Verb aus.
Wählen Sie für den Header den Schlüssel content-type und den Wert application/json aus.
Geben Sie als Text Folgendes ein: {"message":"hello world"}
Geben Sie die URL für die Beispielanwendung ein. Beispiel:
Laden Sie curl herunter und installieren Sie es. Dann führen Sie es in der Eingabeaufforderung aus. Da Windows doppelte Anführungszeichen innerhalb von einfachen Anführungszeichen nicht verarbeitet, müssen Sie die Option --data im Beispiel so ändern: --data "{\"message\":\"hello world\"}"
Nächste Schritte
Machen Sie sich zuerst mit der Log-Explorer vertraut.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eCloud Logging helps troubleshoot unsuccessful responses from Cloud Endpoints Frameworks APIs, accessible via the Logs Explorer in the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003e503 Service Unavailable\u003c/code\u003e error may occur initially with App Engine; waiting a few minutes and retrying the request is recommended before checking logs.\u003c/p\u003e\n"],["\u003cp\u003eErrors like "No service found" or "permission denied" often indicate a missing service configuration or disabled APIs, which can be resolved by deploying the OpenAPI document and ensuring necessary APIs are enabled.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003e404 Not Found\u003c/code\u003e error after migrating to Endpoints Frameworks version 2 requires specific troubleshooting steps detailed in Java and Python migration guides.\u003c/p\u003e\n"],["\u003cp\u003eIf \u003ccode\u003eInvoke-WebRequest\u003c/code\u003e fails in Windows PowerShell, try using Cloud Shell, Postman, or \u003ccode\u003ecurl\u003c/code\u003e with specific formatting for nested quotation marks.\u003c/p\u003e\n"]]],[],null,["# Troubleshooting response errors\n\nIf you don't get a successful response from a request to your\nCloud Endpoints Frameworks API, you can use Cloud Logging in the\nGoogle Cloud console to help troubleshoot.\n\nViewing logs\n------------\n\n1. In the Google Cloud console, go to the **Logging** \\\u003e\n **Logs Explorer** page.\n\n\n [Go to the Logs Explorer page](https://console.cloud.google.com/logs/query)\n\n \u003cbr /\u003e\n\n2. From the project drop-down list at the top of the page, select the\n Google Cloud project in which you created your API.\n\n3. Select **GAE Application** and **All logs**.\n\n4. Adjust the time range until you see a row that shows an error.\n\n5. Click **Expand All** to see the entire log for the error.\n\nThe following section provides troubleshooting information for specific error\nmessages. If you are unable to fix the issue, copy one of the log entries that\nshows the error and paste it in a text file. Include the log in any\ncommunication that you have with Google.\n\n### `503 Service Unavailable`\n\nApp Engine might take a few minutes to respond successfully to requests. If you\nsend a request and get a `503` error, wait a few minutes and try the\nrequest again. If you still don't get a successful response, check the\nCloud Logging logs. The following are some error messages that you might\nsee in the Cloud Logging logs.\n\n### `404 Not Found`\n\nIf you recently migrated to Endpoints Frameworks version 2, and you\nget the `404 Not Found` error message, see the following sections to\ntroubleshoot the issue:\n\n- [Java: Troubleshooting](/endpoints/docs/frameworks/java/migrating#api_returns_404_errors_but_api_explorer_still_lists_apis_correctly)\n- [Python: Troubleshooting](/endpoints/docs/frameworks/python/migrating#api_returns_404_errors_but_api_explorer_still_lists_apis_correctly)\n\nIssues with the example `Invoke-WebRequest`\n-------------------------------------------\n\nIn some versions of Windows PowerShell, the example `Invoke-WebRequest` in the\n[tutorials](/endpoints/docs/frameworks/tutorials) fails. We have also received a\nreport that the response contained a list of unsigned bytes that had to be\nconverted to characters. If the example `Invoke-WebRequest` didn't return the\nexpected result, try sending the request using another application. Following\nare a few suggestions:\n\n- [Start Cloud Shell](/shell/docs/starting-cloud-shell), and follow the Linux steps in the tutorial that you were using to send the request.\n- Use a third-party application such as the Chrome browser extension Postman\n (offered by `www.getpostman.com`). When creating the request in Postman:\n\n - Select `POST` as the HTTP verb.\n - For the header, select the key `content-type` and the value `application/json`.\n - For the body, enter: `{\"message\":\"hello world\"}`\n - Enter the URL for the sample application. For example:\n\n https://example-project-12345.appspot.com/_ah/api/echo/v1/echo\n\n- Download and install [`curl`](https://curl.haxx.se/download.html), which you\n run in the Command prompt. Because Windows doesn't handle double quotation\n marks nested inside single quotation marks, you have to change the `--data`\n option in the example, as follows: `--data \"{\\\"message\\\":\\\"hello world\\\"}\"`\n\nWhat's next\n\n- Get started using the [Logs Explorer](/logging/docs/view/logs-explorer-interface).\n\n- Learn how to [route logs](/logging/docs/export/configure_export_v2).\n\n- Use [filters](/logging/docs/view/advanced_filters)\n for advanced filtering, such as getting all requests with a latency greater\n than 300 milliseconds."]]