FAILED_PRECONDITION when trying to create a new Google API project

前端 未结 4 1274
终归单人心
终归单人心 2021-01-03 08:19

I am getting an error when attempting to create a new project for Google API at https://code.google.com/apis/console

I was hoping the error was temporary, but I have

相关标签:
4条回答
  • 2021-01-03 08:47

    Another possible reason for this error can be accessing the .xlsx file. If you are accessing this file using Google spreadsheet then you need to save the .xlsx file in to save as google sheets by choosing the option available in the File menu at the top.

    Thanks

    0 讨论(0)
  • 2021-01-03 08:49

    Another possible reason for this is Organization policy, denying the particular API on ORG/Folder/project level.

    0 讨论(0)
  • 2021-01-03 08:51

    Make sure that the Google Developers Console is on for the user that is trying to create the project.

    Admin.google.com > Apps > Additional Google services > Google Developers Console and turn on for any org or user that needs it.

    0 讨论(0)
  • 2021-01-03 09:01

    Looks like there's another possible cause, in addition to the one that @AndrewL provided in his solution.

    Short answer:
    I ran into the same error when I attempted to associate a new GCP project with our billing account via Terraform. Our billing account has a default limit of 5 projects (which we had already met), and this blocked the association of new accounts and generated the Error 400: Precondition check failed., failedPreconditionerror message. To fix, I had to remove/delete one of the already associated projects before I could add a new one.

    Long answser:
    Here is the error message I encountered in Terraform (sensitive data and IDs redacted):

    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.
    

    My billing account was at its maximum of 5 projects. As a test, I removed one of the projects and then ran Terraform again. It then successfully added the new project to the billing account. To double check, I attempted to add yet another new project to the billing account (to push the amount to 6) and then received the same error message again.

    Straight up deleting one of the associated projects also works.

    It stands to reason that requesting a limit increase for your billing account's associated projects will also fix this issue.

    0 讨论(0)
提交回复
热议问题