ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: The following quotas were exceeded: CPUS (quota:
0, used: 0 + needed: 4).
Trying to deploy nodejs application in App Engine flexible environment in a new google cloud project using gcloud.
runtime: nodejs
env: flex
resources:
cpu: 2
memory_gb: 3.5
disk_size_gb: 20
network:
name: default
env_variables:
NODE_ENV: production
For some reason i am unable to successfully deploy in app engine flexible environment.
If you are on the Free Trial, this a known issue or the stock-out issue in that region(asia-south). Here are my recommendations:
Try to add this in app.yaml and deploy:
automatic_scaling:
min_num_instances: 1
max_num_instances: 7
Run or deploy on App Engine Standard.
Change the region of your App Engine. Please note, you cannot change your App Engine region, you will need to create a new project and set the other region except asia-south.
Run or deploy the app on a different product.
Google Cloud is now offer a feature called reservations that guarantees Google Cloud capacity, see this document for details on how to use this feature.
Create a Quota Request for CPU.
Related
My gcloud app deploy fails due to timeout during build. After looking at logs, its taking more than 10 min and the App Engine Standard timeout can't be changed. But the previous all my builds went fine and the only change I noticed between successful and failed build logs are:
failed build is using and fetching the source and images from gae_runtime
Pulling image: asia.gcr.io/gae-runtimes/utilities/buildpack-shim:base_20211020a_18_04_RC00
successful build is fetching the image from
Pulling image: asia.gcr.io/fn-img/utilities/buildpack-shim:base_20211020a_18_04_RC00.
How to make the build to pull these image from fn-img and not gae-runtimes?
It turns out that you can only configure timeouts for App Engine builds if you are using the Flexible environment. You can configure the timeout by using Cloud Build to deploy your App Engine Standard service. As such you could avoid the 10 minutes timeout limit.
In this documentation page there is a step by step guide on how to do it but basically the key step is this one:
In the args field, invoke the gcloud app deploy command and set a timeout for App Engine to use when it invokes Cloud Build. This is required because Cloud Build build steps and builds have a default timeout of 10 minutes and App Engine deployments could take longer than that to complete. Specifying a longer timeout will make sure that the build doesn't timeout if gcloud app deploy takes longer than 10 minutes to complete.
steps:
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: 'bash'
args: ['-c', 'gcloud config set app/cloud_build_timeout 1600 && gcloud app deploy']
timeout: '1600s'
On the other hand, the App Engine standard environment does not allow the build timeout to be configured. If you're using Cloud Build for deploying on the App Engine standard environment, and your build is failing with a timeout error, consider using the App Engine flexible environment or Cloud Run instead of the App Engine standard environment.
All of a sudden having issues with deploying to GCP using gcloud app deploy.
Created a brand new project and tried to upload a sample hello-world app from GCP, but still get the following error:
ERROR: (gcloud.app.deploy) Error Response: [3] Docker image us.gcr.io/gcp-test-8710371/appengine/default.20181106t173450:latest was either not found, or is not in Docker V2 format. Please visit https://cloud.google.com/container-registry/docs/ui
app.yaml:
runtime: nodejs
env: flex
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
SDK: Google Cloud SDK 224.0.0
I've checked the container registry, and nothing is created there.
Also, tried enabling/disabling APIs like in this post, but with no result.
An example Python app uploads fine with no problems.
Appears it was an issue on GCP's side. The error is no longer occuring, so I assume it was resolved.
There was an issue affecting the Flex deployments. The issue was fixed on 07/11 at aproximately 00:40 UTC. As #isharko pointed out, Flex deployments should be working normally now.
There's also a public issue on GCP's issue tracker about this. If new relevant information surfaces, it'll likely be posted there.
All of a sudden having issues with deploying to GCP using gcloud app deploy.
Created a brand new project and tried to upload a sample hello-world app from GCP, but still get the following error:
ERROR: (gcloud.app.deploy) Error Response: [3] Docker image us.gcr.io/gcp-test-8710371/appengine/default.20181106t173450:latest was either not found, or is not in Docker V2 format. Please visit https://cloud.google.com/container-registry/docs/ui
app.yaml:
runtime: nodejs
env: flex
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
SDK: Google Cloud SDK 224.0.0
I've checked the container registry, and nothing is created there.
Also, tried enabling/disabling APIs like in this post, but with no result.
An example Python app uploads fine with no problems.
Appears it was an issue on GCP's side. The error is no longer occuring, so I assume it was resolved.
There was an issue affecting the Flex deployments. The issue was fixed on 07/11 at aproximately 00:40 UTC. As #isharko pointed out, Flex deployments should be working normally now.
There's also a public issue on GCP's issue tracker about this. If new relevant information surfaces, it'll likely be posted there.
I have a GCP project running Cloud SQL and a Django App inside a Google App Engine Flexible Environment and it works fine. However, when I try to connect to the same Cloud SQL instance from another project it doesn't work since the socket is not being created as specified by the cloud_sql_instances in app.yaml:
runtime: custom
env: flex
automatic_scaling:
min_num_instances: 1
beta_settings:
cloud_sql_instances: myproject:myzone:mydbinstance
env_variables:
SQLALCHEMY_DATABASE_URI: >-
postgresql+psycopg2://myuser:mypass#/mydb?host=/cloudsql/myproject:myzone:mydbinstance
Steps to reproduce:
Create a GCP project A
Create a Cloud SQL postgres instance in project A
Deploy an app to app engine flexible environment in project A, following this steps to connect the app to Cloud SQL: https://cloud.google.com/appengine/docs/flexible/python/using-cloud-sql-postgres
SSH into the instance in project A (via web console)
$ ls /cloudsql/ -> should show the socket file
Create a GCP project B
Deploy the same app to app engine flexible environment in project B, following this steps to connect and authorize the app to project A's Cloud SQL: https://cloud.google.com/appengine/docs/flexible/python/using-cloud-sql-postgres
SSH into the instance in project B (via web console)
$ ls /cloudsql/ -> the directory is empty, the socket is not there.
How can I get project B to show the socket?
I solved it by enabling the Cloud SQL Administration API for project B. Before, I only had it enabled for project A.
I just completed a gcloud components update on my local machine and got several new errors when deploying my application. I was able to fix most of these new errors with a few minutes of troubleshooting (I understand that the gcloud preview app command is still 'preview', so I expect some changes here.)
I am now getting an error (bug?) that I can't seem to fix.
ERROR: (gcloud.preview.app.deploy) Error Response: [400]
version.automatic_scaling.min_pending_latency (nanos: 300000000),
must be in the range [0.010000s,15.000000s].
So, correct me if I'm wrong, but I'm pretty sure 300000000 nanos falls in the acceptable range as defined in the error.
These are the relevant sections of my app.yaml
module: api
runtime: php55
api_version: 1
threadsafe: true
instance_class: F2
automatic_scaling:
min_idle_instances: automatic
max_idle_instances: automatic
min_pending_latency: 300ms
max_pending_latency: 1s
I just tried the 300ms config on my app, but updating using the GAE SDK's appcfg.py - no issue, which supports your suspicion of a bug in the gcloud preview CLI. You might want to file an issue with the Google Cloud SDK Issue Tracker.
As a workaround you could either:
check this #klenwell's answer to this Q&A for the new location of
appcfg.py in the Google Cloud SDK:
With Google App Engine, why do I now get "command not found" when running the appcfg.py command on my local machine?
use the GAE SDK's appcfg.py to update your app.