Skip to main content

I have been trying to deploy and run a simple Firebase Cloud Function. Every attempt fails due to what appears to be a fundamental issue with service account creation and authentication context in my project.

Symptoms:

  1. When calling the function, the context.auth object is always null or undefined, even when the client sends a valid, verified ID token. The function logs show The function must be called while authenticated.
  2. During deployment, I am now receiving the error: Error: Error generating the service identity for pubsub.googleapis.com.

We have already verified the following:

  • The project is linked to an active billing account.
  • All necessary APIs are enabled (Cloud Functions, Cloud Build, Run, Artifact Registry, IAM, etc.).
  • We have tried manually adding IAM service accounts and toggling the Cloud Functions API off and on.
  • We have removed all restrictions from the browser API key.

The project seems unable to correctly manage its own service identities and pass authentication context to its services.

Be the first to reply!