8

尝试在https://code.google.com/apis/console为 Google API 创建新项目时出现错误

我希望这个错误是暂时的,但我已经有几个星期无法创建一个新项目了。

该错误似乎已经改变,因为它曾经包含服务器 ip 信息和许多其他数据。删除了一些潜在私人信息的示例:

APPLICATION_ERROR;google.cloudresourcemanager.projects.v1beta1/DeveloperProjects.CreateProject;com.google.apps.framework.request.StatusException: generic::FAILED_PRECONDITION: ;AppErrorCode=9;StartTimeMs=1489595147198;tcp;Deadline(sec)=50.0;ResFormat =UNCOMPRESSED;ServerTimeSec=0.027545452117919922;LogBytes=256;FailFast;EffSecLevel=none;ReqFormat=UNCOMPRESSED;ReqID=已移除;GlobalID=已移除;Server= ip :端口

现在错误要短得多,尽管似乎仍然与相同的原因有关:

com.google.apps.framework.request.StatusException: generic::FAILED_PRECONDITION:

仪表板中的微调器似乎永远旋转,而错误会在几秒钟后出现在警报下方。我尝试了许多项目名称,但都因相同的错误而失败。

我是否缺少某种类型的配额来阻止这种情况?配额菜单项要求我选择一个我没有的项目。

单击错误会将我带到带有以下消息的页面:

您无权对所选资源执行操作。

4

4 回答 4

9

确保为尝试创建项目的用户启用了 Google Developers Console。

Admin.google.com > Apps > Additional Google services > Google Developers Console 并为任何需要它的组织或用户打开。

于 2017-04-05T12:47:27.247 回答
6

除了@AndrewL 在他的解决方案中提供的原因之外,似乎还有另一个可能的原因。

简短回答:
当我尝试通过 Terraform 将新的 GCP 项目与我们的结算帐户相关联时,我遇到了同样的错误。我们的计费帐户有 5 个项目的默认限制(我们已经遇到过),这阻止了新帐户的关联并生成了Error 400: Precondition check failed., failedPreconditionerror消息。为了解决这个问题,我必须先删除/删除一个已经关联的项目,然后才能添加一个新项目。

长答案:
这是我在 Terraform 中遇到的错误消息(敏感数据和 ID 已编辑):

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ module.<MY MODULE PATH>.project
      billing_account: "" => "<MY BILLING ACCOUNT ID>"


Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.<MY MODULE PATH>.project: Modifying... (ID: <MY PROJECT ID>)
  billing_account: "" => "<MY BILLING ACCOUNT ID>"

Error: Error applying plan:

1 error(s) occurred:

* module.<MY MODULE PATH>.project: 1 error(s) occurred:

* google_project.project: Error setting billing account "<MY BILLING ACCOUNT ID>" for project "projects/<MY PROJECT ID>": googleapi: Error 400: Precondition check failed., failedPrecondition

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

我的结算帐户最多有 5 个项目。作为测试,我删除了其中一个项目,然后再次运行 Terraform。然后它成功地将新项目添加到计费帐户。为了仔细检查,我尝试将另一个新项目添加到计费帐户(将金额推至 6),然后再次收到相同的错误消息。

直接删除相关项目之一也可以。

理所当然地,为您的结算帐户的关联项目请求增加限制也将解决此问题。

于 2018-11-08T18:44:50.163 回答
0

另一个可能的原因是组织策略,拒绝 ORG/文件夹/项目级别的特定 API。

于 2020-06-06T20:17:54.997 回答
-1

此错误的另一个可能原因是访问 .xlsx 文件。如果您使用 Google 电子表格访问此文件,则需要通过选择顶部“文件”菜单中的可用选项来保存 .xlsx 文件以另存为 google 表格。

谢谢

于 2020-11-10T00:53:49.160 回答