Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

Error when enabling compute API thru CLI: Billing API not enabled

Hi guys.On the lab of chapter 7.3 – Starting Our First GCE VM: Google Compute Engine Setup, we see that the compute instance isn’t enabled by default on the project created for these labs. So, we can enable it by CLI or Portal.I’m trying enabling it thru the CLI, since in the video teach us how to enable using the portal. The thing is, when I try to enable using the CLI, after using the command gcloud compute instances list, and hit Y, I got this error below:

Would you like to enable and retry (this will take a few minutes)?

(y/N)? y

Enabling service [] on project [109933565986]…

ERROR: (gcloud.compute.instances.list) FAILED_PRECONDITION: Billing must be enabled for activation of service ‘[,,]’ in project ‘109933565986’ to proceed.

  • ‘@type’:


subject: ‘109933565986’

type: serviceusage/billing-enabled

And I have also enabled the billing APIs, but still same error.

gcloud services list –available | grep billing Cloud Billing Budget API Cloud Billing API

gcloud services list –enabled | grep billing Cloud Billing Budget API Cloud Billing API




3 Answers

Yeah, I see that this error was happening because of some limit about the billing account x number of projects.

When I go to billing and Manage Billing Account, I see that my account created (my trial account) I see the # of project is 3, according to the videos.

But, when I click on My Projects, I see only My user project and the Services Exploration Lab projects. The third one is the admin.

The thing is that only My User Project is billed.

The Services Exploration Lab is shown as "billing is disabled.

I can switch them, but I can stay with only one project billed.

The number of projects for the trial account wasn’t 3? Or did I miss something in the labs?

Thank you.

Hi Jonny,

yeah, I found something similar when doing the cli version of the progression lab.  I found the following thread which I hope helps:

Basically, you can have some number of projects in your trial account (10 at the time of recording the videos, Mattias said, but now 21 I think), but of these you can only have 3 linked to your billing account. Some services wont activate unless the project is linked to the billing account, so I’m guessing this is not  a limit for non-trial accounts.

I now just unlink or delete/shutdown older projects. you can unlink them from the billing menu, click on the pull down for you billing account (next to the word overview in the dashboard) choose manage billing accounts and click the project tab. You can then use the hamburger menu against each project row to disable or enable billing.

hope this helps



Thank you, Matt. Yes, I found a lost project consuming one of these 3 for billing account. I removed it from the billing, and it works for the other account, and was able to start the services.

But I still think that maybe there is another way to discover / list all the projects used , and the billing accounts linked, to solve problems like this faster.

Does anyone know how?

Thank you.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?