Oliver Watkins
Oliver Watkins

Reputation: 13539

Cannot build using gcloud build command. Gcloud "FAILURE"

I am following the tutorial on how to set up a basic hello world type application on google cloud run :

https://cloud.google.com/run/docs/quickstarts/build-and-deploy#java

I perform the step :

gcloud builds submit --tag gcr.io/PROJECT-ID/helloworld

In my case :

gcloud builds submit --tag gcr.io/whataboutanewproject/helloworld

And I get an exception

ERROR: (gcloud.builds.submit) build 522dae9a-ddc3-4add-aeb4-f0a542c33649 completed with status "FAILURE"

My entire stack trace looks like this :

C:\dev\temp\cloudrun\helloworld>gcloud builds submit --tag gcr.io/whataboutanewproject/helloworld
Creating temporary tarball archive of 13 file(s) totalling 76.4 KiB before compression.
Uploading tarball of [.] to [gs://whataboutanewproject_cloudbuild/source/1600095894.659957-225401928ec54d23ad36d56f150a2040.tgz]
Created [https://cloudbuild.googleapis.com/v1/projects/whataboutanewproject/builds/a71fcef2-d9da-4c6f-a5e8-2b6086c962b2].
Logs are available at [https://console.cloud.google.com/cloud-build/builds/a71fcef2-d9da-4c6f-a5e8-2b6086c962b2?project=825197540625].
------------------------------------------------------------------------------------------------------------ REMOTE BUILD OUTPUT ------------------------------------------------------------------------------------------------------------
starting build "a71fcef2-d9da-4c6f-a5e8-2b6086c962b2"

FETCHSOURCE
Fetching storage object: gs://whataboutanewproject_cloudbuild/source/1600095894.659957-225401928ec54d23ad36d56f150a2040.tgz#1600095896709973
Copying gs://whataboutanewproject_cloudbuild/source/1600095894.659957-225401928ec54d23ad36d56f150a2040.tgz#1600095896709973...
/ [1 files][ 53.1 KiB/ 53.1 KiB]
Operation completed over 1 objects/53.1 KiB.
BUILD
Already have image (with digest): gcr.io/cloud-builders/docker
Sending build context to Docker daemon  109.6kB
Step 1/8 : FROM maven:3.6-jdk-11 as builder
3.6-jdk-11: Pulling from library/maven
57df1a1f1ad8: Pulling fs layer
71e126169501: Pulling fs layer
1af28a55c3f3: Pulling fs layer
03f1c9932170: Pulling fs layer
881ad7aafb13: Pulling fs layer
9c0ffd4062f3: Pulling fs layer
bd62e479351a: Pulling fs layer
5d4cc47cef87: Pulling fs layer
0c8911cc7703: Pulling fs layer
c19e861fcc5b: Pulling fs layer
03f1c9932170: Waiting
881ad7aafb13: Waiting
9c0ffd4062f3: Waiting
bd62e479351a: Waiting
5d4cc47cef87: Waiting
0c8911cc7703: Waiting
c19e861fcc5b: Waiting
1af28a55c3f3: Verifying Checksum
1af28a55c3f3: Download complete
71e126169501: Verifying Checksum
71e126169501: Download complete
57df1a1f1ad8: Verifying Checksum
57df1a1f1ad8: Download complete
9c0ffd4062f3: Verifying Checksum
9c0ffd4062f3: Download complete
881ad7aafb13: Verifying Checksum
881ad7aafb13: Download complete
03f1c9932170: Verifying Checksum
03f1c9932170: Download complete
5d4cc47cef87: Verifying Checksum
5d4cc47cef87: Download complete
0c8911cc7703: Verifying Checksum
0c8911cc7703: Download complete
c19e861fcc5b: Verifying Checksum
c19e861fcc5b: Download complete
57df1a1f1ad8: Pull complete
71e126169501: Pull complete
1af28a55c3f3: Pull complete
bd62e479351a: Verifying Checksum
bd62e479351a: Download complete
03f1c9932170: Pull complete
881ad7aafb13: Pull complete
9c0ffd4062f3: Pull complete
bd62e479351a: Pull complete
5d4cc47cef87: Pull complete
0c8911cc7703: Pull complete
c19e861fcc5b: Pull complete
Digest: sha256:c3bf5c312b5ad860cfd0b0f7a9b548367fbf2a52a3a786d5ed23742abe2a70db
Status: Downloaded newer image for maven:3.6-jdk-11
 ---> 89d9818b132c
Step 2/8 : WORKDIR /app
 ---> Running in b5b37ac614df
Removing intermediate container b5b37ac614df
 ---> dd90b62db365
Step 3/8 : COPY pom.xml .
COPY failed: stat /var/lib/docker/tmp/docker-builder268680314/pom.xml: no such file or directory
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ERROR: (gcloud.builds.submit) build a71fcef2-d9da-4c6f-a5e8-2b6086c962b2 completed with status "FAILURE"

C:\dev\temp\cloudrun\helloworld>

Why is this happening?

Upvotes: 0

Views: 876

Answers (1)

asbovelw
asbovelw

Reputation: 572

As John Hanley said, your build is missing the pom.xml file.

Upvotes: 1

Related Questions