Search code examples
google-cloud-functionsfirebase-hostingservice-accountsgoogle-iam

GCP: Service account projects/-/serviceAccounts/[email protected] was not found


I'm trying to deploy a webpage based on Next.js with Firebase hosting via the Firebase CLI.
The API route is not available for static pages created using the next export method, so I'm trying to deploy Next.js using FIrebase's webframeworks function.
However, when I create the function in Cloud Functions, if I check the logs, I get the following message:

status: {
  code: 5
  message: "Service account projects/-/serviceAccounts/ACCOUNT_NUMBER-. 
  [email protected] was not found."
}

The service account for developer.gserviceaccount.com was removed more than 30 days ago and cannot be undeleted.
Can I create a new developer.gserviceaccount.com service account?

Thanks!


Solution

  • You are unable to create the function in cloud function because your service account for developer.gserviceaccount.com was removed more than 30 days ago and cannot be found.

    You need to assign the service account to cloud function by following steps :

    • Create a service account or select an existing service account to set as the new Compute Engine default service account.

    • Once your service account is created then attach this service account to your cloud functions by following this official doc and refer to this SO by Spencer Easton.

    • Even after doing the above two steps if it's not working then create the VM by following the link Provided by @John Hanely.

    • Go into https://console.cloud.google.com/apis/dashboard and disable and re-enable the compute engine API. This will take a few moments, but after the GCE API is re-enabled you should be able to create VMs through the Cloud Shell again and be able to reproduce this.