I tried to deploy with gcloud config set app/cloud_build_timeout 1600 && gcloud app deploy but I got a timeout error after 10 minutes.
ERROR: (gcloud.app.deploy) Error Response: [4] Cloud build did not succeed within 10m.
Error type: OK
Full build logs: https://console.cloud.google.com/cloud-build/builds/xxxxxxxxxxxxxxx?project=xxxxxxxxx
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/gcloud" failed: step exited with non-zero status: 1
I tested from local CLI, Google Cloud SDK 325.0.0, and Cloud Build as written in the official document.
https://cloud.google.com/cloud-build/docs/deploying-builds/deploy-appengine#configuring_the_deployment
$ gcloud config list
[app]
cloud_build_timeout = 1600
[builds]
timeout = 1600
[compute]
region = us-central1
zone = us-central1-f
[core]
account = xxx
disable_usage_reporting = False
project = xxx
I'm looking for a solution.
I have got an answer there's no way to change cloud_build_timeout setting in GAE/SE deployment officially(from GCP support). This setting is available for GAE/FE only.
Related
I started working on an app and suddenly it fails to deploy to appengine, with the following error message:
siim#pebble:~/projects/xyz$ gcloud app deploy
Services to deploy:
descriptor: [/home/siim/projects/xyz/app.yaml]
source: [/home/siim/projects/xyz]
target project: [xyz]
target service: [default]
target version: [20220313t182940]
target url: [https://xyz.uc.r.appspot.com]
target service account: [App Engine default service account]
Do you want to continue (Y/n)? y
Beginning deployment of service [default]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 2 files to Google Cloud Storage ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 016c4604-6ea6-47df-8144-e7f1471c6df6 status: FAILURE
removing /layers/google.go.gomod/gopath: unlinkat /layers/google.go.gomod/gopath/pkg/mod/github.com/golang/protobuf#v1.3.1/regenerate.sh: permission denied
Full build logs: https://console.cloud.google.com/cloud-build/builds;region=us-central1/016c4604-6ea6-47df-8144-e7f1471c6df6?project=576574664421
Clicking through to the build log, I see:
===> DETECTING
google.go.appengine_gomod 0.9.0
google.go.gomod 0.9.0
google.go.build 0.9.0
google.go.appengine 0.9.0
google.utils.label 0.0.2
===> ANALYZING
Previous image with name "us.gcr.io/xyz/app-engine-tmp/app/default/ttl-18h:69af35b6-6fc6-4167-88f3-da16f9cfc7e7" not found
Restoring metadata for "google.go.gomod:gopath" from cache
===> RESTORING
Restoring data for "google.go.gomod:gopath" from cache
===> BUILDING
=== App Engine Gomod (google.go.appengine_gomod#0.9.0) ===
--------------------------------------------------------------------------------
Running "cp --dereference -R . /layers/google.go.appengine_gomod/srv"
Done "cp --dereference -R . /layers/google.go.appengine_gomod/srv" (53.220262ms)
=== Go - Gomod (google.go.gomod#0.9.0) ===
DEBUG: go.mod SHA has changed: clearing GOPATH layer's cache
Failure: (ID: f51775d1) removing /layers/google.go.gomod/gopath: unlinkat /layers/google.go.gomod/gopath/pkg/mod/github.com/golang/protobuf#v1.3.1/regenerate.sh: permission denied
--------------------------------------------------------------------------------
Running "mv -f /builder/outputs/output-5577006791947779410 /builder/outputs/output"
Done "mv -f /builder/outputs/output-5577006791947779410 /builder/o..." (5.980458ms)
ERROR: failed to build: exit status 1
I'm completely mystified by this. AFAICT this is something AppEngine does internally so I don't think I have any way to debug this further? FWIW, my app is super simple ATM:
module xyz
go 1.17
require (
github.com/go-chi/chi/v5 v5.0.7
go.etcd.io/bbolt v1.3.6
google.golang.org/appengine/v2 v2.0.1
)
require (
github.com/golang/protobuf v1.3.1 // indirect
golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d // indirect
)
And:
runtime: go116
main: ./cmd/server
The solution was to go to container registry (maybe artifact registry soon) in the cloud console and delete all the containers there. The issue was quite likely just one of those images (maybe the build cache one) but my app is not released so I could just delete all of them.
I resolve it using --no-cache option, but its not perfect because cache is not enabled.
$ gcloud app deploy app.yaml --no-cache
I am attempting to setup a CI Pipeline using Google Cloud Build.
I am attempting to deploy a MeteorJS app which has a lengthy build time - the default build timeout for GCB is 10 minutes and it was recommended here that I increase the timeout.
I have setup my cloudbuild.yaml file with the timeout option increased to 20 minutes:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy']
timeout: 1200s
I have a Trigger setup in GCB connected to a Bitbucket Repo and when I push a change and the Trigger fires, I get 2 new builds - one coming from Bitbucket and one whose source is Google Cloud Storage.
Once 10 minutes of build time has elapsed, the build from Cloud Storage will timeout which will cause the Bitbucket build to fail as well with Error Response: [4] DEADLINE_EXCEEDED
Occasionally, for whatever reason, the Cloud Storage build will finish in under 10 minutes which will allow the Bitbucket build to finish successfully and deploy.
If I attempt to cancel/stop the Cloud Storage build, it will also stop the Bitbucket build.
The screenshot below shows 2 attempts of the exact same build with differing results.
I do not understand where this second Cloud Storage Build is coming from, but it does not seem to be affected by the settings in my yaml file or my global GCP settings.
I have attempted to run the following commands from the gcloud CLI:
gcloud config set app/cloud_build_timeout 1200
gcloud config set builds/timeout 1200
gcloud config set container/build-timeout 1200
I have also attempted to use a high CPU build machine to speed up the process but it did not seem to have any effect.
Any insight would be greatly appreciated - I feel that I have exhausted every possible combination of Google Search keywords I can think up!
This timeout error comes from app engine deployment itself which has 10 min timeout by default.
You will need to update app/cloud_build_timeout property inside container itself like this:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args: ['-c', 'gcloud config set app/cloud_build_timeout 1200 && gcloud app deploy']
timeout: 1200s
Update
Actually simpler solution:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy']
timeout: 1200s
timeout: 1200s
At $DAYJOB we are using a Go 1.9-based AppEngine application. Now that Google is deprecating version 1.9, I am trying to move to 1.11, using the migration guide. It says that I should set runtime: go111 and remove the api_version: go1.9 value from app.yaml, but when doing so, I get an error message deploying:
ERROR: (gcloud.app.deploy) Staging command [/usr/lib/google-cloud-sdk/platform/google_appengine/go-app-stager /home/peter/src/licensemanager/src/web/app.yaml /home/peter/src/licensemanager/src/web /home/peter/tmp/tmpBB3Yk8/tmpQQPTFj] failed with return code [1].
------------------------------------ STDOUT ------------------------------------
------------------------------------ STDERR ------------------------------------
2019/08/21 07:59:20 invalid api_version value
--------------------------------------------------------------------------------
If I try to add it back, no matter what value I put in it, I get an error message:
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 12 files to Google Cloud Storage ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: The following fields are not allowed in app.yaml: api_version.
I am a bit at a loss here, what am I doing wrong?
Running locally with dev_appserver.py works fine.
I had mismatching SDK packages installed:
ii google-cloud-sdk 259.0.0-0 all Utilities for the Google Cloud Platform
ii google-cloud-sdk-app-engine-go 194.0.0-0 amd64 Go runtime for Google App Engine
Upgrading the mismatching packages fixed the issue. Thanks to #icza for the tip!
I'm trying to deploy an application written in go to GAE. When I call gcloud app deploy it says this:
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 64850a38-3b7b-4223-97bc-27643b8ab1d5 status: FAILURE.
Build error details: go build: cannot use -o with multiple packages
.
Check the build log for errors: https://console.cloud.google.com/gcr/builds/64850a38-3b7b-4223-97bc-27643b8ab1d5?project=609165667740
I have looked everywhere but I can't find information related to this error in this context.
My app.yaml
runtime: custom
vm: true
api_version: 1
health_check:
enable_health_check: False
Dockerfile
# Use the official go docker image built on debian.
FROM golang:1.5.1
# Grab the source code and add it to the workspace.
ADD . /go/
# Install revel and the revel CLI.
RUN go get github.com/revel/revel
RUN go get github.com/revel/cmd/revel
# Use the revel CLI to start up our application.
ENTRYPOINT revel run 4quorum-appengine dev 8080
# Open up the port where the app is running.
EXPOSE 8080
I was working through this article
http://jbeckwith.com/2015/05/08/docker-revel-appengine/
Preview
I am trying to preview it:
gcloud preview app run app.yaml --custom-entrypoint "revel run 4quorum-appengine dev 8080"
WARNING: The `app run` command is deprecated and will soon be removed.
Please use dev_appserver.py (in the same directory as the `gcloud` command) instead.
Module [default] found in file [/Users/802619/Projects/src/4quorum_root/app.yaml]
INFO: Looking for the Dockerfile in /Users/802619/Projects/src/4quorum_root
INFO: Using Dockerfile found in /Users/802619/Projects/src/4quorum_root
INFO 2015-11-06 18:03:44,226 application_configuration.py:399] No version specified. Generated version id: 20151106t180344
INFO 2015-11-06 18:03:44,226 devappserver2.py:763] Skipping SDK update check.
INFO 2015-11-06 18:03:44,266 api_server.py:205] Starting API server at: http://localhost:62780
INFO 2015-11-06 18:03:44,272 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO 2015-11-06 18:03:44,277 admin_server.py:116] Starting admin server at: http://localhost:8000
ERROR 2015-11-06 18:03:44,282 instance.py:280] [Errno 2] No such file or directory
The same thing if trying dev_appserver.py
Deploy
Deploy also doesn't work. Fails because of timeout.
gcloud preview app deploy ./app.yaml
WARNING: Soon, deployments will set the deployed version to receive all traffic by
default.
To keep the current behavior (where new deployments do not receive any traffic),
use the `--no-promote` flag or run the following command:
$ gcloud config set app/promote_by_default false
To adopt the new behavior early, use the `--promote` flag or run the following
command:
$ gcloud config set app/promote_by_default true
Either passing one of the new flags or setting one of these properties will
silence this message.
You are about to deploy the following modules:
- vaulted-gift-112113/default (from [/Users/802619/Projects/src/4quorum_root/app.yaml])
Deployed URL: [https://20151106t204027-dot-vaulted-gift- 112113.appspot.com]
(add --promote if you also want to make this module available from
[https://vaulted-gift-112113.appspot.com])
Beginning deployment...
Verifying that Managed VMs are enabled and ready.
Provisioning remote build service.
Copying certificates for secure access. You may be prompted to create an SSH keypair.
Building and pushing image for module [default]
Saving [.dockerignore] to [/Users/802619/Projects/src/4quorum_root].
----------------------------- DOCKER BUILD OUTPUT ------------------------------
Step 0 : FROM golang:1.5.1
---> f6271e8f3723
Step 1 : ADD . /go/
---> 94fafc5e8a30
Removing intermediate container cfbe197f6e93
Step 2 : RUN go get github.com/revel/revel
---> Running in d7ad8c923144
---> b65877cf3049
Removing intermediate container d7ad8c923144
Step 3 : RUN go get github.com/revel/cmd/revel
---> Running in 2a9b3320ce47
---> 428defd008f3
Removing intermediate container 2a9b3320ce47
Step 4 : ENTRYPOINT revel run 4quorum-appengine dev 8080
---> Running in 8b9e38ec69ec
---> 3749ee8a6636
Removing intermediate container 8b9e38ec69ec
Step 5 : EXPOSE 8080
---> Running in a0e6c66b56c8
---> dafff62b9643
Removing intermediate container a0e6c66b56c8
Successfully built dafff62b9643
--------------------------------------------------------------------------------
Copying files to Google Cloud Storage...
Synchronizing files to [gs://staging.vaulted-gift-112113.appspot.com/].
Updating module [default]...|Deleted [https://www.googleapis.com/compute/v1/projects/vaulted-gift- 112113/zones/us-central1-f/instances/gae-builder-vm-20151106t204027].
Updating module [default]...failed.
ERROR: (gcloud.preview.app.deploy) Error Response: [4] Timed out creating VMs.
About to drop this.
Moved to heroku. Google App Engine is not ready yet.