Google Cloud Function trigger doesn’t have the correct permissions but Grant All throws an error Invalid service account (undefined)

I have deployed a Google Cloud function and am trying to set up a Cloud Firestore trigger for it.

The problem I’m facing is that when I select Cloud Firestore from the list of triggers, I get a warning saying:

Service account(s) might not have enough permissions to deploy the function with selected trigger. To mitigate potential errors, you can grant them the following roles:
roles/eventarc.eventReceiver to

I then click Grant All but instead of adding the required permissions to the Service Account, it throws an error.

enter image description here

Invalid service account (undefined).

enter image description here

I can go through the rest of the process but when I try to deploy it again with the new settings, nothing happens. It just gives me a toast saying it’s updating the function but then times out.

I have tried adding all of the required permissions to all of the Service Accounts and they don’t make any difference.

Read more here: Source link