In den folgenden Abschnitten wird erläutert, wie Sie allgemeine Strategien zur Fehlerbehebung anwenden können, um den Fehler zu beheben. Wenn weiterhin Fehler auftreten, nachdem Sie die Schritte in den Anleitungen zur Fehlerbehebung ausgeführt haben, lesen Sie den Abschnitt Nächste Schritte.
Gute Protokolle mit Cloud Logging ausgeben
Die Fehlerbehebung für Ihre App, die in der App Engine ausgeführt wird, ist einfacher, wenn Sie gute Anwendungsprotokolle für die Fehlerbehebung haben. Achten Sie darauf, dass Ihre Anwendung Logs so schreibt, dass Anfragelogs mit den Anwendungslogs korreliert werden.
Mit korrelierten Logs können Sie die Anfrage identifizieren, die einer weiteren Analyse bedarf, die Anfrage-Spuren finden und die Ursache des Problems analysieren. Weitere Informationen zum Schreiben von Protokollen finden Sie unter Anwendungslogs schreiben.
Unerwartete Latenz beheben
Wenn Probleme mit der Latenz auftreten, gehe so vor:
Prüfen Sie, ob die Latenz alle Anfragen an Ihren Dienst oder nur einen kleinen Prozentsatz davon betrifft. Im App Engine-Dashboard für die Latenz werden die Latenzen für das 50., 95. und 99. Perzentil angezeigt.
Wenn bei allen drei Messwerten eine hohe Latenz auftritt, ist die Latenz für mindestens 50% Ihrer Anfragen hoch. Wenn im Diagramm für das 99. Perzentil nur eine hohe Latenz angezeigt wird, liegt bei 1% Ihrer Anfragen eine hohe Latenz vor.
Identifizieren Sie die Anfrage mit hoher Latenz, um die Ursache der Latenz zu ermitteln. Mit Cloud Trace oder Cloud Logging können Sie ermitteln, wie lange eine bestimmte Anfrage gedauert hat. Weitere Informationen finden Sie unter App-Latenz.
Wenn Sie mit Cloud Logging Anfragen mit hoher Latenz identifizieren möchten, wenden Sie den Filter traceSampled=true an, um Logs in Cloud Logging mit Traces in Cloud Trace zu verknüpfen. Weitere Informationen finden Sie unter In Cloud Logging einbinden.
Führen Sie die folgenden Schritte aus, um Latenzprobleme zu beheben und die Dienstleistung zu verbessern:
Standardmäßig ist Ihr App Engine-Dienst über das öffentliche Internet zugänglich. Sie können den Dienst jedoch so ändern, dass die Netzwerkverbindungen für den Ein- und Ausgang stärker eingeschränkt werden.
Sie können eingehende Verbindungen mit den Einstellungen für den eingehenden Traffic oder über App Engine-Firewallregeln einschränken. Wenn Sie Probleme beim Herstellen einer Verbindung zu Ihrem App Engine-Dienst über VPC-Netzwerke oder Internetressourcen haben, prüfen Sie Folgendes:
Stellen Sie eine Instanz in den Debug-Modus und stellen Sie eine SSH-Verbindung zur Instanz her, während weiterhin Live-Traffic verarbeitet wird. Nachdem Sie eine Verbindung zur Instanz hergestellt haben, können Sie sie mit gängigen Befehlszeilentools beheben.
Wenn Sie in der App Engine-Dokumentation keine Lösung für Ihr Problem finden, gehen Sie so vor:
Wenden Sie sich an den Cloud Customer Care, um eine Supportanfrage zu stellen.
Sie können sich von der Community unterstützen lassen, indem Sie Fragen auf Stack Overflow stellen, oder mit dem Tag google-app-engine nach ähnlichen Problemen suchen.
[[["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-01 (UTC)."],[[["\u003cp\u003eThis page provides guidance on troubleshooting errors encountered while using App Engine, with links to resources for deployment, serving, latency, and connectivity issues.\u003c/p\u003e\n"],["\u003cp\u003eEnsure your application uses Cloud Logging effectively to correlate request logs with application logs, which aids in identifying and analyzing the root cause of issues.\u003c/p\u003e\n"],["\u003cp\u003eWhen addressing latency problems, determine if it affects all requests or a small percentage and utilize the App Engine latency dashboard, Cloud Trace, or Cloud Logging to pinpoint the source of latency.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine service connectivity issues can be resolved by reviewing ingress settings, App Engine firewall rules, and VPC network firewall rules, and by using debug mode to access instances.\u003c/p\u003e\n"],["\u003cp\u003eIf you continue to encounter errors even after following the troubleshooting steps, then contact support for further assistance.\u003c/p\u003e\n"]]],[],null,["# Troubleshoot App Engine errors\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThis page describes the troubleshooting process for errors you might encounter while\nusing App Engine. For information about incidents affecting Google Cloud\nservices, refer to the [Google Cloud Service Health Dashboard](https://status.cloud.google.com/summary) and [All incidents reported for App Engine](https://status.cloud.google.com/products/kchyUtnkMHJWaAva8aYc/history).\n\nSee the following pages for guidance on how to resolve issues related to your app:\n\n- [Troubleshoot deployment issues](/appengine/docs/flexible/troubleshooter/deployment)\n- [Troubleshoot serving issues](/appengine/docs/flexible/troubleshooter/serving)\n- [Troubleshoot elevated latency in your app](/appengine/docs/flexible/troubleshooter/latency)\n- [App Engine connectivity strategies](/appengine/docs/flexible/troubleshooter/connectivity)\n\nApp Engine troubleshooting strategies\n-------------------------------------\n\nThe following sections explain how you can apply general troubleshooting\nstrategies to resolve your error. If you continue to encounter errors\neven after following the steps in the troubleshooting guides, see [What's next](#whats-next).\n\n### Output good logs using Cloud Logging\n\nTroubleshooting your app running on App Engine is easier if you have good\napplication logs for debugging. Ensure your application writes logs in a way that\n[correlates request logs with the application logs](/appengine/docs/flexible/writing-application-logs#correlate_logs).\n\nWith correlated logs you can identify the request that needs further analysis,\nfind the request trace, and analyze the root cause of the issue. For more\ninformation on writing logs, see [Write application logs](/appengine/docs/flexible/writing-application-logs#writing_app_logs).\n\n### Resolve unexpected latency\n\nIf you encounter issues with latency, do the following:\n\n1. Check if the latency is affecting all requests to your service or only a\n small percentage. The [App Engine latency dashboard](/appengine/docs/flexible/monitoring-and-alerting-latency#checking_the_latency_dashboard) shows 50th,\n 95th, and 99th percentile latency.\n\n If you have high latency on all three of these metrics, you have high latency\n for at least 50% of your requests. If you only see high latency in the\n 99th percentile graph, you have high latency in 1% of your requests.\n2. Identify the request with high latency to understand the source of\n latency. You can use Cloud Trace or Cloud Logging to understand how\n long a particular request has taken. For more information, see [Understanding app latency](/appengine/docs/flexible/monitoring-and-alerting-latency#understanding_app_latency).\n\n To identify requests with high latency using Cloud Logging, apply the `traceSampled=true` filter to correlate logs in Cloud Logging with traces in Cloud Trace. For more information, see [Integrate with Cloud Logging](/trace/docs/trace-log-integration).\n3. Try the following steps to fix latency issues, and improve service performance:\n\n - Adjust your [CPU, memory, and disk resources](/appengine/docs/flexible/reference/app-yaml#services).\n\n - Adjust [scaling settings](/appengine/docs/flexible/how-instances-are-managed#instance_scaling).\n\n \u003c!-- --\u003e\n\n - Consider using [Profiler](/appengine/docs/flexible/cloud-profiler).\n\n - Modify your source code.\n\nFor more information on how to troubleshoot elevated latency issues, see [Troubleshoot elevated latency in your app](/appengine/docs/flexible/troubleshooter/latency).\n\n### Resolve issues with connectivity\n\nBy default, your App Engine service is accessible on the public internet, however,\nyou can modify the service to have more restrictions on ingress and egress\nnetwork connectivity.\n\nYou can restrict ingress connections with the ingress settings, or through App Engine firewall rules. If you have trouble connecting to your App Engine service from\nVPC networks or internet resources, check the following:\n\n- [Ingress settings](/appengine/docs/flexible/ingress-settings)\n- [App Engine firewall](/appengine/docs/flexible/understanding-firewalls)\n\nTo resolve other connectivity issues, do the following:\n\n- Set an instance into [debug mode](/appengine/docs/flexible/debugging-an-instance),\n and SSH to the instance while it continues to take live traffic. After\n connecting to the instance, you can debug the instance using common command\n line tools.\n\n- Check the [firewall rules on your VPC network](/firewall/docs/firewalls) to make\n sure traffic isn't blocked.\n\n- Check if you have [disabled the external IP](/appengine/docs/flexible/disable-external-ip).\n\nFor more information on how to troubleshoot connectivity issues, see\n[App Engine connectivity strategies](/appengine/docs/flexible/troubleshooter/connectivity).\n\n### What's next\n\nIf you can't find a solution to your problem in the App Engine\ndocumentation, follow these steps:\n\n- Open a support case by contacting [Cloud Customer Care](/support-hub).\n- Get support from the community by [asking questions on StackOverflow](https://stackoverflow.com/questions/tagged/google-app-engine), or search for similar issues using the `google-app-engine` tag.\n- Open bugs or feature requests by using the [public issue tracker](/support/docs/issue-trackers).\n\nFor more information, see [App Engine community](/appengine/docs/flexible/community)."]]