19

I am running into this error while deploying my django(2.1) app with python(3.5) to appengine. Before, I was using python 2 and python27 in app.yaml, there was no such error, but now when I have python 3.5.2 and python37 in my app.yaml, I am running into this error after "gcloud app deploy". Do I really have to enable billing or am I doing something wrong? Is there a way out? The full error is

ERROR: (gcloud.app.deploy) Error Response: [7] Access Not Configured. Cloud Build has not been used in project chaipani-217815 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudbuild.googleapis.com/overview?project=chaipani-217815 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.

Dustin Ingram
  • 20,502
  • 7
  • 59
  • 82
Salman Haseeb Sheikh
  • 1,122
  • 2
  • 12
  • 20

5 Answers5

15

You must enable billing first, then you can enable the Cloud Build service for your project.

Dustin Ingram
  • 20,502
  • 7
  • 59
  • 82
  • 1
    But why don't we get any such error while using python runtime27? – Salman Haseeb Sheikh Sep 29 '18 at 17:14
  • 2
    Because it doesn't use the Cloud Build service. – Dustin Ingram Sep 30 '18 at 12:10
  • my cloud build API was already enabled, I read somewhere to turn it off wait for few minutes, and turn back on, when I did this it finally shown me billing error, huh google could have shown the same in the first place but no this is google way of telling you about billing haha – Inzamam Malik Sep 10 '21 at 11:12
6

We ran in to an issue where an incomplete deploy (that hung and had to be aborted) had errors setting some internal service account permissions and kept getting the "Cloud Build has not been used in project before or it is disabled" error despite the Cloud Build API being enabled and a billing account set up.

We solved the issue by disabling the Cloud Build API, waiting a couple hours (to ensure the service accounts were deleted), and then re-enabling.

Kelly
  • 1,096
  • 12
  • 22
5

You go that link then click "Enable" button. A popup showed, then click to Set account. (see the picture)

Enable cloud build

Bai Nguyen
  • 814
  • 7
  • 16
5

I solved this problem using the following commands at the root directory of my project:

gcloud init
gcloud components update

After I updated the project settings with my GCP account the problem was solved.

ℛɑƒæĿᴿᴹᴿ
  • 4,983
  • 4
  • 38
  • 58
  • tried updating didn't help, billing is also enabled, deployed last week with the same command without a problem and been deploying every week but this week it sucks for no reason. – Inzamam Malik Sep 10 '21 at 07:29
  • 1
    it was billing issue in my case, when I disabled build API and tried to enable it back again it showed me the error for billing issue: "Please review your Billing Account There is an issue with your billing account with ID 'XXXXXX-XXXXXX-XXXXXX'. Please correct these issues and try again." – Inzamam Malik Sep 10 '21 at 11:09
  • 1
    This actually did it for me. Thank you so much! – Ax M Jun 09 '22 at 12:00
2

Had this issue before. It can simply be a billing issue.

Solution:

  1. Disable the Cloud Build API
  2. Attempting to re-enable will possibly result in a billing issue that needs resolving.

TLDR; Turn off and on again.

t-nail
  • 145
  • 1
  • 9