15

Edit: Google Cloud at its finest. Made absolutely no changes but deployed fine this morning.

Error after ~10m of deployment (10+ deploy attempts).

I've changed the app to add a simply function with less than 10 lines of code. It has no affect on libraries and uses native python only and hence I'm not sure how it can affect the deployment.

I've tested the app and it runs fine locally.

Here is the error that I get:

ERROR: (gcloud.app.deploy) Cloud build failed. Check logs at https://console.cloud.google.com/xxxxxxxx/ Failure status: UNKNOWN: Error Response: [4] DEADLINE_EXCEEDED

Previously to that, logs don't show any errors, in fact everything is going as expected.

Newest entries first:

9302e2430a0e: Pushed 
4f56eb74b6bf: Pushed 
21df82f90a72: Layer already exists 
f0e2b3558b28: Layer already exists 
99c71ba2c817: Layer already exists 
2483da9621d1: Layer already exists 
af09d2110abe: Layer already exists 
d968669f4b42: Pushed 
4b1e707066a6: Layer already exists 
55530b72c8c8: Layer already exists 
62c169a7d462: Layer already exists
GRS
  • 2,807
  • 4
  • 34
  • 72
  • Have you tried the first deployment through the cloud shell? Probably some environment variable was first set and then deleted once the cloud shell was closed. – Rubén C. May 15 '18 at 08:01
  • @RubénC. I've only used my Mac using gcloud. It still happens when I deploy, but generally updates the service on the 3rd-4th attempt so I just go along with it although not ideal. – GRS May 15 '18 at 09:25

3 Answers3

17

According to this you can change the build timeout setting with:

gcloud config set app/cloud_build_timeout 1000

Setting it to 1000 seconds in this example.

Artem Kalinchuk
  • 6,502
  • 7
  • 43
  • 57
7

I have this problem too when deploying my custom image to AppEngine flex. My image requires a few ML models and takes around 2 hours to build and GAE does not seem to like it.

To build your container images outside of Google Cloud Platform, you must first upload your images to a container image repository before you can deploy your images to App Engine with the gcloud app deploy command.

In short, push your image to Google Container Registry or container image repository of your choice, then deploy with this command

gcloud app deploy --image-url gcr.io/YOUR_PROJECT_ID/YOUR_CONTAINER_IMAGE

More info here and here

Rex Low
  • 2,069
  • 2
  • 18
  • 47
0

For my case, I've found out the problem was that I have the same version for all gcloud app deploy command. When there's traffic, the deployment will timeout.