9

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 been unable to create a new project for a couple weeks now.

The error seems to have changed, as it used to include server ip information and a lot of other data. An example with some potentially private information removed:

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=removed;GlobalID=removed;Server=ip:port

Now the error is a lot shorter, although still seems to be related to the same cause:

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

The spinner in the dashboard appears to spin forever, while the error appears underneath alerts after a few seconds. I have tried numerous project names and all fail with the same error.

Is there some type of quota I am missing that is preventing this? The quota menu item requires me to select a project, which I don't have any.

Clicking on the error brings me to a page with the following message:

You don't have permissions to perform the action on the selected resource.

Nabren
  • 582
  • 1
  • 7
  • 17
  • @Nabern even I'm facing similar issue, while creating a new project. Seems some major issue in Google API. – niks Apr 05 '17 at 08:58
  • In my case My gmail account don't have some permission which is blocked by my company when i used new account have all permission than than it work fine for me – Sushant Gosavi Apr 07 '17 at 07:57

6 Answers6

9

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.

Andrew L
  • 106
  • 1
  • Would that setting be the same for Google Play Developer Console? We have definitely shipped Android apps with the same org, so I think it's on. Going to admin.google.com just redirects to https://apps.google.com/user/hub, so I am not sure if that's telling me I don't have permissions to view it or if they redesigned that flow. – Nabren Apr 05 '17 at 15:24
  • No, that is not the same setting. There is one for 'Google Play Developers Console' and one for 'Google Developers Console' – Andrew L Apr 06 '17 at 17:11
  • Thanks @AndrewL, that fixed it for me, apparently my own domain didn't have this one on. – SunSear Apr 19 '17 at 08:24
6

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.

Himal
  • 3,002
  • 1
  • 18
  • 17
2

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

Sushil Adhikari
  • 764
  • 6
  • 12
0

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

0

For me the error was working because I was trying to read the file from a shared google folder. Check if the drive where the file lives is your drive and not a shared one.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 01 '22 at 07:28
0

FAILED_PRECONDITION can also be raised in case of a google cloud service account with too many keys: ERROR: (gcloud.iam.service-accounts.keys.create) FAILED_PRECONDITION: Precondition check failed.

You can delete some unused keys at IAM > Service Accounts (https://console.cloud.google.com/iam-admin/serviceaccounts) > (service account of your interest) > Keys; but probably should adjust your provisioning to not generate a new key on each run as I was performing.

Hector Torres
  • 263
  • 1
  • 5