0
votes

When I manually run gcloud app deploy from Cloud Shell, I am able to deploy the application to App Engine and it works.

But when I try to do the same via Cloud Build, the build succeeds, but the application URL returns a 500 Error.

App Engine Application

cloudbuild.yaml

Cloudbuild Service Account Permissions

The Winston library tries to create a logs directory when the npm start script it run. Seems like the Service Account is unable to create that directory according to the Logs Explorer. This error does not appear when I deploy it through Cloud Shell.

enter image description here

What does the Cloud Build Service Account need?

1
is your logs directory part of gitignore? It may be possible that deploying manually works because you have a logs directory in your local but not on cloud build.dishant makwana
You are correct! Thank you.ballsofpicasso
I have written the same solution as an answer. Please mark my answer as accepted. It helps me get reputation points.dishant makwana

1 Answers

1
votes

is your logs directory part of gitignore? It may be possible that deploying manually works because you have a logs directory in your local but not on cloud build