简体   繁体   English

谷歌开发者控制台 API 密钥

[英]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.

相关问题 Firebase 控制台无效 api 键错误 - Firebase invalid api key error in console 查询 Google Play Developer 时出现意外错误 API - Unexpected error when querying Google Play Developer API 用于本地测试的 Google API 密钥 - Google API Key for Local Testing Google Search Console API 未返回任何数据 - Google Search Console API is returning no data 谷歌地图 API,不会验证密钥是否受限 - Google Maps API, wont verify if key restricted Google Search Console API 建议为不熟悉的项目编号启用 API - Google Search Console API suggests enabling API for unfamiliar project number 华为开发者控制台中的 Firestore 依赖项 - Firestore dependencies in Huawei developer console 使用环境变量,Firebase invalid api key error in console - using the environment variable, Firebase invalid api key error in console Firebase 无效 api 控制台中的密钥错误(错误(auth/invalid-api-key)) - Firebase invalid api key error in console ( Error (auth/invalid-api-key)) 该请求缺少有效的 API 密钥 Google 搜索 API python - The request is missing a valid API key Google search API python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM