1

I keep running into this error when trying to deploy a very simple website to App Engine (this code without the Dockerfile, as specified in this tutorial).

I am running on macOS Monterey 12.2.1, go 1.18, fresh install of the Google Cloud SDK. I'm not using any external packages either.

Every time that I try to deploy, I get the Step #0: exec: "gcc": executable file not found in $PATH error. Here's a larger snippet:

Step #0: go: finding golang.org/x/tools v0.0.0-20200904185747-39188db58858
Step #0: go: finding google.golang.org/grpc v1.31.1
Step #0: go: finding golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f
Step #0: # net
Step #0: exec: "gcc": executable file not found in $PATH
Finished Step #0
ERROR
ERROR: build step 0 "gcr.io/gcp-runtimes/go1-builder@sha256:408a098788ef4cdeec452821946b986ef82ce5ebceecbdf748ffecf329765bce" failed: step exited with non-zero status: 2

Any clues what is going wrong? I read some similar posts that it could be an error with the PATH, but I could not get anything to work for myself. Here is my path:

/usr/bin:/usr/local/go/bin:/Users/temporaryadmin/go/bin:/Users/temporaryadmin/google-cloud-sdk/bin:/Users/temporaryadmin/.pyenv/shims:/Users/temporaryadmin/.pyenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/bin/python3:/usr/local/go/bin

Really struggling to understand what I can do to fix this so I can start uploading to App Engine. Thanks a lot!

zsaylor
  • 11
  • 1
  • "CGO_ENABLED=0" will turn off CGo if your applcation doesn't require it, and you shouldn't need GCC at that point. It will also result in making your binaries static which is usually good for distribution. – erik258 Apr 12 '22 at 17:24
  • 1
    Go 1.17 and 1.18 aren't supported by App Engine for now. If you need those versions, create a container and deploy it on Cloud Run (or on App ENgine flex, but I don't recommend you that solution!) – guillaume blaquiere Apr 12 '22 at 20:12
  • @guillaumeblaquiere hm, still facing the issue in Go 1.15 – zsaylor Apr 14 '22 at 14:17
  • @DanielFarrell I tried adding that config to my app.yaml but still face the same error. Is this the wrong place? Do I need to disable that setting locally? – zsaylor Apr 14 '22 at 14:19
  • You need to set it in the environment where you do `go build` . Looks like that would be in a Dockerfile – erik258 Apr 15 '22 at 16:06

0 Answers0