firebase / firebase-functions

Firebase SDK for Cloud Functions
https://firebase.google.com/docs/functions/
MIT License
1.03k stars 203 forks source link

CORS issue after failed to deploy a v2 function #1628

Open risalfajar opened 1 week ago

risalfajar commented 1 week ago

Related issues

1128

[REQUIRED] Version info

node: 20.13.1

firebase-functions: 6.0.1

firebase-tools: 13.22.0

firebase-admin: 12.5.0

[REQUIRED] Test case

This happens randomly, can't provide a test case.

[REQUIRED] Steps to reproduce

  1. Create a new v2 function
  2. Deploy it
  3. Sometimes it'll throw the error, then it needs to be deleted and deployed again to make it work

[REQUIRED] Expected behavior

It always works 100%

[REQUIRED] Actual behavior

It's not always works

Were you able to successfully deploy your functions?

Unable to set the invoker for the IAM policy on the following functions:
        createChamferWeigh(asia-southeast2)

Some common causes of this:

- You may not have the roles/functions.admin IAM role. Note that roles/functions.developer does not allow you to change IAM policies.

- An organization policy that restricts Network Access on your project.
google-oss-bot commented 1 week ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

Rohit1024 commented 3 days ago

This might be related to the Domain Restricting Policy enforced within your organization.

The same issue was also raised in this GitHub issue suggesting the same solution.

https://cloud.google.com/blog/topics/developers-practitioners/how-create-public-cloud-run-services-when-domain-restricted-sharing-enforced

risalfajar commented 3 days ago

I'm not in any organization. It's a personal account.