4

In my docker file , I have following Lines

RUN go get -v -u go.mongodb.org/mongo-driver/mongo

RUN go get -d -v ./...

RUN go get google.golang.org/api/option

I am getting following error . Everything was working fine 3 days before.

Step 9/17 : RUN go get google.golang.org/api/option
 ---> Running in ec36bafa25aa
# google.golang.org/api/option
../google.golang.org/api/option/option.go:153:14: undefined: grpc.RoundRobin
../google.golang.org/api/option/option.go:154:42: undefined: grpc.WithBalancer
The command '/bin/sh -c go get google.golang.org/api/option' returned a non-zero code: 2
max
  • 1,505
  • 3
  • 15
  • 38
  • What changed 3 days ago? – Jonathan Hall Jan 12 '20 at 16:20
  • You should be using go modules or vendoring your dependencies to avoid problems with third-party APIs breaking randomly. – Jonathan Hall Jan 12 '20 at 16:20
  • Someone must have changed google.golang.org/api/option . Trying to find out – max Jan 12 '20 at 16:27
  • in my src folder i can see /google.golang.org/api/option/option.go file and the changes. is there a way to find out who made these changes? Source code does not seems to be available at github – max Jan 12 '20 at 16:34
  • Issue seems to be related to https://github.com/grpc/grpc-go/issues/3312, This completely breaks Docker Build – max Jan 12 '20 at 16:45
  • There seems to be disconnect between two google teams ( grpc and api ). Details discussion is present here. https://github.com/googleapis/google-api-go-client/issues/441 Issue reported 2 days ago but no fix is provided yet. Many docker build using go must be affected due to this. – max Jan 12 '20 at 17:16
  • 1
    Good detective work! Still, using go modules or vendoring is your best bet to prevent this sort of thing in the future. And it's best practice anyway. – Jonathan Hall Jan 12 '20 at 17:57
  • 1
    I was able to resolve this issue by vendoring with go modules as mentioned. Also needed to update my docker container to pull from an image which supports go modules `FROM golang:1.13`. – Zachary Denham Jan 12 '20 at 20:38

0 Answers0