Die Anwendung gibt diesen Fehler aus, wenn sie versucht, LOG.info("Standardanmeldeinformationen: " + ServiceAccountCredentials.getApplicationDefault());
Code: Select all
"Your default credentials were not found. To set up Application Default Credentials for your environment, see https://cloud.google.com/docs/authentication/external/set-up-adc.","message":"Your default credentials were not found. To set up Application Default Credentials for your environment, see https://cloud.google.com/docs/authentication/external/set-up-adc.","name":"java.io.IOException","extendedStackTrace":[{"class":"com.google.auth.oauth2.DefaultCredentialsProvider","method":"getDefaultCredentials","file":"DefaultCredentialsProvider.java","line":127,"exact":false,"location":"com.google.auth.google-auth-library-oauth2-http-1.22.0.jar","version":"1.22.0"},{"class":"com.google.auth.oauth2.GoogleCredentials","method":"getApplicationDefault","file":"GoogleCredentials.java","line":152,"exact":false,"location":"com.google.auth.google-auth-library-oauth2-http-1.22.0.jar","version":"1.22.0"},
Ich habe die Schritte wie folgt befolgt Google Doc und richten Sie ein KSA und ein GSA ein, binden und kommentieren Sie sie wie beschrieben. Der GSA wird die Rolle eines Editors zugewiesen.
Auf dem Container, in dem mein Dienst ausgeführt wird, kann ich die entsprechende GSA als aktives Konto sehen, wenn ich gcloud auth list ausführe. Ich kann auch die folgenden Curl-Befehle erfolgreich auf dem Container ausführen.
Code: Select all
curl http://metadata.google.internal/computeMetadata/v1/ -H "Metadata-Flavor: Google"
Code: Select all
curl http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token -H "Metadata-Flavor: Google"