0
votes

I ignorantly deleted the service account to my GCP project rather than the service account to Google Calendar API and Dialogflow service account.

I'm now having issues trying to deploy my dialogflow agent through the inline code editor to Cloud Functions. When I check the logs, I get this message:

2020-07-30 15:48:40.350 WAT
Dialogflow API
CreateCloudFunction
us-central1
[email protected]
userFacingMessage: 
Default service account '[email protected]' doesn't exist. 
Please recreate this account (for example by disabling and enabling the Cloud Functions API),
or specify a different account.;
com.google.cloud.eventprocessing.manager.api.error.DefaultServiceAccountDoesNotExistException: userFacingMessage:
Default service account '[email protected]' doesn't exist. Please recreate this account (for example by disabling and enabling the Cloud Functions API), or specify a different account.; Code: FAILED_PRECONDITION com.google.apps.framework.request.StatusException: <eye3 title='FAILED_PRECONDITION'/> generic::FAILED_PRECONDITION: userFacingMessage:
Default service account '[email protected]' doesn't exist. 
Please recreate this account (for example by disabling and enabling the Cloud Functions API), or specify a different account.; com.google.cloud.eventprocessing.manager.api.error.DefaultServiceAccountDoesNotExistException: userFacingMessage: 
Default service account '[email protected]' doesn't exist. Please recreate this account (for example by disabling and enabling the Cloud Functions API), or specify a different account.; Code: FAILED_PRECONDITION

Is it possible to retrieve back the service account or am I getting these errors as a result of a different problem?

1
Concretely, you may want to have a look at this doc, explaining how to do it if you deleted it within the last 30 days: cloud.google.com/iam/docs/…LundinCast
Google Cloud Functions uses the App Engine service account under the hood so recovering it will likely solve your issue indeedLundinCast

1 Answers

3
votes

After a service account is deleted, you can recover it between 30 days after its deletion.

To do it, you can run the following command from cloud shell:

gcloud beta iam service-accounts undelete ACCOUNT_ID

The account ID can be taken from stackdriver logging with the following filter

resource.type="service_account" resource.labels.email_id="service-account-name" "DeleteServiceAccount"

Hope this helps to recover your service account.