Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

GCloud function deployment gives 'Invalid source token', sometimes. What does it mean?

I've added a new google cloud function. Updated the branch, and it deployed automagically once.

After that it failed 10 times, and I was done for the day. Each time it fails with the message: 

Code 9: 'Invalid source token'.

But I've got no idea what it means.

Today, I could deploy once. No error message. After that, 2 times already, the 'Invalid source token' error message. 

 

 

1 2 597
2 REPLIES 2

Hi @renko_ntri,

Welcome to Google Cloud Community!

The "Invalid source token" error message in the context of deploying a Google Cloud Function typically indicates that there is an issue with the authentication token used to deploy the function. The token is used to authenticate the identity of the person or system making the deployment request, and if it is invalid, the request will be rejected.

This error message can be caused by a number of factors, including but not limited to:

  • The authentication token has expired or has been revoked
  • The authentication token has been compromised, and someone else is attempting to use it
  • There is an issue with the Google Cloud SDK or gcloud command-line tool that is being used to deploy the function
  • the user have not have the correct IAM role for the service account being used.

You might want to try to create a new service account or authenticate your device again, also try to delete the current function and deploy a new one, check if the gcloud version you are using is the latest, and verify that the user has the correct IAM role for the service account being used.

Thank you.

Hi cristianpaula. The weird thing is, I am able to upload/add a new cloud function, but not update that function. If I remove the function in gcloud, it will re-upload the function, because it's new. 

Also, we haven't updated our cloud functions since mid - november last year, but everything back then went smoothly. 

I'll try to update the authentication token and see if it improves the situation.

Thanks for the answer.