I create a google account, then create a project in the google console. create a node project local and install dependencies and also the google cloud SDK, I create a cloud function to send an email, and Im able to deploy it with this commands:
once deploying ask me a couple of times if I want to enable the function build api, I say Y, and deploys
After that a default Service Account is created under IAM > Services Accounts,
When I try to deploy again, it says this error no matter what I do, I have tried disabling and enabling the service account, adding roles, deleting it and re creating it, creating an App Engine application, this is the error:
ERROR: (gcloud.functions.deploy) ResponseError: status=[400], code=[Ok], message=[Default service account ‘softcro-site@appspot.gserviceaccount.com’ doesn’t exist. Please recreate this account or specify a different account. Please visit https://cloud.google.com/functions/docs/troubleshooting for in-depth troubleshooting documentation.]
Hello @SoftcroDEv ,Welcome on Google Cloud Community.
Did you’ve tried to change service account associated with Cloud Functions? If not, please create Service Account, grant IAM roles ( based on your needs, most probably Cloud Functions Service Agent) and edit Cloud Function to choose not default service account. Then, deploy new service revision of your Function.
Although seems that your solution might be what I’m looking for, but Im just not sure how you get to that page. I appologize for my ignorance lol.
This is what I see in my functions page, and I don’t see those options under this navigation tabs or a way of edit and change what service account runs with the function
Yes, I encountered the same problem for newly created projects. The first build goes as expected, but then it constantly tells me:
“message=[Default service account ‘@appspot.gserviceaccount.com’ doesn’t exist. Please recreate this account or specify a different account. Please visit https://cloud.google.com/functions/docs/troubleshooting for in-depth troubleshooting documentation.]”.
I found a fix. You should delete your failed cloud function, then when you redeploy everything goes as expected. I still find this error weird, maybe someone can explain why this is happening?
That’s to say, we can not update function after deployed. If we want to update deployed function, must first delete the deployed function , then redeploy the updated function ?
This phenomenon is somewhat strange. Everything is normal in the old project, but when updating functions in the new project, errors will occur.
I’m not sure if it’s related to project settings or payment issues.
hope google cloud function team help us. thx a lot.
Same problem here. In a new project, if I try to update a cloud function via the gcloud command line, it fails with the same error as reported above. Updating from the GUI does not seem to be a definitive solution. Hopefully Google will come up with a solution.
I’m commenting here the solution that worked for me to deploy several times by command line. Apparently, the new projects in Google differentiate in terms of permissions two service accounts (gen1): one SA for execution of the function in runtime and another SA to be able to build the function. The SA that has the necessary permissions to be able to build is this one:
@spdev you saved me hours when even the LLMs could not. For anyone else whose deploy command has recently started failing, you can list all the accounts with gcloud iam service-accounts list --format=“table(email)”
find the [numbers]-compute email and append that to the deploy command with --service-account