Re: Could not automatically determine credentials.

2,207 views
Skip to first unread message
Message has been deleted

EPS Dev-Team

unread,
Sep 11, 2019, 5:04:13 PM9/11/19
to Google App Engine
-- MORE INFORMATION --
The service account was created on Jul 17, 2017 for APP Engine Default Service Account. Downloaded the .json file some 2 years ago and never had a problem with it until recently. The downloaded(to local machine) .json file is still the target for GOOGLE_APPLICATION_CREDENTIALS variable. 

However, I see auto generated credentials file(application_default_credentials.json) when I do "gcloud auth application-default login". But the GOOGLE_APPLICATION_CREDENTIALS variable still refers to the downloaded(2 yrs ago) .json file and not the auto generated credentials.

I did not have to do "gcloud auth application-default login" before, I think this is a new step and that may be generating a new .json credentials file thats causing the disruption.

Any ideas what I should be doing?


On Wednesday, September 11, 2019 at 11:44:32 AM UTC-7, EPS Dev-Team wrote:
I have set the GOOGLE_APPLICATION_CREDENTIAL env variable to a path on my local machine.
Deployed the flex app that uses Django. The application runs fine for 6 hours approx. I see the following exception afterwards:

LOG TRACE:
{
insertId: "m90qw3t62w08eghn1" 
labels: {…} 
logName: "projects/<company>/logs/appengine.googleapis.com%2Fstdout" 
receiveTimestamp: "2019-09-11T16:57:06.769920232Z" 
resource: {
labels: {…} 
type: "gae_app" 
}
textPayload: "Exception: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please see https://cloud.google.com/docs/authentication/getting-started " 
timestamp: "2019-09-11T16:57:02Z" 
}

ERROR TRACE:
google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please see https://cloud.google.com/docs/authentication/getting-started 
    1. at default (/env/lib/python3.5/site-packages/google/auth/_default.py:317)
    2. at _determine_default_project (/env/lib/python3.5/site-packages/google/cloud/_helpers.py:179)
    3. at _determine_default_project (/env/lib/python3.5/site-packages/google/cloud/datastore/client.py:75)
    4. at _determine_default (/env/lib/python3.5/site-packages/google/cloud/datastore/client.py:222)
    5. at __init__ (/env/lib/python3.5/site-packages/google/cloud/client.py:169)
    6. at __init__ (/env/lib/python3.5/site-packages/google/cloud/client.py:215)
    7. at __init__ (/env/lib/python3.5/site-packages/google/cloud/datastore/client.py:205)


I was under the impression that the deployed app will have access to the datastore and its entities. Even with the above exception, the entities seem to be getting updated somehow - probably intermittent. 
Do I have to set the credentials separately on the cloud?


Elliott (Cloud Platform Support)

unread,
Sep 12, 2019, 5:30:24 PM9/12/19
to Google App Engine
Hello,

You have technical questions about your deployment and need advice. Google Groups are meant to discuss and share opinions about end products. Please post your scenario on Stackoverflow, where you may receive advice from our programming community.

EPS Dev-Team

unread,
Sep 12, 2019, 7:41:05 PM9/12/19
to Google App Engine
Thank you.
I'm working with the cloud support team to identify the issue. 
Reply all
Reply to author
Forward
0 new messages