Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing go.sum entry error RAM deployment failed in cloud build #129

Closed
BrunoReboul opened this issue Feb 18, 2021 · 0 comments · Fixed by #132
Closed

missing go.sum entry error RAM deployment failed in cloud build #129

BrunoReboul opened this issue Feb 18, 2021 · 0 comments · Fixed by #132
Assignees
Labels
type: bug Error or flaw in code with unintended results
Milestone

Comments

@BrunoReboul
Copy link
Owner

Error:

Step #1 - "build a fresh ram cli": Already have image: golang
Step #1 - "build a fresh ram cli": go: github.com/BrunoReboul/[email protected]: missing go.sum entry; to add it:
Step #1 - "build a fresh ram cli":  go mod download github.com/BrunoReboul/ram

Occurs on any build, including existing successful build when hitting RETRY

Root Cause:

Cloud function GO runtime is bounded to GO v1.13

RAM developper’s GO version is aligned to the same version to avoid using new GO feature that won t be available on cloud functions.

go version go1.13.8 linux/amd64

Cloud Build environment uses the online GOLANG container that is continuously updated, currently using GO v1.16

Step #0 - "display go language version": Status: Downloaded newer image for golang:latest
Step #0 - "display go language version": docker.io/library/golang:latest
Step #0 - "display go language version": go version go1.16 linux/amd64

With GO 1.16 the -mod option for automatic updates default value changes

In Go 1.15 and lower, the -mod=mod flag was enabled by default, so updates were performed automatically. Since Go 1.16, the go command acts as if -mod=readonly were set instead: if any changes to go.mod are needed, the go command reports an error and suggests a fix.

Proposed fix

Update the Cloud Build triggers build steps definition:
add go version to ease troubleshooting by always displaying which version of GO is used by the GOLANG Docker container
Add to the go build command the flag -mod=mod to allow automatic updates

steps:
 - name: golang
   args:
     - go
     - version
   id: display go language version
 - name: golang
   args:
     - go
     - build
     - '-mod=mod'
     - ram.go
   id: build a fresh ram cli
@BrunoReboul BrunoReboul added the type: bug Error or flaw in code with unintended results label Feb 18, 2021
@BrunoReboul BrunoReboul added this to the 2021-03 milestone Feb 18, 2021
@BrunoReboul BrunoReboul self-assigned this Feb 18, 2021
@BrunoReboul BrunoReboul mentioned this issue Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Error or flaw in code with unintended results
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant