firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

"It looks like you haven't used Cloud Firestore in this project before" error for billing issue

Open sathishvj opened this issue 3 years ago • 9 comments

[REQUIRED] Environment info

firebase 12.5.2 macOs

[REQUIRED] Steps to reproduce

Create a new project with firestore. Do not link it to a billing account. Run firebase init. Choose firestore in the options and try to continue. It will throw an error: "It looks like you haven't used Cloud Firestore in this project before." Run firebase init --debug for more details.

[REQUIRED] Expected behavior

Should show a better error that is more descriptive of the real problem i.e. billing account is not linked to project.

[REQUIRED] Actual behavior

--debug output <<< [apiv2][body] GET https://appengine.googleapis.com/v1/apps/project-name {"error":{"code":403,"message":"Read access to project 'project-name' was denied: please check billing account associated and retry","status":"PERMISSION_DENIED"}}

Error: It looks like you haven't used Cloud Firestore in this project before. Go to https://console.firebase.google.com/project/project-name/firestore to create your Cloud Firestore database.

sathishvj avatar Aug 25 '23 14:08 sathishvj

This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Aug 25 '23 14:08 google-oss-bot

Hi @sathishvj, thanks for providing the details about the issue. From what I understand, you’re encountering an error when trying to configure the current directory as a Firebase project. I am currently unable to reproduce the behavior you mentioned. Here are the steps I took:

  1. Create a new project via the Firebase Console
  2. Create a Cloud Firestore database via https://console.firebase.google.com/project/<project_id>/firestore
  3. Run firebase init firestore --project <project_id>

In case I’m missing a step just let me know. Also, just to verify, are you still encountering the issue after creating your Cloud Firestore database via https://console.firebase.google.com/project/<project_id>/firestore?

aalej avatar Aug 25 '23 15:08 aalej

After Step 1. can you check if the new project you created has a linked billing account? For whatever reason, mine did not automatically have it. To reproduce the issue, after Step 1. can you unlink the project from a billing account and try again?

sathishvj avatar Aug 25 '23 16:08 sathishvj

I checked my newly created project, and it’s still in Spark plan and not linked to any billing account. Also, Cloud Firestore includes a no-cost tier, so you should be able to set it up even without a linked billing account.

I’m thinking there might be a configuration issue with the project you’re using. Could you double check if you are able to reproduce the issue in a new project?

aalej avatar Aug 25 '23 16:08 aalej

This was the exact same error: Read access to project 'project-name' was denied: please check billing account associated and retry. As soon as I added billing account for the project, it worked. So clearly that was the actual issue too.

Maybe it's only an issue with my GCP account. shrug

sathishvj avatar Aug 25 '23 17:08 sathishvj

Hi @sathishvj, I’ve tried a couple of times to repro this using different accounts and different projects, but so far I’m having no luck trying to replicate the issue.

By any chance, could you share your firebase-debug.log file? I would like to check if there is any other information in your logs that could provide a hint on what is causing the issue. Please remove any PII (personal identifiable information) before sharing the file.

aalej avatar Aug 28 '23 13:08 aalej

I don't have that any more. Maybe you can close this for now. I'll reopen it again when I encounter it.

Also, if anybody faces the same issue, they can at least find this page to debug the problem.

Thanks.

sathishvj avatar Aug 28 '23 14:08 sathishvj

I'm facing the same issue.

I tried this, but no use

devravinder avatar Aug 29 '24 09:08 devravinder

This still seems to be an issue. Once I had accounts that were billing, then adding new accounts don't seem to be setup correctly and even upgrading them to the pay as you go plan they are still giving the same error.

Found the way to get by it was just to setup the the init without the firestore and just the hosting initially and then build from there.

wesjones avatar Oct 26 '24 03:10 wesjones