Fehlerbehebung bei AlloyDB Auth-Proxy-Verbindungen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite finden Sie Tipps zur Fehlerbehebung, falls Probleme bei der Verwendung des AlloyDB Auth-Proxys auftreten.
Wenn Sie Probleme damit haben, über den AlloyDB Auth-Proxy eine Verbindung mit der AlloyDB-Instanz herzustellen, versuchen Sie Folgendes, um die Problemursache zu ermitteln.
Prüfen Sie die Ausgabe des AlloyDB Auth-Proxys sorgfältig und suchen Sie nach Fehlern. Die Fehlermeldungen enthalten oft die Informationen, die Sie benötigen, um die Ursache des Problems zu ermitteln und eine Lösung zu finden.
Wenn Sie den Fehler 403 Forbidden erhalten und das Dienstkonto zum Authentifizieren des AlloyDB Auth-Proxys verwenden, müssen Sie dafür sorgen, dass das Dienstkonto die richtigen Berechtigungen hat.
Die vordefinierten AlloyDB-Rollen, die diese Berechtigungen bieten, sind „Cloud AlloyDB-Client“ (roles/alloydb.client) und „Cloud AlloyDB-Administrator“ (roles/alloydb.admin). Außerdem müssen Sie die Rolle „Service Usage-Nutzer“ (roles/serviceusage.serviceUsageConsumer) hinzufügen.
Achten Sie darauf, dass die AlloyDB API aktiviert ist.
Ist dies nicht der Fall, wird in Ihren AlloyDB-Proxy-Logs eine Meldung wie z. B. Error 403: Access Not
Configured ausgegeben.
Wenn Sie eine Verbindung über UNIX-Sockets herstellen, prüfen Sie, ob die Sockets erstellt wurden. Rufen Sie dazu das Verzeichnis auf, das Sie beim Start des AlloyDB Auth-Proxys angegeben haben.
Wenn Sie eine Firewallrichtlinie für ausgehende Verbindungen haben, müssen Sie darauf achten, dass sie Verbindungen zu Port 5433 auf der Ziel-AlloyDB-Instanz zulässt.
Kontingentprobleme: Wenn Sie Fehler sehen, die darauf hinweisen, dass Kontingente überschritten wurden, identifizieren Sie entweder die Quelle des Kontingentproblems (z. B. wenn eine Anwendung den Connector missbraucht und unnötigerweise neue Verbindungen erstellt) oder wenden Sie sich an den Support, um eine Erhöhung des AlloyDB API-Kontingents zu beantragen.
Wenn Sie eine 400 Bad Request-Antwort mit einer Fehlermeldung erhalten, die reauth related error enthält, aktualisieren Sie die Standardanmeldedaten Ihrer gcloud-Anwendung:
[[["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-03 (UTC)."],[[["\u003cp\u003eThis page provides troubleshooting advice for users experiencing issues with the AlloyDB Auth Proxy.\u003c/p\u003e\n"],["\u003cp\u003eReview the AlloyDB Auth Proxy output for specific error messages, which often indicate the problem's source and solution.\u003c/p\u003e\n"],["\u003cp\u003eVerify that service accounts have the necessary permissions, including Cloud AlloyDB Client or Admin roles, and the Service Usage Consumer role, to avoid \u003ccode\u003e403 Forbidden\u003c/code\u003e errors.\u003c/p\u003e\n"],["\u003cp\u003eEnsure the AlloyDB Admin API is enabled to prevent \u003ccode\u003eError 403: Access Not Configured\u003c/code\u003e messages in the logs.\u003c/p\u003e\n"],["\u003cp\u003eIf facing quota-related errors or \u003ccode\u003e400 Bad Request\u003c/code\u003e responses with reauth issues, then addressing the source of the quota issue or refreshing the gcloud application default credentials, respectively, may fix the problem.\u003c/p\u003e\n"]]],[],null,["# Troubleshoot AlloyDB Auth Proxy connections\n\nThis page lists troubleshooting tips in case you run into problems using the\nAlloyDB Auth Proxy.\n\nIf you are having trouble connecting to your AlloyDB instance using\nthe AlloyDB Auth Proxy, here are a few things to try to find what's causing the\nproblem.\n\n- Check the AlloyDB Auth Proxy output carefully and look for errors. Often, the\n error messages provide the information you need determine the source of the\n problem and how to solve it.\n\n- If you are getting a `403 Forbidden` error, and you are using a service\n account to authenticate the AlloyDB Auth Proxy, make sure the service account has the\n correct permissions.\n\n The predefined AlloyDB roles that provide these permissions are Cloud\n AlloyDB Client (`roles/alloydb.client`) and Cloud AlloyDB Admin\n (`roles/alloydb.admin`). In addition, you must add the Service Usage Consumer\n (`roles/serviceusage.serviceUsageConsumer`) role.\n- Make sure to enable the AlloyDB API.\n\n If it is not enabled, you see output like `Error 403: Access Not\n Configured` in your AlloyDB Auth Proxy logs.\n- If you are connecting using UNIX sockets, confirm that the sockets were\n created by listing the directory you provided when you started the AlloyDB Auth Proxy.\n\n- If you have an outbound firewall policy, make sure it allows connections\n to port 5433 on the target AlloyDB instance.\n\n | **Note:** The Auth Proxy client uses 5433 to connect to the Auth Proxy server. Port 5432 is the default port for the PostgreSQL protocol over a direct TCP connection.\n- Quota issues: If you see errors related to quotas being exceeded, either\n identify the source of the quota problem (for example, an\n application is misusing the connector and unnecessarily creating new\n connections) or contact support to request an increase to the AlloyDB API\n quota.\n\n- If you get a `400 Bad Request` response with an error message containing\n `reauth related error`, refresh your gcloud application default\n credentials:\n\n gcloud auth application-default login\n\n For more information, see [How Application Default Credentials works](/docs/authentication/application-default-credentials)."]]