[英]Google developer console API Key
I'm trying to deploy a flask app on google app engine.我正在尝试在谷歌应用引擎上部署 flask 应用。 The app will query and return data from a Cloud SQL Postgres database via a Graphene Graphql API.
该应用程序将通过石墨烯 Graphql API 从云 SQL Postgres 数据库中查询和返回数据。 The database password to connect to Postgres is stored in Google Secret Manager.
连接 Postgres 的数据库密码存储在 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:我尝试关注 url 以希望了解更多信息,但从谷歌控制台收到“加载失败错误”和一条消息:
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?我认为需要为帐户分配一些 IAM 角色才能正确使用应用引擎中的 Secret Manager? Has anyone else run into this type of error before and can provide guidance as to where I should look to resolve the problem?
以前有没有其他人遇到过这种类型的错误,并且可以就我应该在哪里解决问题提供指导?
After some further digging, I found references to this error being the result of the project id being incorrect.经过进一步挖掘,我发现对这个错误的引用是项目 id 不正确的结果。 As it turns out I had written my project name as
my_project
when in fact the project id was my-project
.事实证明,我将项目名称写为
my_project
而实际上项目 id 是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!对于将来发现此问题的其他任何人:检查您使用的项目 ID 是否正确!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.