If you have an application that you want to deploy to Google Cloud Run, but you’re getting the error “(gcloud.run.deploy) FAILED_PRECONDITION: failed precondition: due to quota restrictions, cannot run builds in this region. Please contact support“, then this blog post is for you.
I have a Node.js application that has been running smoothly for a couple of years now. The application is hosted on Google Cloud Platform using Cloud Run. However, recently, when I was trying to deploy an update to this application by running the below command:
gcloud run deploy ...I started getting this error:
(gcloud.run.deploy) FAILED_PRECONDITION: failed precondition: due to quota restrictions, cannot run builds in this region. Please contact supportLooking at the quotas on Google Cloud Console did not reveal anything to me. I was not exceeding any quotas, and everything related to billing was in order.
The Solution
After digging through the Google Cloud forums, I came across a post that suggested that the issue was caused by a recent update to the gcloud CLI. If you have any version that is greater than 455.0.0, you will get this error. To find out what version of the CLI you have installed, run this command:
gcloud --versionThe number that’s next to “Google Cloud SDK”, is your CLI version.
As of now, the only solution that I could find is to install version 455.0.0 of the CLI (if you have a newer version). This can be done by running this command:
gcloud components update --version 455.0.0After downgrading to version 455.0.0, you should be able to deploy your applications without this error. Unfortunately, this is the only solution that I have for now. I will update this post if I find a more permanent solution, but in the meantime, this should get you through.
Please let me know if this does not work for you, or if you find a different solution that works better. You can do this by leaving a comment here, or by sending me an email through my contact page. Thank you!
Update 25-Jan-2024: I upgraded the CLI to v460.0.0, and I can confirm that this issue is now fixed.
