magnusbaeck / logstash-filter-verifier

Apache License 2.0
192 stars 27 forks source link

Error when compiling the latest version #61

Closed exhuma closed 5 years ago

exhuma commented 5 years ago

I'm trying to build this into an image, and I get a compile-time error. Here is my output:

Step 1/5 : FROM golang:latest
 ---> fb7a47d8605b
Step 2/5 : ENV GOPATH=/root/go
 ---> Using cache
 ---> 97ddf9dff006
Step 3/5 : RUN mkdir /root/go
 ---> Using cache
 ---> 9f8f836a280b
Step 4/5 : RUN go get -d -v github.com/magnusbaeck/logstash-filter-verifier
 ---> Running in ed267b5c042a
github.com/magnusbaeck/logstash-filter-verifier (download)
github.com/alecthomas/kingpin (download)
github.com/alecthomas/template (download)
github.com/alecthomas/units (download)
github.com/blang/semver (download)
github.com/op/go-logging (download)
github.com/breml/logstash-config (download)
github.com/mitchellh/packer (download)
github.com/mattn/go-shellwords (download)
Removing intermediate container ed267b5c042a
 ---> 9e7484453fad
Step 5/5 : RUN cd /root/go/src/github.com/magnusbaeck/logstash-filter-verifier && make
 ---> Running in a84b5651d4b4
TMPFILE=$(mktemp version.go.XXXX) && \
    echo "package main" >> $TMPFILE && \
    echo "const version = \"1.4.1-9-g6efc730\"" >> $TMPFILE && \
    gofmt -w $TMPFILE && \
    if ! cmp --quiet $TMPFILE version.go ; then \
        mv $TMPFILE version.go ; \
    fi && \
    rm -f $TMPFILE
mkdir -p /root/go/bin/
curl --silent --show-error \
    https://raw.githubusercontent.com/pote/gpm/v1.4.0/bin/gpm > /root/go/bin/gpm
curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
make: *** [/root/go/bin/gpm] Error 35
Makefile:81: recipe for target '/root/go/bin/gpm' failed
The command '/bin/sh -c cd /root/go/src/github.com/magnusbaeck/logstash-filter-verifier && make' returned a non-zero code: 2
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2

Running go get without -d I get the following:

Step 1/4 : FROM golang:latest
latest: Pulling from library/golang
05d1a5232b46: Pull complete
5cee356eda6b: Pull complete
89d3385f0fd3: Pull complete
80ae6b477848: Pull complete
94ebfeaaddf3: Pull complete
dd697213ec59: Pull complete
715d1281dfe7: Pull complete
Digest: sha256:e8e4c4406217b415c506815d38e3f8ac6e05d0121b19f686c5af7eaadf96f081
Status: Downloaded newer image for golang:latest
 ---> fb7a47d8605b
Step 2/4 : ENV GOPATH=/root/go
 ---> Running in 2e87b74028cf
Removing intermediate container 2e87b74028cf
 ---> 97ddf9dff006
Step 3/4 : RUN mkdir /root/go
 ---> Running in 7892d22f3c22
Removing intermediate container 7892d22f3c22
 ---> 9f8f836a280b
Step 4/4 : RUN go get -v github.com/magnusbaeck/logstash-filter-verifier
 ---> Running in 421d23d0a737
github.com/magnusbaeck/logstash-filter-verifier (download)
github.com/alecthomas/kingpin (download)
github.com/alecthomas/template (download)
github.com/alecthomas/units (download)
github.com/blang/semver (download)
github.com/op/go-logging (download)
github.com/breml/logstash-config (download)
github.com/mitchellh/packer (download)
github.com/mattn/go-shellwords (download)
github.com/alecthomas/units
github.com/alecthomas/template/parse
github.com/blang/semver
github.com/op/go-logging
github.com/breml/logstash-config/ast
github.com/mitchellh/packer/common/json
github.com/magnusbaeck/logstash-filter-verifier/logging
github.com/breml/logstash-config
github.com/mattn/go-shellwords
github.com/alecthomas/template
github.com/alecthomas/kingpin
github.com/magnusbaeck/logstash-filter-verifier/logstash
github.com/magnusbaeck/logstash-filter-verifier/testcase
github.com/magnusbaeck/logstash-filter-verifier
# github.com/magnusbaeck/logstash-filter-verifier
/root/go/src/github.com/magnusbaeck/logstash-filter-verifier/logstash-filter-verifier.go:268:65: undefined: version
The command '/bin/sh -c go get -v github.com/magnusbaeck/logstash-filter-verifier' returned a non-zero code: 2
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2
magnusbaeck commented 5 years ago

Focusing on the first problem, it seems it could be caused by trying to speak HTTPS to an HTTP host. Are you using an HTTP proxy? Can you use curl to fetch the URL in question directly on the host (i.e. is the problem in any way Docker-related)?

magnusbaeck commented 5 years ago

Closing due to lack of feedback.