whelmed / la-ace-find-seller Goto Github PK
View Code? Open in Web Editor NEWA demo application for the Linux Academy Google Cloud Certified Associate Cloud Engineer exam prep course
A demo application for the Linux Academy Google Cloud Certified Associate Cloud Engineer exam prep course
After troubleshooting a couple of issue throughout the lab, I landed on a complete blocker on the last step of the lab.
Essentially I got every script to run perfectly up to the "la-ace-find-seller/frontend/cloud/deploy.sh"
I've localized the problem to be with the gcloud app deploy command. Really not sure what is causing the error here. The only change made in the app.yaml file was the APP_TOPIC variable which was set to match my "project_settings" PUB_SUB_TOPIC" value
EE00683-MacBook-Pro:cloud cosmin$ gcloud pubsub topics list
name: projects/playground-s-11-f9c98e/topics/playground-s-11-f9c98e-items
Any help would be very appreciated!
EE00683-MacBook-Pro:cloud cosmin$ gcloud app deploy ../app/app.yaml -q --verbosity=debug
DEBUG: Running [gcloud.app.deploy] with arguments: [--quiet: "True", --verbosity: "debug", DEPLOYABLES:1: "[u'../app/app.yaml']"]
DEBUG: Loading runtimes experiment config from [gs://runtime-builders/experiments.yaml]
INFO: Reading [<googlecloudsdk.api_lib.storage.storage_util.ObjectReference object at 0x10fecd6d0>]
DEBUG:
Traceback (most recent call last):
File "/Users/cosmin/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/runtime_builders.py", line 269, in _Read
with contextlib.closing(storage_client.ReadObject(object_)) as f:
File "/Users/cosmin/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/storage/storage_api.py", line 302, in ReadObject
object_=object_ref, err=http_exc.HttpException(err)))
BadFileException: Could not read [<googlecloudsdk.api_lib.storage.storage_util.ObjectReference object at 0x10fecd6d0>]. Please retry: HTTPError 404: No such object: runtime-builders/experiments.yaml
DEBUG: Experiment config file could not be read. Unable to read the runtimes experiment config: [gs://runtime-builders/experiments.yaml], error: Could not read [<googlecloudsdk.api_lib.storage.storage_util.ObjectReference object at 0x10fecd6d0>]. Please retry: HTTPError 404: No such object: runtime-builders/experiments.yaml
Traceback (most recent call last):
File "/Users/cosmin/Downloads/google-cloud-sdk/lib/surface/app/deploy.py", line 126, in _ServerSideExperimentEnabled
runtimes_builder_root)
File "/Users/cosmin/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/runtime_builders.py", line 524, in LoadFromURI
.format(uri, e))
ExperimentsError: Unable to read the runtimes experiment config: [gs://runtime-builders/experiments.yaml], error: Could not read [<googlecloudsdk.api_lib.storage.storage_util.ObjectReference object at 0x10fecd6d0>]. Please retry: HTTPError 404: No such object: runtime-builders/experiments.yaml
INFO: Executing staging command: [/Users/cosmin/Downloads/google-cloud-sdk/platform/google_appengine/go-app-stager /Users/cosmin/Google Drive/Google Cloud Cosmin/Projects/la-ace-find-seller/frontend/app/app.yaml /Users/cosmin/Google Drive/Google Cloud Cosmin/Projects/la-ace-find-seller/frontend/app /var/folders/37/4mc0jxgd33ld3025_5ncfl280000gp/T/tmp82uggX/tmpn0JtSm]
DEBUG: Executing command: [u'/Users/cosmin/Downloads/google-cloud-sdk/platform/google_appengine/go-app-stager', u'/Users/cosmin/Google Drive/Google Cloud Cosmin/Projects/la-ace-find-seller/frontend/app/app.yaml', u'/Users/cosmin/Google Drive/Google Cloud Cosmin/Projects/la-ace-find-seller/frontend/app', '/var/folders/37/4mc0jxgd33ld3025_5ncfl280000gp/T/tmp82uggX/tmpn0JtSm']
INFO: ------------------------------------ STDOUT ------------------------------------
------------------------------------ STDERR ------------------------------------
2020/01/17 18:15:53 invalid runtime value go
--------------------------------------------------------------------------------
DEBUG: (gcloud.app.deploy) Staging command [/Users/cosmin/Downloads/google-cloud-sdk/platform/google_appengine/go-app-stager /Users/cosmin/Google Drive/Google Cloud Cosmin/Projects/la-ace-find-seller/frontend/app/app.yaml /Users/cosmin/Google Drive/Google Cloud Cosmin/Projects/la-ace-find-seller/frontend/app /var/folders/37/4mc0jxgd33ld3025_5ncfl280000gp/T/tmp82uggX/tmpn0JtSm] failed with return code [1].
------------------------------------ STDOUT ------------------------------------
------------------------------------ STDERR ------------------------------------
2020/01/17 18:15:53 invalid runtime value go
--------------------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/cosmin/Downloads/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 981, in Execute
resources = calliope_command.Run(cli=self, args=args)
File "/Users/cosmin/Downloads/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 807, in Run
resources = command_instance.Run(args)
File "/Users/cosmin/Downloads/google-cloud-sdk/lib/surface/app/deploy.py", line 110, in Run
default_strategy=flex_image_build_option_default))
File "/Users/cosmin/Downloads/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 574, in RunDeploy
args.deployables, stager, deployables.GetPathMatchers())
File "/Users/cosmin/Downloads/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deployables.py", line 366, in GetDeployables
service = Service.FromPath(path, stager, path_matchers)
File "/Users/cosmin/Downloads/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deployables.py", line 102, in FromPath
service = matcher(path, stager)
File "/Users/cosmin/Downloads/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deployables.py", line 140, in ServiceYamlMatcher
service_info.env)
File "/Users/cosmin/Downloads/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/staging.py", line 441, in Stage
return command.Run(self.staging_area, descriptor, app_dir)
File "/Users/cosmin/Downloads/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/staging.py", line 190, in Run
raise StagingCommandFailedError(args, return_code, message)
StagingCommandFailedError: Staging command [/Users/cosmin/Downloads/google-cloud-sdk/platform/google_appengine/go-app-stager /Users/cosmin/Google Drive/Google Cloud Cosmin/Projects/la-ace-find-seller/frontend/app/app.yaml /Users/cosmin/Google Drive/Google Cloud Cosmin/Projects/la-ace-find-seller/frontend/app /var/folders/37/4mc0jxgd33ld3025_5ncfl280000gp/T/tmp82uggX/tmpn0JtSm] failed with return code [1].
------------------------------------ STDOUT ------------------------------------
------------------------------------ STDERR ------------------------------------
2020/01/17 18:15:53 invalid runtime value go
--------------------------------------------------------------------------------
ERROR: (gcloud.app.deploy) Staging command [/Users/cosmin/Downloads/google-cloud-sdk/platform/google_appengine/go-app-stager /Users/cosmin/Google Drive/Google Cloud Cosmin/Projects/la-ace-find-seller/frontend/app/app.yaml /Users/cosmin/Google Drive/Google Cloud Cosmin/Projects/la-ace-find-seller/frontend/app /var/folders/37/4mc0jxgd33ld3025_5ncfl280000gp/T/tmp82uggX/tmpn0JtSm] failed with return code [1].
------------------------------------ STDOUT ------------------------------------
------------------------------------ STDERR ------------------------------------
2020/01/17 18:15:53 invalid runtime value go
--------------------------------------------------------------------------------
EE00683-MacBook-Pro:cloud cosmin$ ```
Getting this issue when running the deploy script:
$ bash deploy.sh
Sending build context to Docker daemon 36.86kB
Step 1/11 : FROM golang:1.9
---> ef89ef5c42a9
Step 2/11 : WORKDIR /go/src/github.com/linuxacademy/products
---> Using cache
---> 507240d36252
Step 3/11 : COPY ./app .
---> Using cache
---> d6e72da019f6
Step 4/11 : RUN go get .
---> Running in c3233a387fab
cloud.google.com/go/storage
/go/src/cloud.google.com/go/storage/bucket.go:1171:12: it.items undefined (type *BucketIterator has no field or method items)
/go/src/cloud.google.com/go/storage/bucket.go:1172:4: it.items undefined (type *BucketIterator has no field or method items)
The command '/bin/sh -c go get .' returned a non-zero code: 2
Am currently trying to work out and fix the issue.
taking your linux academy class, good stuff. might've missed where you said must use us-central, but I wound up using east and had to modify this file as follows to unblock myself
--region=us-east1 \
There appears to be an issue where the permissions inherited over the container bucket do not work properly.
The impact is that when you run "deploy.sh" as part of deploying the Products service onto Kubernetes, the pods do not come up and the service fails to start.
I found a SO thread with same issue:
https://stackoverflow.com/questions/53001219/gke-imagepullbackoff-on-gcr-io#
Manually adding a permission for the service account as "Storage Object Viewer" fixed the issue.
MacBook:cloud stephane$ bash deploy.sh
Unable to find image 'golang:1.11' locally
1.11: Pulling from library/golang
4ae16bd47783: Pull complete
bbab4ec87ac4: Pull complete
2ea1f7804402: Pull complete
96465440c208: Pull complete
16a3d8aca6cd: Pull complete
3a62db25bdbe: Pull complete
8c47c6b16c60: Pull complete
Digest: sha256:e972c78795b22d5cfab02ac410aa2305fcc036319a7af51065d1af583cd3ec04
Status: Downloaded newer image for golang:1.11
Services to deploy:
descriptor: [/Users/stephane/Downloads/Lab-GCP/la-ace-find-seller-master/frontend/app/app.yaml]
source: [/Users/stephane/Downloads/Lab-GCP/la-ace-find-seller-master/frontend/app]
target project: [find-seller-app-dev-stephane]
target service: [default]
target version: [20191210t124827]
target url: [https://find-seller-app-dev-stephane.appspot.com]
Beginning deployment of service [default]...
Created .gcloudignore file. See gcloud topic gcloudignore
for details.
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 1186 files to Google Cloud Storage ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: script field for handler '/.*' must be set to 'auto' for runtime go111.
MacBook:cloud stephane$ bash deploy.sh
Services to deploy:
descriptor: [/Users/stephane/Downloads/Lab-GCP/la-ace-find-seller-master/frontend/app/app.yaml]
source: [/Users/stephane/Downloads/Lab-GCP/la-ace-find-seller-master/frontend/app]
target project: [find-seller-app-dev-stephane]
target service: [default]
target version: [20191210t125437]
target url: [https://find-seller-app-dev-stephane.appspot.com]
Beginning deployment of service [default]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 1 file to Google Cloud Storage ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build da0fd6ba-8484-4d1e-8ee0-9349be29c7bd status: FAILURE.
Error ID: A3D934AC.
Error type: BuildError.
Error message: 2019/12/10 03:56:16 Copying /workspace/_gopath/src/cloud.google.com to /tmp/staging646174384/srv/gopath/src/cloud.google.com
2019/12/10 03:56:17 Copying /workspace/_gopath/src/github.com to /tmp/staging646174384/srv/gopath/src/github.com
2019/12/10 03:56:17 Copying /workspace/_gopath/src/go.opencensus.io to /tmp/staging646174384/srv/gopath/src/go.opencensus.io
2019/12/10 03:56:17 Copying /workspace/_gopath/src/golang.org to /tmp/staging646174384/srv/gopath/src/golang.org
2019/12/10 03:56:17 Copying /workspace/_gopath/src/google.golang.org to /tmp/staging646174384/srv/gopath/src/google.golang.org
2019/12/10 03:56:17 Your app is not on your GOPATH, this build may fail.
2019/12/10 03:56:17 Building from Go source in /tmp/staging646174384/srv, with main package at ./...
2019/12/10 03:56:17 Building /tmp/staging646174384/srv, saving to /tmp/staging646174384/usr/local/bin/start
2019/12/10 03:56:19 Wrote build output to /builder/outputs/output
2019/12/10 03:56:19 Failed to build app: Your app is not on your GOPATH, please move it there and try again.
building app with command '[go build -o /tmp/staging646174384/usr/local/bin/start ./...]', env '[PATH=/go/bin:/usr/local/go/bin:/builder/google-cloud-sdk/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=e6a5de90920f HOME=/builder/home BUILDER_OUTPUT=/builder/outputs DEBIAN_FRONTEND=noninteractive GOROOT=/usr/local/go/ GOPATH=/go GOPATH=/tmp/staging646174384/srv/gopath]': err=exit status 1, out=go build: cannot use -o with multiple packages.
MacBook:cloud stephane$ echo $GOPATH
MacBook:cloud stephane$ go env GOPATH
/Users/stephane/go
got error when attempting to create the cluster in line 61 of setup.sh
to fix, I just use highest version of GKE master version that UI showed me was supported
--cluster-version "1.13.5-gke.10" \
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.