gcloud.functions.deploy Could not create or update Cloud Run service

2.8k Views Asked by At

I'm encountering this issue whenever I try to deploy a new Javascript function or an existing one on Google Cloud Functions using the gcloud-cli.

Here's the command I'm running to deploy my function

gcloud functions deploy [cloud_funtion_name]
--gen2 --region=us-central1
--runtime=nodejs18
--entry-point=[function_entry_point]
--trigger-http
--allow-unauthenticated
--max-instances=83

After about 10 minutes being endlessly stuck on the Cloud run service step, I get this error

Preparing function...done.                                                                                                                                     
X Deploying function...                                                                                                                                        
  ✓ [Build] Logs are available at [logs_link]                                                                                                                                                        
  ✓ [Service]                                                                                                                                                  
  . [ArtifactRegistry]                                                                                                                                         
  . [Healthcheck]                                                                                                                                              
  . [Triggercheck]                                                                                                                                             
Failed.                                                                                                                                                        
ERROR: (gcloud.functions.deploy) OperationError: code=13, 
message=Could not create or update Cloud Run service [cloud_funtion_name].
Reconciling latest revision template. Resource readiness deadline exceeded.

And this happens even if I delete and redeploy. I checked several threads on StackOverFlow and Google Issue Tracker, but none seems to really help...

Anyone got a clue ? If further informations are needed, I'll gladly handle them.

Until Yesterday afternoon, I was able to deploy my functions without any form of issue. But overnight, the same yesterday, my deploys started to fail, even the updates won't work anymore.

I'm actually clueless.

1

There are 1 best solutions below

0
Blaise Albis-Burdige On

I think under the hood GCP may be creating a serveless VPC on the first deploy, in subsequent revision this can get messed up.

I made a new serverless VPC connector using the CLI and can now use it in my functions without having to switch regions a zillion times.

gcloud compute networks vpc-access connectors create [CONNECTOR_NAME] \
  --network [VPC_NETWORK_NAME] \
  --region [REGION] \
  --range [IP_RANGE]