Google developer console API Key

Viewed 88

I'm trying to deploy a flask app on google app engine. The app will query and return data from a Cloud SQL Postgres database via a Graphene Graphql API. The database password to connect to Postgres is stored in Google Secret Manager. I've deployed the app to the default environment but get this error in the logs:

2022-08-22 19:39:12 default[20220822t100002]    description: "Google developer console API key"
2022-08-22 19:39:12 default[20220822t100002]    url: 
"https://console.developers.google.com/project/<my-project>/apiui/credential"
2022-08-22 19:39:12 default[20220822t100002]  }
2022-08-22 19:39:12 default[20220822t100002]  , reason: "CONSUMER_INVALID"
2022-08-22 19:39:12 default[20220822t100002]  domain: "googleapis.com"
2022-08-22 19:39:12 default[20220822t100002]  metadata {
2022-08-22 19:39:12 default[20220822t100002]    key: "service"
2022-08-22 19:39:12 default[20220822t100002]    value: "secretmanager.googleapis.com"
2022-08-22 19:39:12 default[20220822t100002]  }
0220822t100002]  [2022-08-22 0220822t100002]  metadata {
0220822t100002]  [2022-08-22 19:39:13 +0000] [11] [INFO] Shutting down: Master
2022-08-22 19:39:13 default[20220822t100002]  [2022-08-22 19:39:13 +0000] [11] [INFO] 
Reason: Worker failed to boot.

I tried following the url in hopes of learning more but get a 'Failed to load error' from the google console and a message:

There was an error while loading /apis/dashboard?project=<my-project>. Please try again.
Request ID: ###########

I'm thinking that there's some IAM role need to assign to the account in order to correctly use Secret manager from app engine? Has anyone else run into this type of error before and can provide guidance as to where I should look to resolve the problem?

1 Answers

After some further digging, I found references to this error being the result of the project id being incorrect. As it turns out I had written my project name as my_project when in fact the project id was my-project. That correction resolved the issue.

For anyone else who finds this question in the future: Check you're using the correct project id!

Related